drm/panel: make prepare / enable / disable / unprepare return void
Subsystems (4)
cover drm/panel: make prepare / enable / disable / unprepare return void
While it makes sense for panel callbacks to be able to return an error, the state-management functions from drm_panel API are usually called from atomic callbacks, which can not fails and must return void. Make drm_panel_prepare(), drm_panel_enable(), drm_panel_disable() and drm_panel_unprepare() follow the same calling convention and return void.
---
Dmitry Baryshkov (7):
drm/bridge: analogix_dp: drop extra calls to analogix_dp_prepare_panel() drm/bridge: analogix_dp: drop unused argument to analogix_dp_prepare_panel() drm/bridge: analogic_dp: drop panel_is_modeset
drm/bridge: analogic_dp: drop panel_lock
drm/bridge: analogix_dp: inline analogix_dp_prepare_panel() drm/bridge: analogix_dp: ignore return values of drm_panel_* calls drm/panel: make prepare/enable and disable/unprepare calls return void
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 107 ++------------------- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 3 - drivers/gpu/drm/drm_panel.c | 54 ++++------- drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 9 +- include/drm/drm_panel.h | 8 +- 5 files changed, 33 insertions(+), 148 deletions(-)
---
base-commit: bfb20a655848a9088e3e9ae24b1dcce1bbf016c2
change-id: 20250401-panel-return-void-d461c71ebd35
Best regards,
Signature · 1 line
Dmitry Baryshkov <[email protected]>
PATCH 1/7 drm/bridge: analogix_dp: drop extra calls to analogix_dp_prepare_panel()
The analogix_dp_prepare_panel() returns immediately if there is no attached panel. Drop several calls to this function which are performed when dp->plat_data->panel is NULL.
--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1 -21
@@ -1005,17 +1005,11 @@ static int analogix_dp_get_modes(struct drm_connector *connector) {struct analogix_dp_device *dp =to_dp (connector);const struct drm_edid *drm_edid; -int ret, num_modes =0 ; +int num_modes =0 ;if (dp->plat_data->panel) { num_modes +=drm_panel_get_modes (dp->plat_data->panel, connector); }else { - ret =analogix_dp_prepare_panel (dp, true, false); -if (ret) { -DRM_ERROR ("Failed to prepare panel (%d)\n" , ret); -return 0 ; - } - drm_edid =drm_edid_read_ddc (connector, &dp->aux.ddc);drm_edid_connector_update (&dp->connector, drm_edid);
@@ -1024,10 +1018,6 @@ static int analogix_dp_get_modes(struct drm_connector *connector) num_modes +=drm_edid_connector_add_modes (&dp->connector);drm_edid_free (drm_edid); } - - ret =analogix_dp_prepare_panel (dp, false, false); -if (ret) -DRM_ERROR ("Failed to unprepare panel (%d)\n" , ret); }if (dp->plat_data->get_modes)
@@ -1087,19 +1077,9 @@ analogix_dp_detect(struct drm_connector *connector, bool force)if (dp->plat_data->panel)return connector_status_connected; - ret =analogix_dp_prepare_panel (dp, true, false); -if (ret) { -DRM_ERROR ("Failed to prepare panel (%d)\n" , ret); -return connector_status_disconnected; - } -if (!analogix_dp_detect_hpd (dp)) status = connector_status_connected; - ret =analogix_dp_prepare_panel (dp, false, false); -if (ret) -DRM_ERROR ("Failed to unprepare panel (%d)\n" , ret); -return status; }
Signature · 1 line
2.39.5
Re: [PATCH 1/7] drm/bridge: analogix_dp: drop extra calls to analogix_dp_prepare_panel()
Hi Dmitry,
Quoted 54 lines · Dmitry Baryshkov
The
analogix_dp_prepare_panel()returns immediately if there is no attached panel. Drop several calls to this function which are performed whendp->plat_data->panelis NULL.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-17@@ -1005,17 +1005,11 @@ static int analogix_dp_get_modes(struct drm_connector *connector) {struct analogix_dp_device *dp =to_dp (connector);const struct drm_edid *drm_edid; -int ret, num_modes =0 ; +int num_modes =0 ;if (dp->plat_data->panel) { num_modes +=drm_panel_get_modes (dp->plat_data->panel, connector); }else { - ret =analogix_dp_prepare_panel (dp, true, false); -if (ret) { -DRM_ERROR ("Failed to prepare panel (%d)\n" , ret); -return 0 ; - } - drm_edid =drm_edid_read_ddc (connector, &dp->aux.ddc);drm_edid_connector_update (&dp->connector, drm_edid);@@ -1024,10 +1018,6 @@ static int analogix_dp_get_modes(struct drm_connector *connector) num_modes +=drm_edid_connector_add_modes (&dp->connector);drm_edid_free (drm_edid); } - - ret =analogix_dp_prepare_panel (dp, false, false); -if (ret) -DRM_ERROR ("Failed to unprepare panel (%d)\n" , ret); }if (dp->plat_data->get_modes)@@ -1087,19 +1077,9 @@ analogix_dp_detect(struct drm_connector *connector, bool force)if (dp->plat_data->panel)return connector_status_connected; - ret =analogix_dp_prepare_panel (dp, true, false); -if (ret) { -DRM_ERROR ("Failed to prepare panel (%d)\n" , ret); -return connector_status_disconnected; - } -
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c analogix_dp_detect(struct drm_connector *connector, bool force) · line 1085
Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0
-4if (!analogix_dp_detect_hpd (dp)) status = connector_status_connected; - ret =analogix_dp_prepare_panel (dp, false, false); -if (ret) -DRM_ERROR ("Failed to unprepare panel (%d)\n" , ret); -return status; }
With the patch series:
https://patchwork.kernel.org/project/linux-rockchip/list/?series=942183
When I verify this patch, there will be a small warning:drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1075:6: warning: unused variable 'ret' [-Wunused-variable]
int ret;
^It should be better to remove the unused 'ret'.
Best regards,
Damon
Damon Ding
Tested-byRe: [PATCH 1/7] drm/bridge: analogix_dp: drop extra calls to analogix_dp_prepare_panel()
Quoted 74 lines · Damon Ding
Hi Dmitry,
Quoted 52 lines · Dmitry Baryshkov
The
analogix_dp_prepare_panel()returns immediately if there is no attached panel. Drop several calls to this function which are performed whendp->plat_data->panelis NULL.Signed-off-by Dmitry Baryshkov <[email protected]>---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c| 22
+---------------------1 file changed, 1 insertion(+), 21 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-16@@ -1005,17 +1005,11 @@ static int analogix_dp_get_modes(struct drm_connector *connector) { struct analogix_dp_device *dp = to_dp(connector); const struct drm_edid *drm_edid; - int ret, num_modes = 0; + int num_modes = 0; if (dp->plat_data->panel) { num_modes += drm_panel_get_modes(dp->plat_data->panel, connector); } else { - ret = analogix_dp_prepare_panel(dp, true, false); - if (ret) { - DRM_ERROR("Failed to prepare panel (%d)\n", ret); - return 0; - } - drm_edid = drm_edid_read_ddc(connector, &dp->aux.ddc); drm_edid_connector_update(&dp->connector, drm_edid);@@ -1024,10 +1018,6 @@ static int analogix_dp_get_modes(struct drm_connector *connector) num_modes += drm_edid_connector_add_modes(&dp->connector); drm_edid_free(drm_edid); } - - ret = analogix_dp_prepare_panel(dp, false, false); - if (ret) - DRM_ERROR("Failed to unprepare panel (%d)\n", ret); } if (dp->plat_data->get_modes)@@ -1087,19 +1077,9 @@ analogix_dp_detect(struct drm_connector *connector, bool force) if (dp->plat_data->panel) return connector_status_connected; - ret = analogix_dp_prepare_panel(dp, true, false); - if (ret) { - DRM_ERROR("Failed to prepare panel (%d)\n", ret); - return connector_status_disconnected; - }drivers/gpu/drm/bridge/analogix/analogix_dp_core.c analogix_dp_detect(struct drm_connector · line 1084
Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0
-5- if (!analogix_dp_detect_hpd(dp)) status = connector_status_connected; - ret = analogix_dp_prepare_panel(dp, false, false); - if (ret) - DRM_ERROR("Failed to unprepare panel (%d)\n", ret); - return status; }With the patch series:
https://patchwork.kernel.org/project/linux-rockchip/list/?series=942183When I verify this patch, there will be a small warning:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1075:6: warning: unused variable 'ret' [-Wunused-variable]
int ret;
^
Quoted 7 lines
It should be better to remove the unused 'ret'.
Best regards,
Damon
Re: [PATCH 1/7] drm/bridge: analogix_dp: drop extra calls to analogix_dp_prepare_panel()
Quoted 73 lines · Damon Ding
Quoted 72 lines · Damon Ding
Hi Dmitry,
Quoted 55 lines · Dmitry Baryshkov
The
analogix_dp_prepare_panel()returns immediately if there is no attached panel. Drop several calls to this function which are performed whendp->plat_data->panelis NULL.Signed-off-by Dmitry Baryshkov <[email protected]>---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c| 22
+---------------------1 file changed, 1 insertion(+), 21 deletions(-)(quoted diff) renamed from drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0
-0
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index042154e2d8ccd74ac2dc27fe527e810a50e08a09..ab1cfc340aa95bbf13fe021bd33227b565a5458d100644drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-16@@ -1005,17 +1005,11 @@ static int analogix_dp_get_modes(struct drm_connector *connector) { struct analogix_dp_device *dp = to_dp(connector); const struct drm_edid *drm_edid; - int ret, num_modes = 0; + int num_modes = 0; if (dp->plat_data->panel) { num_modes += drm_panel_get_modes(dp->plat_data->panel, connector); } else { - ret = analogix_dp_prepare_panel(dp, true, false); - if (ret) { - DRM_ERROR("Failed to prepare panel (%d)\n", ret); - return 0; - } - drm_edid = drm_edid_read_ddc(connector, &dp->aux.ddc); drm_edid_connector_update(&dp->connector, drm_edid);@@ -1024,10 +1018,6 @@ static int analogix_dp_get_modes(struct drm_connector *connector) num_modes += drm_edid_connector_add_modes(&dp->connector); drm_edid_free(drm_edid); } - - ret = analogix_dp_prepare_panel(dp, false, false); - if (ret) - DRM_ERROR("Failed to unprepare panel (%d)\n", ret); } if (dp->plat_data->get_modes)@@ -1087,19 +1077,9 @@ analogix_dp_detect(struct drm_connector *connector, bool force) if (dp->plat_data->panel) return connector_status_connected; - ret = analogix_dp_prepare_panel(dp, true, false); - if (ret) { - DRM_ERROR("Failed to prepare panel (%d)\n", ret); - return connector_status_disconnected; - }drivers/gpu/drm/bridge/analogix/analogix_dp_core.c analogix_dp_detect(struct drm_connector · line 1084
Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0
-5- if (!analogix_dp_detect_hpd(dp)) status = connector_status_connected; - ret = analogix_dp_prepare_panel(dp, false, false); - if (ret) - DRM_ERROR("Failed to unprepare panel (%d)\n", ret); - return status; }With the patch series:
https://patchwork.kernel.org/project/linux-rockchip/list/?series=942183
Quoted 7 lines
Quoted 7 lines
When I verify this patch, there will be a small warning:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1075:6: warning:
unused variable 'ret' [-Wunused-variable]
int ret;
^It should be better to remove the unused 'ret'.
I can't reproduce the warning, so I'd like to push the series once patch 3/7 gets an R-B.
Quoted 9 lines
Quoted 6 lines
Best regards,
DamonTested-by Damon Ding <[email protected]>
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 1/7] drm/bridge: analogix_dp: drop extra calls to analogix_dp_prepare_panel()
In reply to Dmitry BaryshkovQuoted 54 lines · Dmitry Baryshkov
The
analogix_dp_prepare_panel()returns immediately if there is no attached panel. Drop several calls to this function which are performed whendp->plat_data->panelis NULL.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-17@@ -1005,17 +1005,11 @@ static int analogix_dp_get_modes(struct drm_connector *connector) {struct analogix_dp_device *dp =to_dp (connector);const struct drm_edid *drm_edid; -int ret, num_modes =0 ; +int num_modes =0 ;if (dp->plat_data->panel) { num_modes +=drm_panel_get_modes (dp->plat_data->panel, connector); }else { - ret =analogix_dp_prepare_panel (dp, true, false); -if (ret) { -DRM_ERROR ("Failed to prepare panel (%d)\n" , ret); -return 0 ; - } - drm_edid =drm_edid_read_ddc (connector, &dp->aux.ddc);drm_edid_connector_update (&dp->connector, drm_edid);@@ -1024,10 +1018,6 @@ static int analogix_dp_get_modes(struct drm_connector *connector) num_modes +=drm_edid_connector_add_modes (&dp->connector);drm_edid_free (drm_edid); } - - ret =analogix_dp_prepare_panel (dp, false, false); -if (ret) -DRM_ERROR ("Failed to unprepare panel (%d)\n" , ret); }if (dp->plat_data->get_modes)@@ -1087,19 +1077,9 @@ analogix_dp_detect(struct drm_connector *connector, bool force)if (dp->plat_data->panel)return connector_status_connected; - ret =analogix_dp_prepare_panel (dp, true, false); -if (ret) { -DRM_ERROR ("Failed to prepare panel (%d)\n" , ret); -return connector_status_disconnected; - } -
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c analogix_dp_detect(struct drm_connector *connector, bool force) · line 1085
Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0
-4if (!analogix_dp_detect_hpd (dp)) status = connector_status_connected; - ret =analogix_dp_prepare_panel (dp, false, false); -if (ret) -DRM_ERROR ("Failed to unprepare panel (%d)\n" , ret); -return status; }
PATCH 2/7 drm/bridge: analogix_dp: drop unused argument to analogix_dp_prepare_panel()
In reply to Dmitry BaryshkovAfter previous cleanup all calling sites pass true as is_modeset_prepare argument to analogix_dp_prepare_panel(). Drop dead code depending on that argument being false.
--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5 -14
@@ -963,13 +963,13 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)* If @prepare is true, this function will prepare the panel. Conversely, if it * is false, the panel will be unprepared. * -* If @is_modeset_prepare is true, the function will disregard the current state +* The function will disregard the current state * of the panel and either prepare/unprepare the panel based on @prepare. Once * it finishes, it will update dp->panel_is_modeset to reflect the current state * of the panel. */ static int analogix_dp_prepare_panel (struct analogix_dp_device *dp, -bool prepare,bool is_modeset_prepare) +bool prepare) {int ret =0 ;
@@ -978,13 +978,6 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,mutex_lock (&dp->panel_lock); -/* -* Exit early if this is a temporary prepare/unprepare and we're already -* modeset (since we neither want to prepare twice or unprepare early). -*/ -if (dp->panel_is_modeset && !is_modeset_prepare) - goto out; -if (prepare) ret =drm_panel_prepare (dp->plat_data->panel);else
@@ -993,8 +986,7 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,if (ret) goto out; -if (is_modeset_prepare) - dp->panel_is_modeset = prepare; + dp->panel_is_modeset = prepare; out:mutex_unlock (&dp->panel_lock);
@@ -1072,7 +1064,6 @@ analogix_dp_detect(struct drm_connector *connector, bool force) {struct analogix_dp_device *dp =to_dp (connector);enum drm_connector_status status = connector_status_disconnected; -int ret;if (dp->plat_data->panel)return connector_status_connected;
@@ -1194,7 +1185,7 @@ 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, true); + ret =analogix_dp_prepare_panel (dp, true);if (ret)DRM_ERROR ("failed to setup the panel ret = %d\n" , ret); }
@@ -1294,7 +1285,7 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)pm_runtime_put_sync (dp->dev); - ret =analogix_dp_prepare_panel (dp, false, true); + ret =analogix_dp_prepare_panel (dp, false);if (ret)DRM_ERROR ("failed to setup the panel ret = %d\n" , ret);
Signature · 1 line
2.39.5
Re: [PATCH 2/7] drm/bridge: analogix_dp: drop unused argument to analogix_dp_prepare_panel()
Hi Dmitry,
Quoted 72 lines · Dmitry Baryshkov
After previous cleanup all calling sites pass true as
is_modeset_prepareargument toanalogix_dp_prepare_panel(). Drop dead code depending on that argument being false.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +4
-13@@ -963,13 +963,13 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)* If @prepare is true, this function will prepare the panel. Conversely, if it * is false, the panel will be unprepared. * -* If @is_modeset_prepare is true, the function will disregard the current state +* The function will disregard the current state * of the panel and either prepare/unprepare the panel based on @prepare. Once * it finishes, it will update dp->panel_is_modeset to reflect the current state * of the panel. */ static int analogix_dp_prepare_panel (struct analogix_dp_device *dp, -bool prepare,bool is_modeset_prepare) +bool prepare) {int ret =0 ;@@ -978,13 +978,6 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,mutex_lock (&dp->panel_lock); -/* -* Exit early if this is a temporary prepare/unprepare and we're already -* modeset (since we neither want to prepare twice or unprepare early). -*/ -if (dp->panel_is_modeset && !is_modeset_prepare) - goto out; -if (prepare) ret =drm_panel_prepare (dp->plat_data->panel);else @@ -993,8 +986,7 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,if (ret) goto out; -if (is_modeset_prepare) - dp->panel_is_modeset = prepare; + dp->panel_is_modeset = prepare; out:mutex_unlock (&dp->panel_lock);@@ -1072,7 +1064,6 @@ analogix_dp_detect(struct drm_connector *connector, bool force) {struct analogix_dp_device *dp =to_dp (connector);enum drm_connector_status status = connector_status_disconnected; -int ret;if (dp->plat_data->panel)return connector_status_connected;@@ -1194,7 +1185,7 @@ 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, true); + ret =analogix_dp_prepare_panel (dp, true);if (ret)DRM_ERROR ("failed to setup the panel ret = %d\n" , ret); }
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static void analogix_dp_bridge_disable(struct drm_bridge *bridge) · line 1291
Quoted 8 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-1@@ -1294,7 +1285,7 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)pm_runtime_put_sync (dp->dev); - ret =analogix_dp_prepare_panel (dp, false, true); + ret =analogix_dp_prepare_panel (dp, false);if (ret)DRM_ERROR ("failed to setup the panel ret = %d\n" , ret);
The patch has been verified with the eDP panel "lg,lp079qx1-sp0v" in RK3588S EVB1 board.
Best regards,
Damon
Re: [PATCH 2/7] drm/bridge: analogix_dp: drop unused argument to analogix_dp_prepare_panel()
In reply to Dmitry BaryshkovQuoted 72 lines · Dmitry Baryshkov
After previous cleanup all calling sites pass true as
is_modeset_prepareargument toanalogix_dp_prepare_panel(). Drop dead code depending on that argument being false.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +4
-13@@ -963,13 +963,13 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)* If @prepare is true, this function will prepare the panel. Conversely, if it * is false, the panel will be unprepared. * -* If @is_modeset_prepare is true, the function will disregard the current state +* The function will disregard the current state * of the panel and either prepare/unprepare the panel based on @prepare. Once * it finishes, it will update dp->panel_is_modeset to reflect the current state * of the panel. */ static int analogix_dp_prepare_panel (struct analogix_dp_device *dp, -bool prepare,bool is_modeset_prepare) +bool prepare) {int ret =0 ;@@ -978,13 +978,6 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,mutex_lock (&dp->panel_lock); -/* -* Exit early if this is a temporary prepare/unprepare and we're already -* modeset (since we neither want to prepare twice or unprepare early). -*/ -if (dp->panel_is_modeset && !is_modeset_prepare) - goto out; -if (prepare) ret =drm_panel_prepare (dp->plat_data->panel);else @@ -993,8 +986,7 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,if (ret) goto out; -if (is_modeset_prepare) - dp->panel_is_modeset = prepare; + dp->panel_is_modeset = prepare; out:mutex_unlock (&dp->panel_lock);@@ -1072,7 +1064,6 @@ analogix_dp_detect(struct drm_connector *connector, bool force) {struct analogix_dp_device *dp =to_dp (connector);enum drm_connector_status status = connector_status_disconnected; -int ret;if (dp->plat_data->panel)return connector_status_connected;@@ -1194,7 +1185,7 @@ 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, true); + ret =analogix_dp_prepare_panel (dp, true);if (ret)DRM_ERROR ("failed to setup the panel ret = %d\n" , ret); }
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static void analogix_dp_bridge_disable(struct drm_bridge *bridge) · line 1291
Quoted 8 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-1@@ -1294,7 +1285,7 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)pm_runtime_put_sync (dp->dev); - ret =analogix_dp_prepare_panel (dp, false, true); + ret =analogix_dp_prepare_panel (dp, false);if (ret)DRM_ERROR ("failed to setup the panel ret = %d\n" , ret);
PATCH 3/7 drm/bridge: analogic_dp: drop panel_is_modeset
In reply to Dmitry BaryshkovThe dp->panel_is_modeset is now a write-only field. Drop it completely.
--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +---------- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1 -10
@@ -964,9 +964,7 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)* 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. Once -* it finishes, it will update dp->panel_is_modeset to reflect the current state -* of the panel. +* 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)
@@ -983,12 +981,6 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,else ret =drm_panel_unprepare (dp->plat_data->panel); -if (ret) - goto out; - - dp->panel_is_modeset = prepare; - -out:mutex_unlock (&dp->panel_lock);return ret; }
@@ -1532,7 +1524,6 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) dp->dpms_mode =DRM_MODE_DPMS_OFF ;mutex_init (&dp->panel_lock); - dp->panel_is_modeset = false;/* * platform dp driver need containor_of the plat_data to get
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +0 -1
@@ -170,7 +170,6 @@ struct analogix_dp_device {bool psr_supported;struct mutex panel_lock; -bool panel_is_modeset;struct analogix_dp_plat_data *plat_data; };
Signature · 1 line
2.39.5
Re: [PATCH 3/7] drm/bridge: analogic_dp: drop panel_is_modeset
Hi Dmitry,
Quoted 50 lines · Dmitry Baryshkov
The
dp->panel_is_modesetis now a write-only field. Drop it completely.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +---------- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-10@@ -964,9 +964,7 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)* 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. Once -* it finishes, it will update dp->panel_is_modeset to reflect the current state -* of the panel. +* 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)@@ -983,12 +981,6 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,else ret =drm_panel_unprepare (dp->plat_data->panel); -if (ret) - goto out; - - dp->panel_is_modeset = prepare; - -out:mutex_unlock (&dp->panel_lock);return ret; }@@ -1532,7 +1524,6 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) dp->dpms_mode =DRM_MODE_DPMS_OFF ;mutex_init (&dp->panel_lock); - dp->panel_is_modeset = false;/* * platform dp driver need containor_of the plat_data to get drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +0
-0
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h struct analogix_dp_device { · line 175
Quoted 7 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +0
-1@@ -170,7 +170,6 @@ struct analogix_dp_device {bool psr_supported;struct mutex panel_lock; -bool panel_is_modeset;struct analogix_dp_plat_data *plat_data; };
The patch has been verified with the eDP panel "lg,lp079qx1-sp0v" in RK3588S EVB1 board.
Best regards,
Damon
Neil Armstrong
maintainerRe: [PATCH 3/7] drm/bridge: analogic_dp: drop panel_is_modeset
In reply to Dmitry BaryshkovQuoted 57 lines · Dmitry Baryshkov
The
dp->panel_is_modesetis now a write-only field. Drop it completely.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +---------- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-10@@ -964,9 +964,7 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)* 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. Once -* it finishes, it will update dp->panel_is_modeset to reflect the current state -* of the panel. +* 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)@@ -983,12 +981,6 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,else ret =drm_panel_unprepare (dp->plat_data->panel); -if (ret) - goto out; - - dp->panel_is_modeset = prepare; - -out:mutex_unlock (&dp->panel_lock);return ret; }@@ -1532,7 +1524,6 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) dp->dpms_mode =DRM_MODE_DPMS_OFF ;mutex_init (&dp->panel_lock); - dp->panel_is_modeset = false;/* * platform dp driver need containor_of the plat_data to get drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +0
-1@@ -170,7 +170,6 @@ struct analogix_dp_device {bool psr_supported;struct mutex panel_lock; -bool panel_is_modeset;struct analogix_dp_plat_data *plat_data; };
Re: [PATCH 3/7] drm/bridge: analogic_dp: drop panel_is_modeset
Quoted 4 lines · Neil Armstrong
Quoted 3 lines · Dmitry Baryshkov
The
dp->panel_is_modesetis now a write-only field. Drop it completely.Signed-off-by Dmitry Baryshkov <[email protected]>
Neil, it looks like you wanted to respond with either a comment or an r-b tag, but none were present in the email...
Quoted 5 lines
Quoted 5 lines
--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +---------- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 3/7] drm/bridge: analogic_dp: drop panel_is_modeset
In reply to Dmitry BaryshkovQuoted 50 lines · Dmitry Baryshkov
The
dp->panel_is_modesetis now a write-only field. Drop it completely.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +---------- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-10@@ -964,9 +964,7 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)* 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. Once -* it finishes, it will update dp->panel_is_modeset to reflect the current state -* of the panel. +* 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)@@ -983,12 +981,6 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,else ret =drm_panel_unprepare (dp->plat_data->panel); -if (ret) - goto out; - - dp->panel_is_modeset = prepare; - -out:mutex_unlock (&dp->panel_lock);return ret; }@@ -1532,7 +1524,6 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) dp->dpms_mode =DRM_MODE_DPMS_OFF ;mutex_init (&dp->panel_lock); - dp->panel_is_modeset = false;/* * platform dp driver need containor_of the plat_data to get drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +0
-0
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h struct analogix_dp_device { · line 175
Quoted 7 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +0
-1@@ -170,7 +170,6 @@ struct analogix_dp_device {bool psr_supported;struct mutex panel_lock; -bool panel_is_modeset;struct analogix_dp_plat_data *plat_data; };
PATCH 4/7 drm/bridge: analogic_dp: drop panel_lock
In reply to Dmitry BaryshkovThe analogix_dp_prepare_panel() function is called from bridge's atomic_pre_enable() and atomic_post_disable() callbacks, which can not happen simultaneously. Drop the useless mutex.
--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 5 ----- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 2 -- 2 files changed, 7 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0 -5
@@ -974,14 +974,11 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,if (!dp->plat_data->panel)return 0 ; -mutex_lock (&dp->panel_lock); -if (prepare) ret =drm_panel_prepare (dp->plat_data->panel);else ret =drm_panel_unprepare (dp->plat_data->panel); -mutex_unlock (&dp->panel_lock);return ret; }
@@ -1523,8 +1520,6 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) dp->dev = &pdev->dev; dp->dpms_mode =DRM_MODE_DPMS_OFF ; -mutex_init (&dp->panel_lock); -/* * platform dp driver need containor_of the plat_data to get * the driver private data, so we need to store the point of
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +0 -2
@@ -169,8 +169,6 @@ struct analogix_dp_device {bool fast_train_enable;bool psr_supported; -struct mutex panel_lock; -struct analogix_dp_plat_data *plat_data; };
Signature · 1 line
2.39.5
Re: [PATCH 4/7] drm/bridge: analogic_dp: drop panel_lock
Hi Dmitry,
Quoted 44 lines · Dmitry Baryshkov
The
analogix_dp_prepare_panel()function is called from bridge'satomic_pre_enable()andatomic_post_disable()callbacks, which can not happen simultaneously. Drop the useless mutex.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 5 ----- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 2 -- 2 files changed, 7 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0
-5@@ -974,14 +974,11 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,if (!dp->plat_data->panel)return 0 ; -mutex_lock (&dp->panel_lock); -if (prepare) ret =drm_panel_prepare (dp->plat_data->panel);else ret =drm_panel_unprepare (dp->plat_data->panel); -mutex_unlock (&dp->panel_lock);return ret; }@@ -1523,8 +1520,6 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) dp->dev = &pdev->dev; dp->dpms_mode =DRM_MODE_DPMS_OFF ; -mutex_init (&dp->panel_lock); -/* * platform dp driver need containor_of the plat_data to get * the driver private data, so we need to store the point of drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +0
-0
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h struct analogix_dp_device { · line 174
Quoted 8 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +0
-2@@ -169,8 +169,6 @@ struct analogix_dp_device {bool fast_train_enable;bool psr_supported; -struct mutex panel_lock; -struct analogix_dp_plat_data *plat_data; };
The patch has been verified with the eDP panel "lg,lp079qx1-sp0v" in RK3588S EVB1 board.
Best regards,
Damon
Re: [PATCH 4/7] drm/bridge: analogic_dp: drop panel_lock
In reply to Dmitry BaryshkovQuoted 44 lines · Dmitry Baryshkov
The
analogix_dp_prepare_panel()function is called from bridge'satomic_pre_enable()andatomic_post_disable()callbacks, which can not happen simultaneously. Drop the useless mutex.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 5 ----- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 2 -- 2 files changed, 7 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0
-5@@ -974,14 +974,11 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp,if (!dp->plat_data->panel)return 0 ; -mutex_lock (&dp->panel_lock); -if (prepare) ret =drm_panel_prepare (dp->plat_data->panel);else ret =drm_panel_unprepare (dp->plat_data->panel); -mutex_unlock (&dp->panel_lock);return ret; }@@ -1523,8 +1520,6 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) dp->dev = &pdev->dev; dp->dpms_mode =DRM_MODE_DPMS_OFF ; -mutex_init (&dp->panel_lock); -/* * platform dp driver need containor_of the plat_data to get * the driver private data, so we need to store the point of drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +0
-0
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h struct analogix_dp_device { · line 174
Quoted 8 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +0
-2@@ -169,8 +169,6 @@ struct analogix_dp_device {bool fast_train_enable;bool psr_supported; -struct mutex panel_lock; -struct analogix_dp_plat_data *plat_data; };
PATCH 5/7 drm/bridge: analogix_dp: inline analogix_dp_prepare_panel()
In reply to Dmitry BaryshkovThe analogix_dp_prepare_panel() is now only calling a corresponding drm_panel function. Inline it to simplify the code.
--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 43 +++++----------------- 1 file changed, 10 insertions(+), 33 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +10 -33
@@ -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;
Signature · 1 line
2.39.5
Re: [PATCH 5/7] drm/bridge: analogix_dp: inline analogix_dp_prepare_panel()
Hi Dmitry,
Quoted 67 lines · Dmitry Baryshkov
The
analogix_dp_prepare_panel()is now only calling a correspondingdrm_panelfunction. Inline it to simplify the code.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 43 +++++----------------- 1 file changed, 10 insertions(+), 33 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5
-31@@ -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);
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static void analogix_dp_bridge_disable(struct drm_bridge *bridge) · line 1259
Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5
-2-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;
The patch has been verified with the eDP panel "lg,lp079qx1-sp0v" in RK3588S EVB1 board.
Best regards,
Damon
Re: [PATCH 5/7] drm/bridge: analogix_dp: inline analogix_dp_prepare_panel()
In reply to Dmitry BaryshkovQuoted 67 lines · Dmitry Baryshkov
The
analogix_dp_prepare_panel()is now only calling a correspondingdrm_panelfunction. Inline it to simplify the code.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 43 +++++----------------- 1 file changed, 10 insertions(+), 33 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5
-31@@ -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);
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static void analogix_dp_bridge_disable(struct drm_bridge *bridge) · line 1259
Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5
-2-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;
PATCH 6/7 drm/bridge: analogix_dp: ignore return values of drm_panel_* calls
In reply to Dmitry BaryshkovFollow the example of other drivers and ignore return values of the drm_panel_prepare() / unprepare() / enable() / disable() calls. There is no possible error recovery, so the driver just logs a message.
--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 39 ++++------------------ 1 file changed, 6 insertions(+), 33 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +6 -33
@@ -838,10 +838,7 @@ static int analogix_dp_commit(struct analogix_dp_device *dp)int ret;/* Keep the panel disabled while we configure video */ -if (dp->plat_data->panel) { -if (drm_panel_disable (dp->plat_data->panel)) -DRM_ERROR ("failed to disable the panel\n" ); - } +drm_panel_disable (dp->plat_data->panel); ret =analogix_dp_train_link (dp);if (ret) {
@@ -863,13 +860,7 @@ static int analogix_dp_commit(struct analogix_dp_device *dp) }/* Safe to enable the panel now */ -if (dp->plat_data->panel) { - ret =drm_panel_enable (dp->plat_data->panel); -if (ret) { -DRM_ERROR ("failed to enable the panel\n" ); -return ret; - } - } +drm_panel_enable (dp->plat_data->panel);/* Check whether panel supports fast training */ ret =analogix_dp_fast_link_train_detection (dp);
@@ -1136,7 +1127,6 @@ static void analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge,struct analogix_dp_device *dp = bridge->driver_private;struct drm_crtc *crtc;struct drm_crtc_state *old_crtc_state; -int ret; crtc =analogix_dp_get_new_crtc (dp, old_state);if (!crtc)
@@ -1147,11 +1137,7 @@ static void analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge,if (old_crtc_state && old_crtc_state->self_refresh_active)return ; -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); - } +drm_panel_prepare (dp->plat_data->panel); }static int analogix_dp_set_bridge (struct analogix_dp_device *dp)
@@ -1231,17 +1217,11 @@ static void analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge,static void analogix_dp_bridge_disable (struct drm_bridge *bridge) {struct analogix_dp_device *dp = bridge->driver_private; -int ret;if (dp->dpms_mode !=DRM_MODE_DPMS_ON )return ; -if (dp->plat_data->panel) { -if (drm_panel_disable (dp->plat_data->panel)) { -DRM_ERROR ("failed to disable the panel\n" ); -return ; - } - } +drm_panel_disable (dp->plat_data->panel);disable_irq (dp->irq);
@@ -1249,11 +1229,7 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)pm_runtime_put_sync (dp->dev); -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); - } +drm_panel_unprepare (dp->plat_data->panel); dp->fast_train_enable = false; dp->psr_supported = false;
@@ -1678,10 +1654,7 @@ void analogix_dp_unbind(struct analogix_dp_device *dp)analogix_dp_bridge_disable (dp->bridge); dp->connector.funcs->destroy (&dp->connector); -if (dp->plat_data->panel) { -if (drm_panel_unprepare (dp->plat_data->panel)) -DRM_ERROR ("failed to turnoff the panel\n" ); - } +drm_panel_unprepare (dp->plat_data->panel);drm_dp_aux_unregister (&dp->aux);
Signature · 1 line
2.39.5
Re: [PATCH 6/7] drm/bridge: analogix_dp: ignore return values of drm_panel_* calls
Hi Dmitry,
Quoted 96 lines · Dmitry Baryshkov
Follow the example of other drivers and ignore return values of the
drm_panel_prepare()/unprepare()/enable()/disable()calls. There is no possible error recovery, so the driver just logs a message.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 39 ++++------------------ 1 file changed, 6 insertions(+), 33 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5
-29@@ -838,10 +838,7 @@ static int analogix_dp_commit(struct analogix_dp_device *dp)int ret;/* Keep the panel disabled while we configure video */ -if (dp->plat_data->panel) { -if (drm_panel_disable (dp->plat_data->panel)) -DRM_ERROR ("failed to disable the panel\n" ); - } +drm_panel_disable (dp->plat_data->panel); ret =analogix_dp_train_link (dp);if (ret) {@@ -863,13 +860,7 @@ static int analogix_dp_commit(struct analogix_dp_device *dp) }/* Safe to enable the panel now */ -if (dp->plat_data->panel) { - ret =drm_panel_enable (dp->plat_data->panel); -if (ret) { -DRM_ERROR ("failed to enable the panel\n" ); -return ret; - } - } +drm_panel_enable (dp->plat_data->panel);/* Check whether panel supports fast training */ ret =analogix_dp_fast_link_train_detection (dp);@@ -1136,7 +1127,6 @@ static void analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge,struct analogix_dp_device *dp = bridge->driver_private;struct drm_crtc *crtc;struct drm_crtc_state *old_crtc_state; -int ret; crtc =analogix_dp_get_new_crtc (dp, old_state);if (!crtc)@@ -1147,11 +1137,7 @@ static void analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge,if (old_crtc_state && old_crtc_state->self_refresh_active)return ; -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); - } +drm_panel_prepare (dp->plat_data->panel); }static int analogix_dp_set_bridge (struct analogix_dp_device *dp)@@ -1231,17 +1217,11 @@ static void analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge,static void analogix_dp_bridge_disable (struct drm_bridge *bridge) {struct analogix_dp_device *dp = bridge->driver_private; -int ret;if (dp->dpms_mode !=DRM_MODE_DPMS_ON )return ; -if (dp->plat_data->panel) { -if (drm_panel_disable (dp->plat_data->panel)) { -DRM_ERROR ("failed to disable the panel\n" ); -return ; - } - } +drm_panel_disable (dp->plat_data->panel);disable_irq (dp->irq);@@ -1249,11 +1229,7 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)pm_runtime_put_sync (dp->dev); -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); - } +drm_panel_unprepare (dp->plat_data->panel); dp->fast_train_enable = false; dp->psr_supported = false;@@ -1678,10 +1654,7 @@ void analogix_dp_unbind(struct analogix_dp_device *dp)analogix_dp_bridge_disable (dp->bridge);
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c void analogix_dp_unbind(struct analogix_dp_device *dp) · line 1660
Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-4dp->connector.funcs->destroy (&dp->connector); -if (dp->plat_data->panel) { -if (drm_panel_unprepare (dp->plat_data->panel)) -DRM_ERROR ("failed to turnoff the panel\n" ); - } +drm_panel_unprepare (dp->plat_data->panel);drm_dp_aux_unregister (&dp->aux);
The patch has been verified with the eDP panel "lg,lp079qx1-sp0v" in RK3588S EVB1 board.
Best regards,
Damon
Re: [PATCH 6/7] drm/bridge: analogix_dp: ignore return values of drm_panel_* calls
In reply to Dmitry BaryshkovQuoted 96 lines · Dmitry Baryshkov
Follow the example of other drivers and ignore return values of the
drm_panel_prepare()/unprepare()/enable()/disable()calls. There is no possible error recovery, so the driver just logs a message.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 39 ++++------------------ 1 file changed, 6 insertions(+), 33 deletions(-)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5
-29@@ -838,10 +838,7 @@ static int analogix_dp_commit(struct analogix_dp_device *dp)int ret;/* Keep the panel disabled while we configure video */ -if (dp->plat_data->panel) { -if (drm_panel_disable (dp->plat_data->panel)) -DRM_ERROR ("failed to disable the panel\n" ); - } +drm_panel_disable (dp->plat_data->panel); ret =analogix_dp_train_link (dp);if (ret) {@@ -863,13 +860,7 @@ static int analogix_dp_commit(struct analogix_dp_device *dp) }/* Safe to enable the panel now */ -if (dp->plat_data->panel) { - ret =drm_panel_enable (dp->plat_data->panel); -if (ret) { -DRM_ERROR ("failed to enable the panel\n" ); -return ret; - } - } +drm_panel_enable (dp->plat_data->panel);/* Check whether panel supports fast training */ ret =analogix_dp_fast_link_train_detection (dp);@@ -1136,7 +1127,6 @@ static void analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge,struct analogix_dp_device *dp = bridge->driver_private;struct drm_crtc *crtc;struct drm_crtc_state *old_crtc_state; -int ret; crtc =analogix_dp_get_new_crtc (dp, old_state);if (!crtc)@@ -1147,11 +1137,7 @@ static void analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge,if (old_crtc_state && old_crtc_state->self_refresh_active)return ; -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); - } +drm_panel_prepare (dp->plat_data->panel); }static int analogix_dp_set_bridge (struct analogix_dp_device *dp)@@ -1231,17 +1217,11 @@ static void analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge,static void analogix_dp_bridge_disable (struct drm_bridge *bridge) {struct analogix_dp_device *dp = bridge->driver_private; -int ret;if (dp->dpms_mode !=DRM_MODE_DPMS_ON )return ; -if (dp->plat_data->panel) { -if (drm_panel_disable (dp->plat_data->panel)) { -DRM_ERROR ("failed to disable the panel\n" ); -return ; - } - } +drm_panel_disable (dp->plat_data->panel);disable_irq (dp->irq);@@ -1249,11 +1229,7 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)pm_runtime_put_sync (dp->dev); -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); - } +drm_panel_unprepare (dp->plat_data->panel); dp->fast_train_enable = false; dp->psr_supported = false;@@ -1678,10 +1654,7 @@ void analogix_dp_unbind(struct analogix_dp_device *dp)analogix_dp_bridge_disable (dp->bridge);
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c void analogix_dp_unbind(struct analogix_dp_device *dp) · line 1660
Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-4dp->connector.funcs->destroy (&dp->connector); -if (dp->plat_data->panel) { -if (drm_panel_unprepare (dp->plat_data->panel)) -DRM_ERROR ("failed to turnoff the panel\n" ); - } +drm_panel_unprepare (dp->plat_data->panel);drm_dp_aux_unregister (&dp->aux);
PATCH 7/7 drm/panel: make prepare/enable and disable/unprepare calls return void
In reply to Dmitry BaryshkovNow there are no users of the return value of the drm_panel_prepare(), drm_panel_unprepare(), drm_panel_enable() and drm_panel_disable() calls. Usually these calls are performed from the atomic callbacks, where it is impossible to return an error. Stop returning error codes and return void instead.
--- drivers/gpu/drm/drm_panel.c | 54 +++++++++---------------- drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 9 +---- include/drm/drm_panel.h | 8 ++-- 3 files changed, 26 insertions(+), 45 deletions(-)
drivers/gpu/drm/drm_panel.c +20 -34
@@ -105,21 +105,21 @@ EXPORT_SYMBOL(drm_panel_remove);* * Calling this function will enable power and deassert any reset signals to * the panel. After this has completed it is possible to communicate with any -* integrated circuitry via a command bus. -* -* Return: 0 on success or a negative error code on failure. +* integrated circuitry via a command bus. This function cannot fail (as it is +* called from the pre_enable call chain). There will always be a call to +* drm_panel_disable() afterwards. */ -int drm_panel_prepare (struct drm_panel *panel) +void drm_panel_prepare (struct drm_panel *panel) {struct drm_panel_follower *follower;int ret;if (!panel) -return -EINVAL ; +return ;if (panel->prepared) {dev_warn (panel->dev,"Skipping prepare of already prepared panel\n" ); -return 0 ; +return ; }mutex_lock (&panel->follower_lock);
@@ -138,11 +138,8 @@ int drm_panel_prepare(struct drm_panel *panel) follower->funcs->panel_prepared, ret); } - ret =0 ; exit:mutex_unlock (&panel->follower_lock); - -return ret; }EXPORT_SYMBOL (drm_panel_prepare);
@@ -154,16 +151,14 @@ EXPORT_SYMBOL(drm_panel_prepare);* reset, turn off power supplies, ...). After this function has completed, it * is usually no longer possible to communicate with the panel until another * call to drm_panel_prepare(). -* -* Return: 0 on success or a negative error code on failure. */ -int drm_panel_unprepare (struct drm_panel *panel) +void drm_panel_unprepare (struct drm_panel *panel) {struct drm_panel_follower *follower;int ret;if (!panel) -return -EINVAL ; +return ;/* * If you are seeing the warning below it likely means one of two things:
@@ -176,7 +171,7 @@ int drm_panel_unprepare(struct drm_panel *panel)*/ if (!panel->prepared) {dev_warn (panel->dev,"Skipping unprepare of already unprepared panel\n" ); -return 0 ; +return ; }mutex_lock (&panel->follower_lock);
@@ -195,11 +190,8 @@ int drm_panel_unprepare(struct drm_panel *panel) } panel->prepared = false; - ret =0 ; exit:mutex_unlock (&panel->follower_lock); - -return ret; }EXPORT_SYMBOL (drm_panel_unprepare);
@@ -209,26 +201,26 @@ EXPORT_SYMBOL(drm_panel_unprepare);* * Calling this function will cause the panel display drivers to be turned on * and the backlight to be enabled. Content will be visible on screen after -* this call completes. -* -* Return: 0 on success or a negative error code on failure. +* this call completes. This function cannot fail (as it is called from the +* enable call chain). There will always be a call to drm_panel_disable() +* afterwards. */ -int drm_panel_enable (struct drm_panel *panel) +void drm_panel_enable (struct drm_panel *panel) {int ret;if (!panel) -return -EINVAL ; +return ;if (panel->enabled) {dev_warn (panel->dev,"Skipping enable of already enabled panel\n" ); -return 0 ; +return ; }if (panel->funcs && panel->funcs->enable) { ret = panel->funcs->enable (panel);if (ret <0 ) -return ret; +return ; } panel->enabled = true;
@@ -236,8 +228,6 @@ int drm_panel_enable(struct drm_panel *panel)if (ret <0 )DRM_DEV_INFO (panel->dev,"failed to enable backlight: %d\n" , ret); - -return 0 ; }EXPORT_SYMBOL (drm_panel_enable);
@@ -248,15 +238,13 @@ EXPORT_SYMBOL(drm_panel_enable);* This will typically turn off the panel's backlight or disable the display * drivers. For smart panels it should still be possible to communicate with * the integrated circuitry via any command bus after this call. -* -* Return: 0 on success or a negative error code on failure. */ -int drm_panel_disable (struct drm_panel *panel) +void drm_panel_disable (struct drm_panel *panel) {int ret;if (!panel) -return -EINVAL ; +return ;/* * If you are seeing the warning below it likely means one of two things:
@@ -269,7 +257,7 @@ int drm_panel_disable(struct drm_panel *panel)*/ if (!panel->enabled) {dev_warn (panel->dev,"Skipping disable of already disabled panel\n" ); -return 0 ; +return ; } ret =backlight_disable (panel->backlight);
@@ -280,11 +268,9 @@ int drm_panel_disable(struct drm_panel *panel)if (panel->funcs && panel->funcs->disable) { ret = panel->funcs->disable (panel);if (ret <0 ) -return ret; +return ; } panel->enabled = false; - -return 0 ; }EXPORT_SYMBOL (drm_panel_disable);
drivers/gpu/drm/panel/panel-newvision-nv3051d.c +2 -7
@@ -413,15 +413,10 @@ static int panel_nv3051d_probe(struct mipi_dsi_device *dsi)static void panel_nv3051d_shutdown (struct mipi_dsi_device *dsi) {struct panel_nv3051d *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - ret =drm_panel_unprepare (&ctx->panel); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to unprepare panel: %d\n" , ret); +drm_panel_unprepare (&ctx->panel); - ret =drm_panel_disable (&ctx->panel); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to disable panel: %d\n" , ret); +drm_panel_disable (&ctx->panel); }static void panel_nv3051d_remove (struct mipi_dsi_device *dsi)
include/drm/drm_panel.h +4 -4
@@ -275,11 +275,11 @@ void drm_panel_init(struct drm_panel *panel, struct device *dev,void drm_panel_add (struct drm_panel *panel);void drm_panel_remove (struct drm_panel *panel); -int drm_panel_prepare (struct drm_panel *panel); -int drm_panel_unprepare (struct drm_panel *panel); +void drm_panel_prepare (struct drm_panel *panel); +void drm_panel_unprepare (struct drm_panel *panel); -int drm_panel_enable (struct drm_panel *panel); -int drm_panel_disable (struct drm_panel *panel); +void drm_panel_enable (struct drm_panel *panel); +void drm_panel_disable (struct drm_panel *panel);int drm_panel_get_modes (struct drm_panel *panel,struct drm_connector *connector);
Signature · 1 line
2.39.5
Re: [PATCH 7/7] drm/panel: make prepare/enable and disable/unprepare calls return void
Quoted 213 lines · Dmitry Baryshkov
Now there are no users of the return value of the
drm_panel_prepare(),drm_panel_unprepare(),drm_panel_enable()anddrm_panel_disable()calls. Usually these calls are performed from the atomic callbacks, where it is impossible to return an error. Stop returning error codes and return void instead.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/drm_panel.c | 54 +++++++++---------------- drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 9 +---- include/drm/drm_panel.h | 8 ++-- 3 files changed, 26 insertions(+), 45 deletions(-)drivers/gpu/drm/drm_panel.c +20
-34@@ -105,21 +105,21 @@ EXPORT_SYMBOL(drm_panel_remove);* * Calling this function will enable power and deassert any reset signals to * the panel. After this has completed it is possible to communicate with any -* integrated circuitry via a command bus. -* -* Return: 0 on success or a negative error code on failure. +* integrated circuitry via a command bus. This function cannot fail (as it is +* called from the pre_enable call chain). There will always be a call to +* drm_panel_disable() afterwards. */ -int drm_panel_prepare (struct drm_panel *panel) +void drm_panel_prepare (struct drm_panel *panel) {struct drm_panel_follower *follower;int ret;if (!panel) -return -EINVAL ; +return ;if (panel->prepared) {dev_warn (panel->dev,"Skipping prepare of already prepared panel\n" ); -return 0 ; +return ; }mutex_lock (&panel->follower_lock);@@ -138,11 +138,8 @@ int drm_panel_prepare(struct drm_panel *panel) follower->funcs->panel_prepared, ret); } - ret =0 ; exit:mutex_unlock (&panel->follower_lock); - -return ret; }EXPORT_SYMBOL (drm_panel_prepare);@@ -154,16 +151,14 @@ EXPORT_SYMBOL(drm_panel_prepare);* reset, turn off power supplies, ...). After this function has completed, it * is usually no longer possible to communicate with the panel until another * call to drm_panel_prepare(). -* -* Return: 0 on success or a negative error code on failure. */ -int drm_panel_unprepare (struct drm_panel *panel) +void drm_panel_unprepare (struct drm_panel *panel) {struct drm_panel_follower *follower;int ret;if (!panel) -return -EINVAL ; +return ;/* * If you are seeing the warning below it likely means one of two things: @@ -176,7 +171,7 @@ int drm_panel_unprepare(struct drm_panel *panel)*/ if (!panel->prepared) {dev_warn (panel->dev,"Skipping unprepare of already unprepared panel\n" ); -return 0 ; +return ; }mutex_lock (&panel->follower_lock);@@ -195,11 +190,8 @@ int drm_panel_unprepare(struct drm_panel *panel) } panel->prepared = false; - ret =0 ; exit:mutex_unlock (&panel->follower_lock); - -return ret; }EXPORT_SYMBOL (drm_panel_unprepare);@@ -209,26 +201,26 @@ EXPORT_SYMBOL(drm_panel_unprepare);* * Calling this function will cause the panel display drivers to be turned on * and the backlight to be enabled. Content will be visible on screen after -* this call completes. -* -* Return: 0 on success or a negative error code on failure. +* this call completes. This function cannot fail (as it is called from the +* enable call chain). There will always be a call to drm_panel_disable() +* afterwards. */ -int drm_panel_enable (struct drm_panel *panel) +void drm_panel_enable (struct drm_panel *panel) {int ret;if (!panel) -return -EINVAL ; +return ;if (panel->enabled) {dev_warn (panel->dev,"Skipping enable of already enabled panel\n" ); -return 0 ; +return ; }if (panel->funcs && panel->funcs->enable) { ret = panel->funcs->enable (panel);if (ret <0 ) -return ret; +return ; } panel->enabled = true;@@ -236,8 +228,6 @@ int drm_panel_enable(struct drm_panel *panel)if (ret <0 )DRM_DEV_INFO (panel->dev,"failed to enable backlight: %d\n" , ret); - -return 0 ; }EXPORT_SYMBOL (drm_panel_enable);@@ -248,15 +238,13 @@ EXPORT_SYMBOL(drm_panel_enable);* This will typically turn off the panel's backlight or disable the display * drivers. For smart panels it should still be possible to communicate with * the integrated circuitry via any command bus after this call. -* -* Return: 0 on success or a negative error code on failure. */ -int drm_panel_disable (struct drm_panel *panel) +void drm_panel_disable (struct drm_panel *panel) {int ret;if (!panel) -return -EINVAL ; +return ;/* * If you are seeing the warning below it likely means one of two things: @@ -269,7 +257,7 @@ int drm_panel_disable(struct drm_panel *panel)*/ if (!panel->enabled) {dev_warn (panel->dev,"Skipping disable of already disabled panel\n" ); -return 0 ; +return ; } ret =backlight_disable (panel->backlight);@@ -280,11 +268,9 @@ int drm_panel_disable(struct drm_panel *panel)if (panel->funcs && panel->funcs->disable) { ret = panel->funcs->disable (panel);if (ret <0 ) -return ret; +return ; } panel->enabled = false; - -return 0 ; }EXPORT_SYMBOL (drm_panel_disable);drivers/gpu/drm/panel/panel-newvision-nv3051d.c +2
-7@@ -413,15 +413,10 @@ static int panel_nv3051d_probe(struct mipi_dsi_device *dsi)static void panel_nv3051d_shutdown (struct mipi_dsi_device *dsi) {struct panel_nv3051d *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - ret =drm_panel_unprepare (&ctx->panel); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to unprepare panel: %d\n" , ret); +drm_panel_unprepare (&ctx->panel); - ret =drm_panel_disable (&ctx->panel); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to disable panel: %d\n" , ret); +drm_panel_disable (&ctx->panel); }static void panel_nv3051d_remove (struct mipi_dsi_device *dsi)include/drm/drm_panel.h +0
-2@@ -275,11 +275,11 @@ void drm_panel_init(struct drm_panel *panel, struct device *dev,void drm_panel_add (struct drm_panel *panel);void drm_panel_remove (struct drm_panel *panel); -int drm_panel_prepare (struct drm_panel *panel); -int drm_panel_unprepare (struct drm_panel *panel);
include/drm/drm_panel.h void drm_panel_init(struct drm_panel *panel, struct device *dev, · line 285
Quoted 10 lines
include/drm/drm_panel.h +4
-2+void drm_panel_prepare (struct drm_panel *panel); +void drm_panel_unprepare (struct drm_panel *panel); -int drm_panel_enable (struct drm_panel *panel); -int drm_panel_disable (struct drm_panel *panel); +void drm_panel_enable (struct drm_panel *panel); +void drm_panel_disable (struct drm_panel *panel);int drm_panel_get_modes (struct drm_panel *panel,struct drm_connector *connector);
LGTM
Neil Armstrong
maintainerQuoted 24 lines · Dmitry Baryshkov
While it makes sense for panel callbacks to be able to return an error, the state-management functions from
drm_panelAPI are usually called from atomic callbacks, which can not fails and must return void. Makedrm_panel_prepare(),drm_panel_enable(),drm_panel_disable()anddrm_panel_unprepare()follow the same calling convention and return void.Signed-off-by Dmitry Baryshkov <[email protected]>---
Dmitry Baryshkov (7):
drm/bridge:analogix_dp: drop extra calls toanalogix_dp_prepare_panel()drm/bridge:analogix_dp: drop unused argument toanalogix_dp_prepare_panel()drm/bridge:analogic_dp: droppanel_is_modeset
drm/bridge:analogic_dp: droppanel_lock
drm/bridge:analogix_dp: inlineanalogix_dp_prepare_panel()drm/bridge:analogix_dp: ignore return values of drm_panel_* calls drm/panel: make prepare/enable and disable/unprepare calls return voiddrivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 107 ++------------------- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 3 - drivers/gpu/drm/drm_panel.c | 54 ++++------- drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 9 +- include/drm/drm_panel.h | 8 +- 5 files changed, 33 insertions(+), 148 deletions(-)
Quoted 5 lines
---
base-commit:bfb20a655848a9088e3e9ae24b1dcce1bbf016c2
change-id: 20250401-panel-return-void-d461c71ebd35Best regards,
I think you can respin with the warning fix on patch 1 and then apply
Neil
Dmitry Baryshkov
AppliedQuoted 8 lines · Dmitry Baryshkov
While it makes sense for panel callbacks to be able to return an error, the state-management functions from
drm_panelAPI are usually called from atomic callbacks, which can not fails and must return void. Makedrm_panel_prepare(),drm_panel_enable(),drm_panel_disable()anddrm_panel_unprepare()follow the same calling convention and return void.[...]
Applied to drm-misc-next, thanks!
[1/7] drm/bridge: analogix_dp: drop extra calls to analogix_dp_prepare_panel()
commit: b65cbfe0e1d8bcb74dbeb221d423dd926f326d05
[2/7] drm/bridge: analogix_dp: drop unused argument to analogix_dp_prepare_panel()
commit: 0ce432e18c932a7fd219b9c2bf1db623fb0f7840
[3/7] drm/bridge: analogic_dp: drop panel_is_modeset
commit: 4fc72e1fc46b0dca74c1f8c94091e524ad5b9fdb
[4/7] drm/bridge: analogic_dp: drop panel_lock
commit: 62ca1c3a146c73f8b8a381bf4461a82951defb8b
[5/7] drm/bridge: analogix_dp: inline analogix_dp_prepare_panel()
commit: d5f34ca5df7c0ae075fdfeba20edd6f81c792554
[6/7] drm/bridge: analogix_dp: ignore return values of drm_panel_* calls
commit: 58a71d2bf103550f809987e16d8c1949be719040
[7/7] drm/panel: make prepare/enable and disable/unprepare calls return void
commit: dcbd5dcc956e2331414fd7020b4655df08deeb87Best regards,
Signature · 2 lines
With best wishes Dmitry