[PATCHv2,11/31] drm/omap: print an error if display enable fails

Submitted by Tomi Valkeinen on Feb. 26, 2016, 9:35 a.m.

Details

Message ID 1456479379-6086-12-git-send-email-tomi.valkeinen@ti.com
State New
Headers show
Series "drm/omap: patches for v4.6 part 1" ( rev: 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

Tomi Valkeinen Feb. 26, 2016, 9:35 a.m.
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@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_encoder.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c
index 61714e9670ae..ae347cc19f01 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': %d\n",
+			dssdev->name, r);
 }
 
 static int omap_encoder_atomic_check(struct drm_encoder *encoder,

Comments

Hi Tomi,

Thank you for the patch.
On Friday 26 February 2016 11:35:59 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@ti.com>

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

You might want to add a line break to keep the dev_err within the 80 
characters per column limit.

> ---
>  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..ae347cc19f01
> 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': %d\n",
> +			dssdev->name, r);
>  }
> 
>  static int omap_encoder_atomic_check(struct drm_encoder *encoder,