Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964818AbbDWJPv (ORCPT ); Thu, 23 Apr 2015 05:15:51 -0400 Received: from mail.fireflyinternet.com ([87.106.93.118]:52226 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751685AbbDWJPr (ORCPT ); Thu, 23 Apr 2015 05:15:47 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Date: Thu, 23 Apr 2015 10:15:32 +0100 From: Chris Wilson To: Matt Roper Cc: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org Subject: Re: [PATCH] drm/i915: Fix screen flickering on X Message-ID: <20150423091532.GA21511@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Matt Roper , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org References: <1428792034-6131-1-git-send-email-ismael@iodev.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428792034-6131-1-git-send-email-ismael@iodev.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2579 Lines: 67 [cc'ing the authors] On Sat, Apr 11, 2015 at 07:40:34PM -0300, Ismael Luceno wrote: > A bisect showed that commit 32b7eeec4d1e861230b09d437e95d76c86ff4a68 > introduced the issue. > > The issue starts as soon as X takes control of the screen, even if just > a plain X doing nothing, so based on the code touched by the commit I > thought it had to be related to the so called "hardware cursor". I > confirmed it when hiding the cursor made the flickering go away. > > The aforementioned commit removed some suspicious code, and the > Programmer's Reference Manual confirmed my suspicion: > > "Incorrectly programmed watermark values can result in screen corruption. > > The watermarks should be calculated and programmed when any of the > watermark calculation inputs change. This includes planes enabling or > disabling, plane source format or size changing, etc." > > So I'm re-adding the few lines that update the watermarks after a cursor > size change. > > Signed-off-by: Ismael Luceno > --- > drivers/gpu/drm/i915/intel_display.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index f75173c..e23f062 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -12258,6 +12258,7 @@ intel_commit_cursor_plane(struct drm_plane *plane, > struct intel_crtc *intel_crtc; > struct intel_plane *intel_plane = to_intel_plane(plane); > struct drm_i915_gem_object *obj = intel_fb_obj(state->base.fb); > + unsigned old_width; > uint32_t addr; > > crtc = crtc ? crtc : plane->crtc; > @@ -12282,11 +12283,15 @@ intel_commit_cursor_plane(struct drm_plane *plane, > intel_crtc->cursor_addr = addr; > intel_crtc->cursor_bo = obj; > update: > + old_width = intel_crtc->cursor_width; > intel_crtc->cursor_width = state->base.crtc_w; > intel_crtc->cursor_height = state->base.crtc_h; > > - if (intel_crtc->active) > + if (intel_crtc->active) { > + if (old_width != intel_crtc->cursor_width) > + intel_update_watermarks(crtc); > intel_crtc_update_cursor(crtc, state->visible); > + } > } > > static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev, > -- > 2.3.4 -- Chris Wilson, Intel Open Source Technology Centre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/