Commit 8a5729a3 authored by Damien Lespiau's avatar Damien Lespiau Committed by Daniel Vetter

drm/i915: Fix reason for per-chip disabling of FBC

When running on my snb machine, recent kernels display successively:

[drm:intel_update_fbc], fbc set to per-chip default
[drm:intel_update_fbc], fbc disabled per module param

But no module param is set. This happens because the check for the
module parameter uses a variable that has been overridden inside the
"per-chip default" code.

Fix up the logic and add another reason for the FBC to the be disabled.
Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent b63fb44c
...@@ -1518,6 +1518,9 @@ static int i915_fbc_status(struct seq_file *m, void *unused) ...@@ -1518,6 +1518,9 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
case FBC_MODULE_PARAM: case FBC_MODULE_PARAM:
seq_printf(m, "disabled per module param (default off)"); seq_printf(m, "disabled per module param (default off)");
break; break;
case FBC_CHIP_DEFAULT:
seq_printf(m, "disabled per chip default");
break;
default: default:
seq_printf(m, "unknown reason"); seq_printf(m, "unknown reason");
} }
......
...@@ -537,6 +537,7 @@ enum no_fbc_reason { ...@@ -537,6 +537,7 @@ enum no_fbc_reason {
FBC_NOT_TILED, /* buffer not tiled */ FBC_NOT_TILED, /* buffer not tiled */
FBC_MULTIPLE_PIPES, /* more than one pipe active */ FBC_MULTIPLE_PIPES, /* more than one pipe active */
FBC_MODULE_PARAM, FBC_MODULE_PARAM,
FBC_CHIP_DEFAULT, /* disabled by default on this chip */
}; };
enum intel_pch { enum intel_pch {
......
...@@ -447,7 +447,6 @@ void intel_update_fbc(struct drm_device *dev) ...@@ -447,7 +447,6 @@ void intel_update_fbc(struct drm_device *dev)
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
struct intel_framebuffer *intel_fb; struct intel_framebuffer *intel_fb;
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
int enable_fbc;
unsigned int max_hdisplay, max_vdisplay; unsigned int max_hdisplay, max_vdisplay;
if (!i915_powersave) if (!i915_powersave)
...@@ -488,14 +487,13 @@ void intel_update_fbc(struct drm_device *dev) ...@@ -488,14 +487,13 @@ void intel_update_fbc(struct drm_device *dev)
intel_fb = to_intel_framebuffer(fb); intel_fb = to_intel_framebuffer(fb);
obj = intel_fb->obj; obj = intel_fb->obj;
enable_fbc = i915_enable_fbc; if (i915_enable_fbc < 0 &&
if (enable_fbc < 0) { INTEL_INFO(dev)->gen <= 7 && !IS_HASWELL(dev)) {
DRM_DEBUG_KMS("fbc set to per-chip default\n"); DRM_DEBUG_KMS("disabled per chip default\n");
enable_fbc = 1; dev_priv->no_fbc_reason = FBC_CHIP_DEFAULT;
if (INTEL_INFO(dev)->gen <= 7 && !IS_HASWELL(dev)) goto out_disable;
enable_fbc = 0;
} }
if (!enable_fbc) { if (!i915_enable_fbc) {
DRM_DEBUG_KMS("fbc disabled per module param\n"); DRM_DEBUG_KMS("fbc disabled per module param\n");
dev_priv->no_fbc_reason = FBC_MODULE_PARAM; dev_priv->no_fbc_reason = FBC_MODULE_PARAM;
goto out_disable; goto out_disable;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment