public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, Sagar Kamble <sagar.a.kamble@intel.com>
Subject: Re: [PATCH 2/2] drm/i915: Recompute WM when the cursor size changes
Date: Wed, 26 Mar 2014 13:53:13 +0100	[thread overview]
Message-ID: <20140326125313.GT26878@phenom.ffwll.local> (raw)
In-Reply-To: <1395837495-29870-2-git-send-email-chris@chris-wilson.co.uk>

On Wed, Mar 26, 2014 at 12:38:15PM +0000, Chris Wilson wrote:
> If the cursor width is changed, we may need to recompute our WM to
> prevent untold flickering. We hope that the registers are flushed on the
> same vblank to prevent underruns...
> 
> Cc: Damien Lespiau <damien.lespiau@intel.com>
> Cc: Sagar Kamble <sagar.a.kamble@intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index c8c52d105b8c..e15b3abe1350 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -7763,6 +7763,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>  	struct drm_i915_gem_object *obj;
> +	unsigned old_width;
>  	uint32_t addr;
>  	int ret;
>  
> @@ -7853,13 +7854,18 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
>  
>  	mutex_unlock(&dev->struct_mutex);
>  
> +	old_width = intel_crtc->cursor_width;
> +
>  	intel_crtc->cursor_addr = addr;
>  	intel_crtc->cursor_bo = obj;
>  	intel_crtc->cursor_width = width;
>  	intel_crtc->cursor_height = height;
>  
> -	if (intel_crtc->active)
> +	if (intel_crtc->active) {
> +		if (old_width != width)
> +			intel_update_watermarks(crtc);

Shouldn't we recompute when shrinking after and when growing before we
change the cursor size? vblank-syncing maybe even. Given all the amotic
foo we currently have I expect that cursors are as underrun prone as all
the other stuff is, too.

But can be done in a later patch, together with the nasty igt which walks
the cursor all over the place while changing the size ;-) And I guess
Ville gets to pimp his atomic update code and wm 2-stage update for this
stuff here, too.

I get a feeling this isn't quite as simple as Sagar's first patch
suggested ...
-Daniel
>  		intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);
> +	}
>  
>  	return 0;
>  fail_unpin:
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-03-26 12:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25 14:49 [PATCH 0/3] A few cursor fixups after the multi-size patches Damien Lespiau
2014-03-25 14:49 ` [PATCH 1/3] drm/i915: Don't set mode_config's cursor size Damien Lespiau
2014-03-25 14:54   ` Chris Wilson
2014-03-25 14:59     ` Damien Lespiau
2014-03-25 15:09       ` Chris Wilson
2014-03-25 16:05         ` Damien Lespiau
2014-03-25 16:38           ` Chris Wilson
2014-03-25 16:57             ` Damien Lespiau
2014-03-25 18:23               ` Daniel Vetter
2014-03-25 18:25                 ` Daniel Vetter
2014-03-25 18:51                 ` Damien Lespiau
2014-03-25 19:42                   ` Daniel Vetter
2014-03-25 17:58             ` Damien Lespiau
2014-03-25 15:15       ` Sagar Arun Kamble
2014-03-25 15:11   ` Imre Deak
2014-03-25 14:49 ` [PATCH 2/3] drm/i915: Remove max_cursor_{width, height} from the crtc Damien Lespiau
2014-03-25 14:49 ` [PATCH 3/3] drm/i915: Use the actual cursor width for WM computation Damien Lespiau
2014-03-26 12:24   ` Chris Wilson
2014-03-26 12:27   ` Chris Wilson
2014-03-26 12:38   ` [PATCH 1/2] drm/i915: Compute WM for current cursor size Chris Wilson
2014-03-26 12:38     ` [PATCH 2/2] drm/i915: Recompute WM when the cursor size changes Chris Wilson
2014-03-26 12:53       ` Daniel Vetter [this message]
2014-03-26 15:21       ` Damien Lespiau
2014-03-26 16:35         ` Daniel Vetter
2014-03-26 15:21     ` [PATCH 1/2] drm/i915: Compute WM for current cursor size Damien Lespiau

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=20140326125313.GT26878@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sagar.a.kamble@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