diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-01-23 09:49:12 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-01-25 15:17:02 -0500 |
commit | 3fa2e0eec794045e5935bc0f5f240a5244be91c0 (patch) | |
tree | a3fa35d6dbc0b020d4bf1c57e10d42a87e18434b /drivers/gpu/drm/i915/intel_pm.c | |
parent | 7f2cf220b867dad815126350ba7dc36515f14674 (diff) |
drm/i915: Use 1/2 compression ratio limit for 16bpp on FBC2
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index c6e047e3a74b..a7af5b4d3eb4 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -155,7 +155,11 @@ static void g4x_enable_fbc(struct drm_crtc *crtc) | |||
155 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 155 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
156 | u32 dpfc_ctl; | 156 | u32 dpfc_ctl; |
157 | 157 | ||
158 | dpfc_ctl = DPFC_CTL_PLANE(intel_crtc->plane) | DPFC_SR_EN | DPFC_CTL_LIMIT_1X; | 158 | dpfc_ctl = DPFC_CTL_PLANE(intel_crtc->plane) | DPFC_SR_EN; |
159 | if (drm_format_plane_cpp(fb->pixel_format, 0) == 2) | ||
160 | dpfc_ctl |= DPFC_CTL_LIMIT_2X; | ||
161 | else | ||
162 | dpfc_ctl |= DPFC_CTL_LIMIT_1X; | ||
159 | dpfc_ctl |= DPFC_CTL_FENCE_EN | obj->fence_reg; | 163 | dpfc_ctl |= DPFC_CTL_FENCE_EN | obj->fence_reg; |
160 | 164 | ||
161 | I915_WRITE(DPFC_FENCE_YOFF, crtc->y); | 165 | I915_WRITE(DPFC_FENCE_YOFF, crtc->y); |
@@ -225,7 +229,11 @@ static void ironlake_enable_fbc(struct drm_crtc *crtc) | |||
225 | 229 | ||
226 | dpfc_ctl = I915_READ(ILK_DPFC_CONTROL); | 230 | dpfc_ctl = I915_READ(ILK_DPFC_CONTROL); |
227 | dpfc_ctl &= DPFC_RESERVED; | 231 | dpfc_ctl &= DPFC_RESERVED; |
228 | dpfc_ctl |= DPFC_CTL_PLANE(intel_crtc->plane) | DPFC_CTL_LIMIT_1X; | 232 | dpfc_ctl |= DPFC_CTL_PLANE(intel_crtc->plane); |
233 | if (drm_format_plane_cpp(fb->pixel_format, 0) == 2) | ||
234 | dpfc_ctl |= DPFC_CTL_LIMIT_2X; | ||
235 | else | ||
236 | dpfc_ctl |= DPFC_CTL_LIMIT_1X; | ||
229 | dpfc_ctl |= DPFC_CTL_FENCE_EN; | 237 | dpfc_ctl |= DPFC_CTL_FENCE_EN; |
230 | if (IS_GEN5(dev)) | 238 | if (IS_GEN5(dev)) |
231 | dpfc_ctl |= obj->fence_reg; | 239 | dpfc_ctl |= obj->fence_reg; |
@@ -275,10 +283,16 @@ static void gen7_enable_fbc(struct drm_crtc *crtc) | |||
275 | struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); | 283 | struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); |
276 | struct drm_i915_gem_object *obj = intel_fb->obj; | 284 | struct drm_i915_gem_object *obj = intel_fb->obj; |
277 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 285 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
286 | u32 dpfc_ctl; | ||
278 | 287 | ||
279 | I915_WRITE(ILK_DPFC_CONTROL, DPFC_CTL_EN | DPFC_CTL_LIMIT_1X | | 288 | dpfc_ctl = IVB_DPFC_CTL_PLANE(intel_crtc->plane); |
280 | IVB_DPFC_CTL_FENCE_EN | | 289 | if (drm_format_plane_cpp(fb->pixel_format, 0) == 2) |
281 | IVB_DPFC_CTL_PLANE(intel_crtc->plane)); | 290 | dpfc_ctl |= DPFC_CTL_LIMIT_2X; |
291 | else | ||
292 | dpfc_ctl |= DPFC_CTL_LIMIT_1X; | ||
293 | dpfc_ctl |= IVB_DPFC_CTL_FENCE_EN; | ||
294 | |||
295 | I915_WRITE(ILK_DPFC_CONTROL, dpfc_ctl | DPFC_CTL_EN); | ||
282 | 296 | ||
283 | if (IS_IVYBRIDGE(dev)) { | 297 | if (IS_IVYBRIDGE(dev)) { |
284 | /* WaFbcAsynchFlipDisableFbcQueue:ivb */ | 298 | /* WaFbcAsynchFlipDisableFbcQueue:ivb */ |