[1/2] drm/i915: Replace nondescript 'WARN_ON(!lret)' with a sensible error message

Submitted by Ville Syrjälä on April 18, 2016, 11:29 a.m.

Details

Message ID 1460978973-24945-1-git-send-email-ville.syrjala@linux.intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

Ville Syrjälä April 18, 2016, 11:29 a.m.
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

When a vblank wait times out in intel_atomic_wait_for_vblanks() we just
get a cryptic 'WARN_ON(!ret)' backtrace in dmesg. Repace it with
something that tells you what actually happened.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4cca155376be..7bdbe4b03591 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13523,7 +13523,7 @@  static void intel_atomic_wait_for_vblanks(struct drm_device *dev,
 					drm_crtc_vblank_count(crtc),
 				msecs_to_jiffies(50));
 
-		WARN_ON(!lret);
+		WARN(!lret, "pipe %c vblank wait timed out\n", pipe_name(pipe));
 
 		drm_crtc_vblank_put(crtc);
 	}

Comments

Op 18-04-16 om 13:29 schreef ville.syrjala@linux.intel.com:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> When a vblank wait times out in intel_atomic_wait_for_vblanks() we just
> get a cryptic 'WARN_ON(!ret)' backtrace in dmesg. Repace it with
> something that tells you what actually happened.
>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 4cca155376be..7bdbe4b03591 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13523,7 +13523,7 @@ static void intel_atomic_wait_for_vblanks(struct drm_device *dev,
>  					drm_crtc_vblank_count(crtc),
>  				msecs_to_jiffies(50));
>  
> -		WARN_ON(!lret);
> +		WARN(!lret, "pipe %c vblank wait timed out\n", pipe_name(pipe));
>  
>  		drm_crtc_vblank_put(crtc);
>  	}
This helper function was never meant to last as long as it did. :(

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
On Mon, Apr 18, 2016 at 02:29:33PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Vblank waits timing out is no a normal thing to happen, so let's inform
> people when it happens.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Applied to drm-misc, let's see how much it blows up. We /should/ be
filtering out entirely defunct vblank implementations already by checking
vblank_get() ...
-Daniel

> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 7bf678ee7f81..40c7b268a9bc 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1103,6 +1103,8 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
>  					drm_crtc_vblank_count(crtc),
>  				msecs_to_jiffies(50));
>  
> +		WARN(!ret, "[CRTC:%d] vblank wait timed out\n", crtc->base.id);
> +
>  		drm_crtc_vblank_put(crtc);
>  	}
>  }
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
On Mon, Apr 18, 2016 at 01:43:13PM +0200, Maarten Lankhorst wrote:
> Op 18-04-16 om 13:29 schreef ville.syrjala@linux.intel.com:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > When a vblank wait times out in intel_atomic_wait_for_vblanks() we just
> > get a cryptic 'WARN_ON(!ret)' backtrace in dmesg. Repace it with
> > something that tells you what actually happened.
> >
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 4cca155376be..7bdbe4b03591 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -13523,7 +13523,7 @@ static void intel_atomic_wait_for_vblanks(struct drm_device *dev,
> >  					drm_crtc_vblank_count(crtc),
> >  				msecs_to_jiffies(50));
> >  
> > -		WARN_ON(!lret);
> > +		WARN(!lret, "pipe %c vblank wait timed out\n", pipe_name(pipe));
> >  
> >  		drm_crtc_vblank_put(crtc);
> >  	}
> This helper function was never meant to last as long as it did. :(
> 
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Pushed to dinq. Thanks for the review.