drm/i915: Pass the actual sprite width to watermarks functions
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 5 Jul 2013 08:57:14 +0000 (11:57 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 5 Aug 2013 17:03:56 +0000 (19:03 +0200)
Don't subtract one from the sprite width before watermark calculations.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_pm.c
drivers/gpu/drm/i915/intel_sprite.c

index f9813b3ead346dff87453529c9f43b8e7d6ddbc7..9ef476b2eeeb76c77f77bf1d4ff6599cdb351ab4 100644 (file)
@@ -2641,7 +2641,7 @@ static void haswell_update_sprite_wm(struct drm_device *dev, int pipe,
                if (intel_plane->pipe == pipe) {
                        intel_plane->wm.enabled = enabled;
                        intel_plane->wm.scaled = scaled;
-                       intel_plane->wm.horiz_pixels = sprite_width + 1;
+                       intel_plane->wm.horiz_pixels = sprite_width;
                        intel_plane->wm.bytes_per_pixel = pixel_size;
                        break;
                }
index 069155f17edba3edc2c605cded0b2839738faa22..3e3a6d01cff68cdf173d3803043210bc407c7bbe 100644 (file)
@@ -108,15 +108,15 @@ vlv_update_plane(struct drm_plane *dplane, struct drm_framebuffer *fb,
 
        sprctl |= SP_ENABLE;
 
+       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true,
+                                      src_w != crtc_w || src_h != crtc_h);
+
        /* Sizes are 0 based */
        src_w--;
        src_h--;
        crtc_w--;
        crtc_h--;
 
-       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true,
-                                      src_w != crtc_w || src_h != crtc_h);
-
        I915_WRITE(SPSTRIDE(pipe, plane), fb->pitches[0]);
        I915_WRITE(SPPOS(pipe, plane), (crtc_y << 16) | crtc_x);
 
@@ -263,15 +263,15 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
        if (IS_HASWELL(dev))
                sprctl |= SPRITE_PIPE_CSC_ENABLE;
 
+       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true,
+                                      src_w != crtc_w || src_h != crtc_h);
+
        /* Sizes are 0 based */
        src_w--;
        src_h--;
        crtc_w--;
        crtc_h--;
 
-       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true,
-                                      src_w != crtc_w || src_h != crtc_h);
-
        /*
         * IVB workaround: must disable low power watermarks for at least
         * one frame before enabling scaling.  LP watermarks can be re-enabled
@@ -452,15 +452,15 @@ ilk_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
                dvscntr |= DVS_TRICKLE_FEED_DISABLE; /* must disable */
        dvscntr |= DVS_ENABLE;
 
+       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true,
+                                      src_w != crtc_w || src_h != crtc_h);
+
        /* Sizes are 0 based */
        src_w--;
        src_h--;
        crtc_w--;
        crtc_h--;
 
-       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true,
-                                      src_w != crtc_w || src_h != crtc_h);
-
        dvsscale = 0;
        if (IS_GEN5(dev) || crtc_w != src_w || crtc_h != src_h)
                dvsscale = DVS_SCALE_ENABLE | (src_w << 16) | src_h;