All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/sprite: Avoid incurring extra vblank stall when updating plane on IVB
@ 2012-04-18 16:12 Chris Wilson
  2012-04-18 16:23 ` Jesse Barnes
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2012-04-18 16:12 UTC (permalink / raw)
  To: intel-gfx

IvyBridge requires an extra frame between disabling the low power
watermarks and enabling scaling on the sprite plane. If the scaling
is already enabled, then we have already disabled the low power
watermarks and need not incur an extra wait.

Similarly, as we disable the scaling when turning off the sprite plane,
we can update the scaling enabled flag and restore the low power
watermarks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_sprite.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 11545ca..659bcf1 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -110,14 +110,18 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
 	 * when scaling is disabled.
 	 */
 	if (crtc_w != src_w || crtc_h != src_h) {
-		dev_priv->sprite_scaling_enabled = true;
-		intel_update_watermarks(dev);
-		intel_wait_for_vblank(dev, pipe);
+		if (!dev_priv->sprite_scaling_enabled) {
+			dev_priv->sprite_scaling_enabled = true;
+			intel_update_watermarks(dev);
+			intel_wait_for_vblank(dev, pipe);
+		}
 		sprscale = SPRITE_SCALE_ENABLE | (src_w << 16) | src_h;
 	} else {
-		dev_priv->sprite_scaling_enabled = false;
-		/* potentially re-enable LP watermarks */
-		intel_update_watermarks(dev);
+		if (dev_priv->sprite_scaling_enabled) {
+			dev_priv->sprite_scaling_enabled = false;
+			/* potentially re-enable LP watermarks */
+			intel_update_watermarks(dev);
+		}
 	}
 
 	I915_WRITE(SPRSTRIDE(pipe), fb->pitches[0]);
@@ -151,6 +155,9 @@ ivb_disable_plane(struct drm_plane *plane)
 	/* Activate double buffered register update */
 	I915_MODIFY_DISPBASE(SPRSURF(pipe), 0);
 	POSTING_READ(SPRSURF(pipe));
+
+	dev_priv->sprite_scaling_enabled = false;
+	intel_update_watermarks(dev);
 }
 
 static int
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915/sprite: Avoid incurring extra vblank stall when updating plane on IVB
  2012-04-18 16:12 [PATCH] drm/i915/sprite: Avoid incurring extra vblank stall when updating plane on IVB Chris Wilson
@ 2012-04-18 16:23 ` Jesse Barnes
  2012-04-21 16:53   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Jesse Barnes @ 2012-04-18 16:23 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Wed, 18 Apr 2012 17:12:26 +0100
Chris Wilson <chris@chris-wilson.co.uk> wrote:

> IvyBridge requires an extra frame between disabling the low power
> watermarks and enabling scaling on the sprite plane. If the scaling
> is already enabled, then we have already disabled the low power
> watermarks and need not incur an extra wait.
> 
> Similarly, as we disable the scaling when turning off the sprite plane,
> we can update the scaling enabled flag and restore the low power
> watermarks.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---

Yep, this is a good optimization.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915/sprite: Avoid incurring extra vblank stall when updating plane on IVB
  2012-04-18 16:23 ` Jesse Barnes
@ 2012-04-21 16:53   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2012-04-21 16:53 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: intel-gfx

On Wed, Apr 18, 2012 at 09:23:46AM -0700, Jesse Barnes wrote:
> On Wed, 18 Apr 2012 17:12:26 +0100
> Chris Wilson <chris@chris-wilson.co.uk> wrote:
> 
> > IvyBridge requires an extra frame between disabling the low power
> > watermarks and enabling scaling on the sprite plane. If the scaling
> > is already enabled, then we have already disabled the low power
> > watermarks and need not incur an extra wait.
> > 
> > Similarly, as we disable the scaling when turning off the sprite plane,
> > we can update the scaling enabled flag and restore the low power
> > watermarks.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> > ---
> 
> Yep, this is a good optimization.
> 
> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-21 16:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-18 16:12 [PATCH] drm/i915/sprite: Avoid incurring extra vblank stall when updating plane on IVB Chris Wilson
2012-04-18 16:23 ` Jesse Barnes
2012-04-21 16:53   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.