From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com ([74.125.82.52]:38571 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751263AbbLUNwl (ORCPT ); Mon, 21 Dec 2015 08:52:41 -0500 Received: by mail-wm0-f52.google.com with SMTP id l126so70904484wml.1 for ; Mon, 21 Dec 2015 05:52:40 -0800 (PST) Date: Mon, 21 Dec 2015 14:52:42 +0100 From: Daniel Vetter To: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org, Jason Plum , stable@vger.kernel.org Subject: Re: [Intel-gfx] [PATCH] drm/i915: Workaround CHV pipe C cursor fail Message-ID: <20151221135241.GA30437@phenom.ffwll.local> References: <1450459479-16286-1-git-send-email-ville.syrjala@linux.intel.com> <20151221134918.GZ30437@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20151221134918.GZ30437@phenom.ffwll.local> Sender: stable-owner@vger.kernel.org List-ID: 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� > > > > 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 > > Testcase: igt/kms_chv_cursor_fail > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92826 > > Signed-off-by: Ville Syrj�l� > > 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 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