diff mbox series

[PATCHv2,07/17] drm/omap: dispc: disp_wb_setup to check return code

Message ID 1519817174-20714-8-git-send-email-tomi.valkeinen@ti.com
State Accepted
Commit b5d025eff5206300be0f59bfe10c5b9e1c895af4
Headers show
Series drm/omap: misc patches | expand

Commit Message

Tomi Valkeinen Feb. 28, 2018, 11:26 a.m. UTC
From: Benoit Parrot <bparrot@ti.com>

When dispc_wb_setup() calls dispc_ovl_setup_common() it does not
check for failure but instead keeps on partially setting up WB.
This causes the WB H/W to be partially initialized and yield
unexpected behavior.

Make sure return code is successful before proceeding.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Sebastian Reichel June 10, 2018, 2:03 p.m. UTC | #1
Hi,

On Wed, Feb 28, 2018 at 01:26:04PM +0200, Tomi Valkeinen wrote:
> From: Benoit Parrot <bparrot@ti.com>

> 

> When dispc_wb_setup() calls dispc_ovl_setup_common() it does not

> check for failure but instead keeps on partially setting up WB.

> This causes the WB H/W to be partially initialized and yield

> unexpected behavior.

> 

> Make sure return code is successful before proceeding.

> 

> Signed-off-by: Benoit Parrot <bparrot@ti.com>

> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---


Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


-- Sebastian

>  drivers/gpu/drm/omapdrm/dss/dispc.c | 4 +++-

>  1 file changed, 3 insertions(+), 1 deletion(-)

> 

> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c

> index d2d95c76a313..f0f729fc4ca2 100644

> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c

> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c

> @@ -2783,6 +2783,8 @@ int dispc_wb_setup(struct dispc_device *dispc,

>  		wi->height, wi->fourcc, wi->rotation, zorder,

>  		wi->pre_mult_alpha, global_alpha, wi->rotation_type,

>  		replication, vm, mem_to_mem);

> +	if (r)

> +		return r;

>  

>  	switch (wi->fourcc) {

>  	case DRM_FORMAT_RGB565:

> @@ -2823,7 +2825,7 @@ int dispc_wb_setup(struct dispc_device *dispc,

>  		REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES2(plane), wbdelay, 7, 0);

>  	}

>  

> -	return r;

> +	return 0;

>  }

>  

>  static int dispc_ovl_enable(struct dispc_device *dispc,

> -- 

> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.

> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

> 

> _______________________________________________

> dri-devel mailing list

> dri-devel@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index d2d95c76a313..f0f729fc4ca2 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -2783,6 +2783,8 @@  int dispc_wb_setup(struct dispc_device *dispc,
 		wi->height, wi->fourcc, wi->rotation, zorder,
 		wi->pre_mult_alpha, global_alpha, wi->rotation_type,
 		replication, vm, mem_to_mem);
+	if (r)
+		return r;
 
 	switch (wi->fourcc) {
 	case DRM_FORMAT_RGB565:
@@ -2823,7 +2825,7 @@  int dispc_wb_setup(struct dispc_device *dispc,
 		REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES2(plane), wbdelay, 7, 0);
 	}
 
-	return r;
+	return 0;
 }
 
 static int dispc_ovl_enable(struct dispc_device *dispc,