[Intel-gfx] [PATCH 9/9] drm/i915: FBC only supports 16bpp and 32bpp
Paulo Zanoni
przanoni at gmail.com
Tue Dec 23 04:35:45 PST 2014
From: Paulo Zanoni <paulo.r.zanoni at intel.com>
So check for this.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
---
drivers/gpu/drm/i915/intel_fbc.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 80bdbde..8c6fb1d 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -515,6 +515,7 @@ static void __intel_fbc_update(struct drm_device *dev)
struct drm_i915_gem_object *obj;
const struct drm_display_mode *adjusted_mode;
unsigned int max_width, max_height;
+ int fb_cpp;
lockdep_assert_held(&dev_priv->fbc.lock);
@@ -598,6 +599,13 @@ static void __intel_fbc_update(struct drm_device *dev)
goto out_disable;
}
+ fb_cpp = drm_format_plane_cpp(fb->pixel_format, 0);
+ if (!(fb_cpp == 2 || fb_cpp == 4)) {
+ if (set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED_MODE));
+ DRM_DEBUG_KMS("FBC only supports 16bpp and 32bpp\n");
+ goto out_disable;
+ }
+
/* If the kernel debugger is active, always disable compression */
if (in_dbg_master())
goto out_disable;
@@ -640,8 +648,7 @@ static void __intel_fbc_update(struct drm_device *dev)
__intel_fbc_disable(dev);
}
- if (i915_gem_stolen_setup_compression(dev, obj->base.size,
- drm_format_plane_cpp(fb->pixel_format, 0))) {
+ if (i915_gem_stolen_setup_compression(dev, obj->base.size, fb_cpp)) {
if (set_no_fbc_reason(dev_priv, FBC_STOLEN_TOO_SMALL))
DRM_DEBUG_KMS("framebuffer too large, disabling compression\n");
return;
--
2.1.3
More information about the Intel-gfx
mailing list