diff mbox series

[v2,1/4] drm: exynos: dsi: Check panel for panel helpers

Message ID 20211210191922.2367979-2-jagan@amarulasolutions.com (mailing list archive)
State New, archived
Headers show
Series drm: exynos: dsi: Convert drm bridge | expand

Commit Message

Jagan Teki Dec. 10, 2021, 7:19 p.m. UTC
Trigger the panel operation helpers only if host found the panel.

Add check.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v2:
- new patch 

 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Andrzej Hajda Dec. 13, 2021, 8:14 a.m. UTC | #1
On 10.12.2021 20:19, Jagan Teki wrote:
> Trigger the panel operation helpers only if host found the panel.
>
> Add check.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>


Both helpers handle already "NULL panels", so these checks are redundant.


Regards

Andrzej

> ---
> Changes for v2:
> - new patch
>
>   drivers/gpu/drm/exynos/exynos_drm_dsi.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> index 8d137857818c..0bb44e476633 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> @@ -1439,7 +1439,8 @@ static void exynos_dsi_disable(struct drm_encoder *encoder)
>   
>   	dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE;
>   
> -	drm_panel_disable(dsi->panel);
> +	if (dsi->panel)
> +		drm_panel_disable(dsi->panel);
>   
>   	list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) {
>   		if (iter->funcs->disable)
> @@ -1447,7 +1448,8 @@ static void exynos_dsi_disable(struct drm_encoder *encoder)
>   	}
>   
>   	exynos_dsi_set_display_enable(dsi, false);
> -	drm_panel_unprepare(dsi->panel);
> +	if (dsi->panel)
> +		drm_panel_unprepare(dsi->panel);
>   
>   	list_for_each_entry(iter, &dsi->bridge_chain, chain_node) {
>   		if (iter->funcs->post_disable)
Jagan Teki Dec. 13, 2021, 8:27 a.m. UTC | #2
Hi Andrzej,

On Mon, Dec 13, 2021 at 1:44 PM Andrzej Hajda <andrzej.hajda@intel.com> wrote:
>
>
> On 10.12.2021 20:19, Jagan Teki wrote:
> > Trigger the panel operation helpers only if host found the panel.
> >
> > Add check.
> >
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>
>
> Both helpers handle already "NULL panels", so these checks are redundant.

Got it. Please look at v3 if you have time.

Thanks,
Jagan.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 8d137857818c..0bb44e476633 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -1439,7 +1439,8 @@  static void exynos_dsi_disable(struct drm_encoder *encoder)
 
 	dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE;
 
-	drm_panel_disable(dsi->panel);
+	if (dsi->panel)
+		drm_panel_disable(dsi->panel);
 
 	list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) {
 		if (iter->funcs->disable)
@@ -1447,7 +1448,8 @@  static void exynos_dsi_disable(struct drm_encoder *encoder)
 	}
 
 	exynos_dsi_set_display_enable(dsi, false);
-	drm_panel_unprepare(dsi->panel);
+	if (dsi->panel)
+		drm_panel_unprepare(dsi->panel);
 
 	list_for_each_entry(iter, &dsi->bridge_chain, chain_node) {
 		if (iter->funcs->post_disable)