Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751608AbbEGNjt (ORCPT ); Thu, 7 May 2015 09:39:49 -0400 Received: from mga01.intel.com ([192.55.52.88]:44885 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806AbbEGNjq (ORCPT ); Thu, 7 May 2015 09:39:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,384,1427785200"; d="scan'208";a="722222231" From: Jani Nikula To: Matt Roper , Ismael Luceno Cc: Chris Wilson , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix screen flickering on X In-Reply-To: <20150507132715.GA22531@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <1428792034-6131-1-git-send-email-ismael@iodev.co.uk> <20150423091532.GA21511@nuc-i3427.alporthouse.com> <87zj5g69al.fsf@intel.com> <20150507132715.GA22531@intel.com> User-Agent: Notmuch/0.19+112~g77230b0 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Thu, 07 May 2015 16:41:48 +0300 Message-ID: <87r3qs5wtf.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4512 Lines: 125 On Thu, 07 May 2015, Matt Roper wrote: > On Thu, May 07, 2015 at 12:12:18PM +0300, Jani Nikula wrote: >> On Thu, 23 Apr 2015, Chris Wilson wrote: >> > [cc'ing the authors] >> >> This has been posted earlier [1] and it has review to be addressed [2]. >> >> BR, >> Jani. > > I agree with Ander's response in [2]...we can't call > intel_update_watermarks() in the commit function because we're under > vblank evasion. We should already be flagging the transaction as > needing a watermark update in intel_check_cursor_plane(), and that flag > will be acted upon immediately after the commit functions are done > running, once we've re-enabled interrupts. > > Note that our current codebase looks a bit different since we've dropped > intel_crtc->cursor_{width,height}. So the relevant check in > intel_check_cursor_plane() now looks like: > > if (plane->state->crtc_w != state->base.crtc_w) > intel_crtc->atomic.update_wm = true; > > Is there a bugzilla open on this issue with more details? Not that I know of. Ismael? BR, Jani. > > > Matt > >> >> >> [1] http://mid.gmane.org/1428790644-6812-1-git-send-email-ismael@iodev.co.uk >> [2] http://mid.gmane.org/1428928418.2654.8.camel@gmail.com >> >> >> > >> > 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 >> > _______________________________________________ >> > Intel-gfx mailing list >> > Intel-gfx@lists.freedesktop.org >> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx >> >> -- >> Jani Nikula, Intel Open Source Technology Center > > -- > Matt Roper > Graphics Software Engineer > IoTG Platform Enabling & Development > Intel Corporation > (916) 356-2795 -- Jani Nikula, Intel Open Source Technology Center -- 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/