diff mbox

[04/14] Revert "drm/i915/sprite: Always enable the scaler on IronLake"

Message ID 1386251501-10602-5-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjala Dec. 5, 2013, 1:51 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Apparently always enabling the sprite scaler magically made
sprites work on ILK in the past.

I think the real reason for the failure was missing sprite
watermark programming, and enabling the scaler effectively
disabled LP1+ watermarks, which was enough to keep things going.
Or it might be that the hardware more or less ignores watermarks
for scaled sprites since things seem to work even if I leave
sprite watermarks at 0 and disable all other planes except the
sprite.

In any case, we left the scaler always on but then failed to
check whether we might be exceeding the scaler's source size
limits. That caused the sprite to fail when a sufficiently
large unscaled image was being displayed.

Now that we're getting proper watermark programming for ILK, we
can keep the scaler disabled unless we need to do actual scaling.

This reverts commit 8aaa81a166d80ac9bf2813984e5b4c2503d0fe08.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_sprite.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Imre Deak Dec. 16, 2013, 9:42 p.m. UTC | #1
On Thu, 2013-12-05 at 15:51 +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Apparently always enabling the sprite scaler magically made
> sprites work on ILK in the past.
> 
> I think the real reason for the failure was missing sprite
> watermark programming, and enabling the scaler effectively
> disabled LP1+ watermarks, which was enough to keep things going.
> Or it might be that the hardware more or less ignores watermarks
> for scaled sprites since things seem to work even if I leave
> sprite watermarks at 0 and disable all other planes except the
> sprite.
> 
> In any case, we left the scaler always on but then failed to
> check whether we might be exceeding the scaler's source size
> limits. That caused the sprite to fail when a sufficiently
> large unscaled image was being displayed.
> 
> Now that we're getting proper watermark programming for ILK, we
> can keep the scaler disabled unless we need to do actual scaling.
> 
> This reverts commit 8aaa81a166d80ac9bf2813984e5b4c2503d0fe08.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Since we switch to the new calculation only at patch 11/14, it'd be
better to apply this after that, so we don't re-introduce the issue in
between.

--Imre

> ---
>  drivers/gpu/drm/i915/intel_sprite.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 90a3f6d..6bfebfb 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -488,7 +488,7 @@ ilk_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
>  	crtc_h--;
>  
>  	dvsscale = 0;
> -	if (IS_GEN5(dev) || crtc_w != src_w || crtc_h != src_h)
> +	if (crtc_w != src_w || crtc_h != src_h)
>  		dvsscale = DVS_SCALE_ENABLE | (src_w << 16) | src_h;
>  
>  	I915_WRITE(DVSSTRIDE(pipe), fb->pitches[0]);
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 90a3f6d..6bfebfb 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -488,7 +488,7 @@  ilk_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 	crtc_h--;
 
 	dvsscale = 0;
-	if (IS_GEN5(dev) || crtc_w != src_w || crtc_h != src_h)
+	if (crtc_w != src_w || crtc_h != src_h)
 		dvsscale = DVS_SCALE_ENABLE | (src_w << 16) | src_h;
 
 	I915_WRITE(DVSSTRIDE(pipe), fb->pitches[0]);