From: Ville Syrjälä <ville.syrj...@linux.intel.com>

If the scanout object exceeds the size of the stolen memory, there's no
way we can ever enable fbc with it. Just say no.

Signed-off-by: Ville Syrjälä <ville.syrj...@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index f3ef14a..777167e 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -471,6 +471,7 @@ static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
 static bool intel_fbc1_possible(struct intel_crtc *crtc)
 {
        struct drm_device *dev = crtc->base.dev;
+       struct drm_i915_private *dev_priv = dev->dev_private;
        struct drm_framebuffer *fb = crtc->base.primary->fb;
        struct drm_i915_gem_object *obj;
 
@@ -535,6 +536,12 @@ static bool intel_fbc1_possible(struct intel_crtc *crtc)
 
        obj = to_intel_framebuffer(fb)->obj;
 
+       if (obj->base.size > dev_priv->gtt.stolen_size) {
+               DRM_DEBUG("FBC pipe %c, plane %c: framebuffer too big for 
stolen\n",
+                         pipe_name(crtc->pipe), plane_name(crtc->plane));
+               return false;
+       }
+
        if (obj->tiling_mode != I915_TILING_X ||
            obj->fence_reg == I915_FENCE_REG_NONE) {
                DRM_DEBUG("FBC pipe %c, plane %c: framebuffer not tiled or 
fenced\n",
@@ -648,6 +655,12 @@ static bool intel_fbc2_possible(struct intel_crtc *crtc)
 
        obj = to_intel_framebuffer(fb)->obj;
 
+       if (obj->base.size > dev_priv->gtt.stolen_size) {
+               DRM_DEBUG("FBC pipe %c, plane %c: framebuffer too big for 
stolen\n",
+                         pipe_name(crtc->pipe), plane_name(crtc->plane));
+               return false;
+       }
+
        if (obj->tiling_mode != I915_TILING_X ||
            obj->fence_reg == I915_FENCE_REG_NONE) {
                DRM_DEBUG("FBC pipe %c, plane %c: framebuffer not tiled or 
fenced\n",
-- 
1.8.5.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to