From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [Intel-gfx] [PATCH] drm/i915: Workaround CHV pipe C cursor fail Date: Mon, 21 Dec 2015 14:49:18 +0100 Message-ID: <20151221134918.GZ30437@phenom.ffwll.local> References: <1450459479-16286-1-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <1450459479-16286-1-git-send-email-ville.syrjala@linux.intel.com> Sender: stable-owner@vger.kernel.org To: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org, Jason Plum , stable@vger.kernel.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Dec 18, 2015 at 07:24:39PM +0200, ville.syrjala@linux.intel.com= wrote: > From: Ville Syrj=E4l=E4 >=20 > Turns out CHV pipe C was glued on somewhat poorly, and there's someth= ing > 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. >=20 > 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. >=20 > 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. >=20 > 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 patter= n > to these variations, so it seems our only choice is to just refuse > to straddle the left screen edge at all. >=20 > Cc: stable@vger.kernel.org > Cc: Jason Plum > Testcase: igt/kms_chv_cursor_fail > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3D92826 > Signed-off-by: Ville Syrj=E4l=E4 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 > --- > drivers/gpu/drm/i915/intel_display.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) >=20 > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i= 915/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 *pl= ane, > struct drm_crtc *crtc =3D crtc_state->base.crtc; > struct drm_framebuffer *fb =3D state->base.fb; > struct drm_i915_gem_object *obj =3D intel_fb_obj(fb); > + enum pipe pipe =3D to_intel_plane(plane)->pipe; > unsigned stride; > int ret; > =20 > @@ -14092,6 +14093,22 @@ intel_check_cursor_plane(struct drm_plane *p= lane, > return -EINVAL; > } > =20 > + /* > + * 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 =3D=3D PIPE_C && > + state->visible && state->base.crtc_x < 0) { > + DRM_DEBUG_KMS("CHV cursor C not allowed to straddle the left scree= n edge\n"); > + return -EINVAL; > + } > + > return 0; > } > =20 > --=20 > 2.4.10 >=20 > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx --=20 Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch