@@ -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;