Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Workaround CHV pipe C cursor fail
@ 2015-12-18 17:24 ville.syrjala
  2015-12-18 17:49 ` ✗ failure: Fi.CI.BAT Patchwork
  2015-12-21 13:49 ` [Intel-gfx] [PATCH] drm/i915: Workaround CHV pipe C cursor fail Daniel Vetter
  0 siblings, 2 replies; 4+ messages in thread
From: ville.syrjala @ 2015-12-18 17:24 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jason Plum, stable

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Turns out CHV pipe C was glued on somewhat poorly, and there's something
wrong with the cursor. If the cursor straddles the left screen edge,
and is then moved away from the edge or disabled, the pipe will often
underrun. If enough underruns are triggered quickly enough the pipe
will fall over and die (it just scans out a solid color and reports
a constant underrun). We need to turn the disp2d power well off and
on again to recover the pipe.

None of that is very nice for the user, so let's just refuse to place
the cursor in the compromised position. The ddx appears to fall back
to swcursor when the ioctl returns an error, so theoretically there's
no loss of functionality for the user (discounting swcursor bugs).
I suppose most cursors images actually have the hotspot not exactly
at 0,0 so under typical conditions the fallback will in fact kick in
as soon as the cursor touches the left edge of the screen.

Any atomic compositor should anyway be prepared to fall back to
GPU composition when things don't work out, so there should be no
problem with those.

Other things that I tried to solve this include flipping all
display related clock gating knobs I could find, increasing the
minimum gtt alignment all the way up to 512k. I also tried to see
if there are more specific screen coordinates that hit the bug, but
the findings were somewhat inconclusive. Sometimes the failures
happen almost across the whole left edge, sometimes more at the very
top and around the bottom half. I wasn't able to find any real pattern
to these variations, so it seems our only choice is to just refuse
to straddle the left screen edge at all.

Cc: stable@vger.kernel.org
Cc: Jason Plum <max@warheads.net>
Testcase: igt/kms_chv_cursor_fail
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92826
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index abd2d2944022..8acc66b95139 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14059,6 +14059,7 @@ intel_check_cursor_plane(struct drm_plane *plane,
 	struct drm_crtc *crtc = crtc_state->base.crtc;
 	struct drm_framebuffer *fb = state->base.fb;
 	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
+	enum pipe pipe = to_intel_plane(plane)->pipe;
 	unsigned stride;
 	int ret;
 
@@ -14092,6 +14093,22 @@ intel_check_cursor_plane(struct drm_plane *plane,
 		return -EINVAL;
 	}
 
+	/*
+	 * There's something wrong with the cursor on CHV pipe C.
+	 * If it straddles the left edge of the screen then
+	 * moving it away from the edge or disabling it often
+	 * results in a pipe underrun, and often that can lead to
+	 * dead pipe (constant underrun reported, and it scans
+	 * out just a solid color). To recover from that, the
+	 * display power well must be turned off and on again.
+	 * Refuse the put the cursor into that compromised position.
+	 */
+	if (IS_CHERRYVIEW(plane->dev) && pipe == PIPE_C &&
+	    state->visible && state->base.crtc_x < 0) {
+		DRM_DEBUG_KMS("CHV cursor C not allowed to straddle the left screen edge\n");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
-- 
2.4.10

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✗ failure: Fi.CI.BAT
  2015-12-18 17:24 [PATCH] drm/i915: Workaround CHV pipe C cursor fail ville.syrjala
@ 2015-12-18 17:49 ` Patchwork
  2015-12-21 13:49 ` [Intel-gfx] [PATCH] drm/i915: Workaround CHV pipe C cursor fail Daniel Vetter
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2015-12-18 17:49 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx

== Summary ==

Built on deb496ede4fc5e7affe15640a113ea9b5f1189e0 drm-intel-nightly: 2015y-12m-18d-16h-12m-24s UTC integration manifest

Test gem_storedw_loop:
        Subgroup basic-render:
                dmesg-warn -> PASS       (skl-i5k-2)
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                pass       -> DMESG-WARN (ilk-hp8440p)
                pass       -> DMESG-WARN (byt-nuc)
Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-a:
                pass       -> DMESG-WARN (snb-x220t)
        Subgroup read-crc-pipe-a-frame-sequence:
                pass       -> FAIL       (snb-x220t)
        Subgroup read-crc-pipe-c:
                dmesg-warn -> PASS       (bdw-ultra)
                pass       -> DMESG-WARN (skl-i7k-2)
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> PASS       (snb-x220t)
Test kms_setmode:
        Subgroup basic-clone-single-crtc:
                dmesg-warn -> PASS       (snb-dellxps)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                pass       -> DMESG-WARN (bdw-ultra)

bdw-ultra        total:132  pass:124  dwarn:2   dfail:0   fail:0   skip:6  
bsw-nuc-2        total:135  pass:115  dwarn:0   dfail:0   fail:0   skip:20 
byt-nuc          total:135  pass:120  dwarn:2   dfail:0   fail:0   skip:13 
hsw-brixbox      total:135  pass:126  dwarn:2   dfail:0   fail:0   skip:7  
hsw-gt2          total:135  pass:130  dwarn:1   dfail:0   fail:0   skip:4  
ilk-hp8440p      total:135  pass:99   dwarn:1   dfail:0   fail:0   skip:35 
ivb-t430s        total:135  pass:127  dwarn:2   dfail:0   fail:0   skip:6  
skl-i5k-2        total:135  pass:122  dwarn:5   dfail:0   fail:0   skip:8  
skl-i7k-2        total:135  pass:121  dwarn:6   dfail:0   fail:0   skip:8  
snb-dellxps      total:135  pass:122  dwarn:1   dfail:0   fail:0   skip:12 
snb-x220t        total:135  pass:120  dwarn:2   dfail:0   fail:2   skip:11 

Results at /archive/results/CI_IGT_test/Patchwork_723/

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915: Workaround CHV pipe C cursor fail
  2015-12-18 17:24 [PATCH] drm/i915: Workaround CHV pipe C cursor fail ville.syrjala
  2015-12-18 17:49 ` ✗ failure: Fi.CI.BAT Patchwork
@ 2015-12-21 13:49 ` Daniel Vetter
  2015-12-21 13:52   ` Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2015-12-21 13:49 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx, Jason Plum, stable

On Fri, Dec 18, 2015 at 07:24:39PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Turns out CHV pipe C was glued on somewhat poorly, and there's something
> wrong with the cursor. If the cursor straddles the left screen edge,
> and is then moved away from the edge or disabled, the pipe will often
> underrun. If enough underruns are triggered quickly enough the pipe
> will fall over and die (it just scans out a solid color and reports
> a constant underrun). We need to turn the disp2d power well off and
> on again to recover the pipe.
> 
> None of that is very nice for the user, so let's just refuse to place
> the cursor in the compromised position. The ddx appears to fall back
> to swcursor when the ioctl returns an error, so theoretically there's
> no loss of functionality for the user (discounting swcursor bugs).
> I suppose most cursors images actually have the hotspot not exactly
> at 0,0 so under typical conditions the fallback will in fact kick in
> as soon as the cursor touches the left edge of the screen.
> 
> Any atomic compositor should anyway be prepared to fall back to
> GPU composition when things don't work out, so there should be no
> problem with those.
> 
> Other things that I tried to solve this include flipping all
> display related clock gating knobs I could find, increasing the
> minimum gtt alignment all the way up to 512k. I also tried to see
> if there are more specific screen coordinates that hit the bug, but
> the findings were somewhat inconclusive. Sometimes the failures
> happen almost across the whole left edge, sometimes more at the very
> top and around the bottom half. I wasn't able to find any real pattern
> to these variations, so it seems our only choice is to just refuse
> to straddle the left screen edge at all.
> 
> Cc: stable@vger.kernel.org
> Cc: Jason Plum <max@warheads.net>
> Testcase: igt/kms_chv_cursor_fail
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92826
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Well can't really review with Bspec and I don't expect we can get
confirmation from hw engineers. But does what it says in the commit
message.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index abd2d2944022..8acc66b95139 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14059,6 +14059,7 @@ intel_check_cursor_plane(struct drm_plane *plane,
>  	struct drm_crtc *crtc = crtc_state->base.crtc;
>  	struct drm_framebuffer *fb = state->base.fb;
>  	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
> +	enum pipe pipe = to_intel_plane(plane)->pipe;
>  	unsigned stride;
>  	int ret;
>  
> @@ -14092,6 +14093,22 @@ intel_check_cursor_plane(struct drm_plane *plane,
>  		return -EINVAL;
>  	}
>  
> +	/*
> +	 * There's something wrong with the cursor on CHV pipe C.
> +	 * If it straddles the left edge of the screen then
> +	 * moving it away from the edge or disabling it often
> +	 * results in a pipe underrun, and often that can lead to
> +	 * dead pipe (constant underrun reported, and it scans
> +	 * out just a solid color). To recover from that, the
> +	 * display power well must be turned off and on again.
> +	 * Refuse the put the cursor into that compromised position.
> +	 */
> +	if (IS_CHERRYVIEW(plane->dev) && pipe == PIPE_C &&
> +	    state->visible && state->base.crtc_x < 0) {
> +		DRM_DEBUG_KMS("CHV cursor C not allowed to straddle the left screen edge\n");
> +		return -EINVAL;
> +	}
> +
>  	return 0;
>  }
>  
> -- 
> 2.4.10
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Workaround CHV pipe C cursor fail
  2015-12-21 13:49 ` [Intel-gfx] [PATCH] drm/i915: Workaround CHV pipe C cursor fail Daniel Vetter
@ 2015-12-21 13:52   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2015-12-21 13:52 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx, stable, Jason Plum

On Mon, Dec 21, 2015 at 02:49:18PM +0100, Daniel Vetter wrote:
> On Fri, Dec 18, 2015 at 07:24:39PM +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Turns out CHV pipe C was glued on somewhat poorly, and there's something
> > wrong with the cursor. If the cursor straddles the left screen edge,
> > and is then moved away from the edge or disabled, the pipe will often
> > underrun. If enough underruns are triggered quickly enough the pipe
> > will fall over and die (it just scans out a solid color and reports
> > a constant underrun). We need to turn the disp2d power well off and
> > on again to recover the pipe.
> > 
> > None of that is very nice for the user, so let's just refuse to place
> > the cursor in the compromised position. The ddx appears to fall back
> > to swcursor when the ioctl returns an error, so theoretically there's
> > no loss of functionality for the user (discounting swcursor bugs).
> > I suppose most cursors images actually have the hotspot not exactly
> > at 0,0 so under typical conditions the fallback will in fact kick in
> > as soon as the cursor touches the left edge of the screen.
> > 
> > Any atomic compositor should anyway be prepared to fall back to
> > GPU composition when things don't work out, so there should be no
> > problem with those.
> > 
> > Other things that I tried to solve this include flipping all
> > display related clock gating knobs I could find, increasing the
> > minimum gtt alignment all the way up to 512k. I also tried to see
> > if there are more specific screen coordinates that hit the bug, but
> > the findings were somewhat inconclusive. Sometimes the failures
> > happen almost across the whole left edge, sometimes more at the very
> > top and around the bottom half. I wasn't able to find any real pattern
> > to these variations, so it seems our only choice is to just refuse
> > to straddle the left screen edge at all.
> > 
> > Cc: stable@vger.kernel.org
> > Cc: Jason Plum <max@warheads.net>
> > Testcase: igt/kms_chv_cursor_fail
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92826
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Well can't really review with Bspec and I don't expect we can get
> confirmation from hw engineers. But does what it says in the commit
> message.
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

And applied to dinq since that's our new flow even for fixes.
-Daniel

> 
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index abd2d2944022..8acc66b95139 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -14059,6 +14059,7 @@ intel_check_cursor_plane(struct drm_plane *plane,
> >  	struct drm_crtc *crtc = crtc_state->base.crtc;
> >  	struct drm_framebuffer *fb = state->base.fb;
> >  	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
> > +	enum pipe pipe = to_intel_plane(plane)->pipe;
> >  	unsigned stride;
> >  	int ret;
> >  
> > @@ -14092,6 +14093,22 @@ intel_check_cursor_plane(struct drm_plane *plane,
> >  		return -EINVAL;
> >  	}
> >  
> > +	/*
> > +	 * There's something wrong with the cursor on CHV pipe C.
> > +	 * If it straddles the left edge of the screen then
> > +	 * moving it away from the edge or disabling it often
> > +	 * results in a pipe underrun, and often that can lead to
> > +	 * dead pipe (constant underrun reported, and it scans
> > +	 * out just a solid color). To recover from that, the
> > +	 * display power well must be turned off and on again.
> > +	 * Refuse the put the cursor into that compromised position.
> > +	 */
> > +	if (IS_CHERRYVIEW(plane->dev) && pipe == PIPE_C &&
> > +	    state->visible && state->base.crtc_x < 0) {
> > +		DRM_DEBUG_KMS("CHV cursor C not allowed to straddle the left screen edge\n");
> > +		return -EINVAL;
> > +	}
> > +
> >  	return 0;
> >  }
> >  
> > -- 
> > 2.4.10
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-21 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-18 17:24 [PATCH] drm/i915: Workaround CHV pipe C cursor fail ville.syrjala
2015-12-18 17:49 ` ✗ failure: Fi.CI.BAT Patchwork
2015-12-21 13:49 ` [Intel-gfx] [PATCH] drm/i915: Workaround CHV pipe C cursor fail Daniel Vetter
2015-12-21 13:52   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox