diff mbox

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

Message ID 1295378080-1907-1-git-send-email-jbarnes@virtuousgeek.org (mailing list archive)
State New, archived
Headers show

Commit Message

Jesse Barnes Jan. 18, 2011, 7:14 p.m. UTC
None
diff mbox

Patch

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 d2ef1c2..3a9fad4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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