[PATCH 13/33] drm/omap: print an error if display enable fails

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Feb 23 22:17:09 UTC 2016


Hi Tomi,

Thank you for the patch.

On Friday 19 February 2016 11:47:48 Tomi Valkeinen wrote:
> If the panel's enable fails, omap_encoder silently ignores the failure.
> omapdrm should really handle the failure, but unfortunately the whole
> encoder enable codepath is expected to always succeed.
> 
> So for now, catch the enable failure and print an error.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_encoder.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c
> b/drivers/gpu/drm/omapdrm/omap_encoder.c index 61714e9670ae..eb52b3e85d0c
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_encoder.c
> +++ b/drivers/gpu/drm/omapdrm/omap_encoder.c
> @@ -139,11 +139,15 @@ static void omap_encoder_enable(struct drm_encoder
> *encoder) struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
>  	struct omap_dss_device *dssdev = omap_encoder->dssdev;
>  	struct omap_dss_driver *dssdrv = dssdev->driver;
> +	int r;
> 
>  	omap_encoder_update(encoder, omap_crtc_channel(encoder->crtc),
>  			    omap_crtc_timings(encoder->crtc));
> 
> -	dssdrv->enable(dssdev);
> +	r = dssdrv->enable(dssdev);
> +	if (r)
> +		dev_err(encoder->dev->dev, "Failed to enable display '%s'\n",
> +			dssdev->name);

While at it I'd print the error code too.

>  }
> 
>  static int omap_encoder_atomic_check(struct drm_encoder *encoder,

-- 
Regards,

Laurent Pinchart



More information about the dri-devel mailing list