drm/i915: Gen2 FBC1 CFB pitch wants 32B units
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 28 Nov 2013 15:29:56 +0000 (17:29 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 12 Dec 2013 14:57:47 +0000 (15:57 +0100)
On gen2 the compressed frame buffer pitch is specified in 32B units
rather than the 64B units used on gen3+.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_pm.c

index 3cd521f3823bb8e7c547874b4a6b12e929c5312e..599d445f7ce953c408bc4354128517f5cb369f89 100644 (file)
@@ -104,8 +104,11 @@ static void i8xx_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
        if (fb->pitches[0] < cfb_pitch)
                cfb_pitch = fb->pitches[0];
 
-       /* FBC_CTL wants 64B units */
-       cfb_pitch = (cfb_pitch / 64) - 1;
+       /* FBC_CTL wants 32B or 64B units */
+       if (IS_GEN2(dev))
+               cfb_pitch = (cfb_pitch / 32) - 1;
+       else
+               cfb_pitch = (cfb_pitch / 64) - 1;
        plane = intel_crtc->plane == 0 ? FBC_CTL_PLANEA : FBC_CTL_PLANEB;
 
        /* Clear old tags */