Skip to contentSkip to conversation

drm/i915: make the blitter report buffer modifications to the FBC unit

PATCH In review Jesse Barnes 1 participant 2 messages Jan 18, 2011

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

PATCH 1/1 drm/i915: make the blitter report buffer modifications to the FBC unit

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

References: https://bugzilla.kernel.org/show_bug.cgi?id=26932

---
 drivers/gpu/drm/i915/i915_reg.h      |    4 ++++
 drivers/gpu/drm/i915/intel_display.c |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +4 -0
index 6abb15f..5cfc689 100644
@@ -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)
drivers/gpu/drm/i915/intel_display.c +18 -0
index d2ef1c2..3a9fad4 100644
@@ -6301,6 +6301,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
Signature · 1 line
1.7.1
#1 lore raw
Quoted 8 lines · On Tue, 18 Jan 2011 11:14:40 -0800 Jesse Barnes <[email protected]>…

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

References: https://bugzilla.kernel.org/show_bug.cgi?id=26932

---
 drivers/gpu/drm/i915/i915_reg.h      |    4 ++++

Sorry, git fail, I meant to send the other one (just re-sent).

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center