Skip to contentSkip to conversation

Small FBC fix

PATCH Applied Damien Lespiau 2 participants 5 messages Jun 24, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I noticed on pre-HSW machines we get a spurious debug message:

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

but the fbc module parameter is not set. This series fixes it up.

Signature · 1 line
Damien
#1 lore raw

PATCH 1/2 drm/i915: Make intel_enable_fbc() static

This function has no user outside of intel_pm.c.

---
 drivers/gpu/drm/i915/intel_drv.h | 1 -
 drivers/gpu/drm/i915/intel_pm.c  | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_drv.h +0 -1
index ffe9d35..a165be6 100644
@@ -779,7 +779,6 @@ extern int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
 extern void intel_init_pm(struct drm_device *dev);
 /* FBC */
 extern bool intel_fbc_enabled(struct drm_device *dev);
-extern void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval);
 extern void intel_update_fbc(struct drm_device *dev);
 /* IPS */
 extern void intel_gpu_ips_init(struct drm_i915_private *dev_priv);
drivers/gpu/drm/i915/intel_pm.c +1 -1
index b27bda0..a8483f5 100644
@@ -368,7 +368,7 @@ static void intel_cancel_fbc_work(struct drm_i915_private *dev_priv)
 	dev_priv->fbc_work = NULL;
 }
 
-void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
+static void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
 {
 	struct intel_fbc_work *work;
 	struct drm_device *dev = crtc->dev;
Signature · 1 line
1.8.1.4
#2 lore raw

Re: [PATCH 1/2] drm/i915: Make intel_enable_fbc() static

Quoted 3 lines · Damien Lespiau

This function has no user outside of intel_pm.c.

Queued for -next, thanks for the patch. On the topic of stuff that sparse can catch, we've accumulated a few other ones. On a quick look I think the other non-static functions without declaration and the few enum transcoder vs. enum pipe mismatche seem to be worth fixing. Volunteered? -Daniel

Quoted 37 lines
---
 drivers/gpu/drm/i915/intel_drv.h | 1 -
 drivers/gpu/drm/i915/intel_pm.c  | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_drv.h +0 -1
index ffe9d35..a165be6 100644
@@ -779,7 +779,6 @@ extern int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
 extern void intel_init_pm(struct drm_device *dev);
 /* FBC */
 extern bool intel_fbc_enabled(struct drm_device *dev);
-extern void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval);
 extern void intel_update_fbc(struct drm_device *dev);
 /* IPS */
 extern void intel_gpu_ips_init(struct drm_i915_private *dev_priv);
drivers/gpu/drm/i915/intel_pm.c +1 -1
index b27bda0..a8483f5 100644
@@ -368,7 +368,7 @@ static void intel_cancel_fbc_work(struct drm_i915_private *dev_priv)
 	dev_priv->fbc_work = NULL;
 }
 
-void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
+static void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
 {
 	struct intel_fbc_work *work;
 	struct drm_device *dev = crtc->dev;
Signature · 6 lines
1.8.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw

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

In reply to Damien Lespiau

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.

---
 drivers/gpu/drm/i915/i915_debugfs.c |  3 +++
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_pm.c     | 14 ++++++--------
 3 files changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +3 -0
index d4e78b6..4dcaee3 100644
@@ -1469,6 +1469,9 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
 		case FBC_MODULE_PARAM:
 			seq_printf(m, "disabled per module param (default off)");
 			break;
+		case FBC_CHIP_DEFAULT:
+			seq_printf(m, "disabled per chip default");
+			break;
 		default:
 			seq_printf(m, "unknown reason");
 		}
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 10a56c9..2b8b7ac 100644
@@ -543,6 +543,7 @@ enum no_fbc_reason {
 	FBC_NOT_TILED, /* buffer not tiled */
 	FBC_MULTIPLE_PIPES, /* more than one pipe active */
 	FBC_MODULE_PARAM,
+	FBC_CHIP_DEFAULT, /* disabled by default on this chip */
 };
 
 enum intel_pch {
drivers/gpu/drm/i915/intel_pm.c +6 -8
index a8483f5..fd70a82 100644
@@ -448,7 +448,6 @@ void intel_update_fbc(struct drm_device *dev)
 	struct drm_framebuffer *fb;
 	struct intel_framebuffer *intel_fb;
 	struct drm_i915_gem_object *obj;
-	int enable_fbc;
 	unsigned int max_hdisplay, max_vdisplay;
 
 	if (!i915_powersave)
@@ -489,14 +488,13 @@ void intel_update_fbc(struct drm_device *dev)
 	intel_fb = to_intel_framebuffer(fb);
 	obj = intel_fb->obj;
 
-	enable_fbc = i915_enable_fbc;
-	if (enable_fbc < 0) {
-		DRM_DEBUG_KMS("fbc set to per-chip default\n");
-		enable_fbc = 1;
-		if (INTEL_INFO(dev)->gen <= 7 && !IS_HASWELL(dev))
-			enable_fbc = 0;
+	if (i915_enable_fbc < 0 &&
+	    INTEL_INFO(dev)->gen <= 7 && !IS_HASWELL(dev)) {
+		DRM_DEBUG_KMS("disabled per chip default\n");
+		dev_priv->no_fbc_reason = FBC_CHIP_DEFAULT;
+		goto out_disable;
 	}
-	if (!enable_fbc) {
+	if (!i915_enable_fbc) {
 		DRM_DEBUG_KMS("fbc disabled per module param\n");
 		dev_priv->no_fbc_reason = FBC_MODULE_PARAM;
 		goto out_disable;
Signature · 1 line
1.8.1.4
#4 lore raw

Re: [PATCH 2/2] drm/i915: Fix reason for per-chip disabling of FBC

Quoted 5 lines · Damien Lespiau

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

Quoted 7 lines

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.

Queued for -next, thanks for the patch. Aside: checkpatch suggests an s/seq_printf/seq_puts/ here ...
-Daniel

Quoted 72 lines
---
 drivers/gpu/drm/i915/i915_debugfs.c |  3 +++
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_pm.c     | 14 ++++++--------
 3 files changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +3 -0
index d4e78b6..4dcaee3 100644
@@ -1469,6 +1469,9 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
 		case FBC_MODULE_PARAM:
 			seq_printf(m, "disabled per module param (default off)");
 			break;
+		case FBC_CHIP_DEFAULT:
+			seq_printf(m, "disabled per chip default");
+			break;
 		default:
 			seq_printf(m, "unknown reason");
 		}
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 10a56c9..2b8b7ac 100644
@@ -543,6 +543,7 @@ enum no_fbc_reason {
 	FBC_NOT_TILED, /* buffer not tiled */
 	FBC_MULTIPLE_PIPES, /* more than one pipe active */
 	FBC_MODULE_PARAM,
+	FBC_CHIP_DEFAULT, /* disabled by default on this chip */
 };
 
 enum intel_pch {
drivers/gpu/drm/i915/intel_pm.c +6 -8
index a8483f5..fd70a82 100644
@@ -448,7 +448,6 @@ void intel_update_fbc(struct drm_device *dev)
 	struct drm_framebuffer *fb;
 	struct intel_framebuffer *intel_fb;
 	struct drm_i915_gem_object *obj;
-	int enable_fbc;
 	unsigned int max_hdisplay, max_vdisplay;
 
 	if (!i915_powersave)
@@ -489,14 +488,13 @@ void intel_update_fbc(struct drm_device *dev)
 	intel_fb = to_intel_framebuffer(fb);
 	obj = intel_fb->obj;
 
-	enable_fbc = i915_enable_fbc;
-	if (enable_fbc < 0) {
-		DRM_DEBUG_KMS("fbc set to per-chip default\n");
-		enable_fbc = 1;
-		if (INTEL_INFO(dev)->gen <= 7 && !IS_HASWELL(dev))
-			enable_fbc = 0;
+	if (i915_enable_fbc < 0 &&
+	    INTEL_INFO(dev)->gen <= 7 && !IS_HASWELL(dev)) {
+		DRM_DEBUG_KMS("disabled per chip default\n");
+		dev_priv->no_fbc_reason = FBC_CHIP_DEFAULT;
+		goto out_disable;
 	}
-	if (!enable_fbc) {
+	if (!i915_enable_fbc) {
 		DRM_DEBUG_KMS("fbc disabled per module param\n");
 		dev_priv->no_fbc_reason = FBC_MODULE_PARAM;
 		goto out_disable;
Signature · 6 lines
1.8.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch