[Intel-gfx] [PATCH 2/2] drm/i915: make the blitter report buffer modifications to the FBC unit

Jesse Barnes jbarnes at virtuousgeek.org
Mon Jan 17 22:35:58 CET 2011


Without this change, blits to the front buffer won't invalidate FBC
state, causing us to scan out stale data.

Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_reg.h      |    4 ++++
 drivers/gpu/drm/i915/intel_display.c |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 6abb15f..5cfc689 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -513,6 +513,10 @@
 #define   GEN6_BLITTER_SYNC_STATUS			(1 << 24)
 #define   GEN6_BLITTER_USER_INTERRUPT			(1 << 22)
 
+#define GEN6_BLITTER_ECOSKPD	0x221d0
+#define   GEN6_BLITTER_LOCK_SHIFT			16
+#define   GEN6_BLITTER_FBC_NOTIFY			(1<<3)
+
 #define GEN6_BSD_SLEEP_PSMI_CONTROL	0x12050
 #define   GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_MODIFY_MASK	(1 << 16)
 #define   GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_DISABLE		(1 << 0)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 0ad9499..6fc6328 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6296,6 +6296,24 @@ void intel_enable_clock_gating(struct drm_device *dev)
 
 		I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate);
 
+		if (IS_GEN6(dev)) {
+			u32 blt_ecoskpd;
+
+			/* Make sure blitter notifies FBC of writes */
+			__gen6_force_wake_get(dev_priv);
+			blt_ecoskpd = I915_READ(GEN6_BLITTER_ECOSKPD);
+			blt_ecoskpd |= GEN6_BLITTER_FBC_NOTIFY <<
+				GEN6_BLITTER_LOCK_SHIFT;
+			I915_WRITE(GEN6_BLITTER_ECOSKPD, blt_ecoskpd);
+			blt_ecoskpd |= GEN6_BLITTER_FBC_NOTIFY;
+			I915_WRITE(GEN6_BLITTER_ECOSKPD, blt_ecoskpd);
+			blt_ecoskpd &= ~(GEN6_BLITTER_FBC_NOTIFY <<
+					 GEN6_BLITTER_LOCK_SHIFT);
+			I915_WRITE(GEN6_BLITTER_ECOSKPD, blt_ecoskpd);
+			POSTING_READ(GEN6_BLITTER_ECOSKPD);
+			__gen6_force_wake_put(dev_priv);
+		}
+
 		/*
 		 * On Ibex Peak and Cougar Point, we need to disable clock
 		 * gating for the panel power sequencer or it will fail to
-- 
1.7.1




More information about the Intel-gfx mailing list