public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ander Conselvan De Oliveira <conselvan2@gmail.com>
To: Ismael Luceno <ismael@iodev.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Fix screen flickering on X
Date: Mon, 13 Apr 2015 15:33:38 +0300	[thread overview]
Message-ID: <1428928418.2654.8.camel@gmail.com> (raw)
In-Reply-To: <1428790644-6812-1-git-send-email-ismael@iodev.co.uk>

On Sat, 2015-04-11 at 19:17 -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 <ismael@iodev.co.uk>
> ---
>  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);
> +	}


We can't call intel_update_watermarks() from here because we commit
under vblank evasion (with interrupts disabled) and some parts of that
function might sleep. That's why that call to it was moved to
intel_begin_crtc_commit(). The check for change in width was moved to
intel_check_cursor_plane() (where the intel_crtc->atomic.update_wm flag
is set).

So the question here is why that logic is not working. Could you check
if update_wm is being set and intel_update_watermarks() called from
intel_begin_crtc_commit()?

Thanks,
Ander

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

  reply	other threads:[~2015-04-13 12:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-11 22:17 [PATCH] drm/i915: Fix screen flickering on X Ismael Luceno
2015-04-13 12:33 ` Ander Conselvan De Oliveira [this message]
     [not found] <1428792034-6131-1-git-send-email-ismael@iodev.co.uk>
2015-04-23  9:15 ` Chris Wilson
2015-05-07  9:12   ` Jani Nikula
2015-05-07 13:27     ` Matt Roper
2015-05-07 13:41       ` Jani Nikula
2015-05-07 14:18         ` [Intel-gfx] " Chris Wilson
2015-05-07 21:23           ` Ismael Luceno
2015-05-08 15:10         ` Ismael Luceno
2015-05-08 15:16           ` Ismael Luceno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428928418.2654.8.camel@gmail.com \
    --to=conselvan2@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ismael@iodev.co.uk \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox