mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
drm/bridge: analogix_dp: inline analogix_dp_prepare_panel()
The analogix_dp_prepare_panel() is now only calling a corresponding drm_panel function. Inline it to simplify the code. Tested-by: Damon Ding <damon.ding@rock-chips.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250401-panel-return-void-v1-5-93e1be33dc8d@oss.qualcomm.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
This commit is contained in:
parent
62ca1c3a14
commit
d5f34ca5df
|
|
@ -955,33 +955,6 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)
|
|||
return analogix_dp_send_psr_spd(dp, &psr_vsc, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is a bit of a catch-all for panel preparation, hopefully
|
||||
* simplifying the logic of functions that need to prepare/unprepare the panel
|
||||
* below.
|
||||
*
|
||||
* If @prepare is true, this function will prepare the panel. Conversely, if it
|
||||
* is false, the panel will be unprepared.
|
||||
*
|
||||
* The function will disregard the current state
|
||||
* of the panel and either prepare/unprepare the panel based on @prepare.
|
||||
*/
|
||||
static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,
|
||||
bool prepare)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!dp->plat_data->panel)
|
||||
return 0;
|
||||
|
||||
if (prepare)
|
||||
ret = drm_panel_prepare(dp->plat_data->panel);
|
||||
else
|
||||
ret = drm_panel_unprepare(dp->plat_data->panel);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int analogix_dp_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
struct analogix_dp_device *dp = to_dp(connector);
|
||||
|
|
@ -1174,9 +1147,11 @@ static void analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge,
|
|||
if (old_crtc_state && old_crtc_state->self_refresh_active)
|
||||
return;
|
||||
|
||||
ret = analogix_dp_prepare_panel(dp, true);
|
||||
if (ret)
|
||||
DRM_ERROR("failed to setup the panel ret = %d\n", ret);
|
||||
if (dp->plat_data->panel) {
|
||||
ret = drm_panel_prepare(dp->plat_data->panel);
|
||||
if (ret)
|
||||
DRM_ERROR("failed to prepare the panel ret = %d\n", ret);
|
||||
}
|
||||
}
|
||||
|
||||
static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
|
||||
|
|
@ -1274,9 +1249,11 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
|
|||
|
||||
pm_runtime_put_sync(dp->dev);
|
||||
|
||||
ret = analogix_dp_prepare_panel(dp, false);
|
||||
if (ret)
|
||||
DRM_ERROR("failed to setup the panel ret = %d\n", ret);
|
||||
if (dp->plat_data->panel) {
|
||||
ret = drm_panel_unprepare(dp->plat_data->panel);
|
||||
if (ret)
|
||||
DRM_ERROR("failed to unprepare the panel ret = %d\n", ret);
|
||||
}
|
||||
|
||||
dp->fast_train_enable = false;
|
||||
dp->psr_supported = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user