Skip to contentSkip to conversation

drm/i915: Small Fix in RC6 initialization

PATCH New Rodrigo Vivi 1 participant 2 messages Oct 24, 2012

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

PATCH 1/2 drm/i915: Small Fix in RC6 initialization

Even for other platforms RP_DOWN_IDLE_AVG is 010 and PCODE_MAILBOX[31] should be 1 when reading overclocking parameters.

---
 drivers/gpu/drm/i915/i915_reg.h | 3 +--
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -2
index 8200c31..5967e71 100644
@@ -4171,8 +4171,7 @@
 #define   GEN6_RP_UP_IDLE_MIN			(0x1<<3)
 #define   GEN6_RP_UP_BUSY_AVG			(0x2<<3)
 #define   GEN6_RP_UP_BUSY_CONT			(0x4<<3)
-#define   GEN7_RP_DOWN_IDLE_AVG			(0x2<<0)
-#define   GEN6_RP_DOWN_IDLE_CONT		(0x1<<0)
+#define   GEN6_RP_DOWN_IDLE_CONT		(0x2<<0)
 #define GEN6_RP_UP_THRESHOLD			0xA02C
 #define GEN6_RP_DOWN_THRESHOLD			0xA030
 #define GEN6_RP_CUR_UP_EI			0xA050
drivers/gpu/drm/i915/intel_pm.c +2 -2
index 07da990..50f5809 100644
@@ -2501,7 +2501,7 @@ static void gen6_enable_rps(struct drm_device *dev)
 		   GEN6_RP_MEDIA_IS_GFX |
 		   GEN6_RP_ENABLE |
 		   GEN6_RP_UP_BUSY_AVG |
-		   (IS_HASWELL(dev) ? GEN7_RP_DOWN_IDLE_AVG : GEN6_RP_DOWN_IDLE_CONT));
+		   GEN6_RP_DOWN_IDLE_CONT);
 
 	if (wait_for((I915_READ(GEN6_PCODE_MAILBOX) & GEN6_PCODE_READY) == 0,
 		     500))
@@ -2519,7 +2519,7 @@ static void gen6_enable_rps(struct drm_device *dev)
 	if (wait_for((I915_READ(GEN6_PCODE_MAILBOX) & GEN6_PCODE_READY) == 0,
 		     500))
 		DRM_ERROR("timeout waiting for pcode mailbox to become idle\n");
-	I915_WRITE(GEN6_PCODE_MAILBOX, GEN6_READ_OC_PARAMS);
+	I915_WRITE(GEN6_PCODE_MAILBOX, GEN6_PCODE_READY | GEN6_READ_OC_PARAMS);
 	pcu_mbox = I915_READ(GEN6_PCODE_DATA);
 	if (wait_for((I915_READ(GEN6_PCODE_MAILBOX) & GEN6_PCODE_READY) == 0,
 		     500))
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 2/2 drm/i915: Respect HW RC6 states availability

If Hardware doesn't allow RC6p or RC6pp we shall avoid end users turning them on, falling back to the only RC6 deepness available.

---
 drivers/gpu/drm/i915/intel_pm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +4 -1
index 50f5809..a8c6c08 100644
@@ -2370,7 +2370,7 @@ static void gen6_disable_rps(struct drm_device *dev)
 int intel_enable_rc6(const struct drm_device *dev)
 {
 	/* Respect the kernel parameter if it is set */
-	if (i915_enable_rc6 >= 0)
+	if (i915_enable_rc6 = 0)
 		return i915_enable_rc6;
 
 	if (INTEL_INFO(dev)->gen == 5) {
@@ -2394,6 +2394,9 @@ int intel_enable_rc6(const struct drm_device *dev)
 		return INTEL_RC6_ENABLE;
 	}
 
+	if (i915_enable_rc6 > 0)
+		return i915_enable_rc6;
+
 	DRM_DEBUG_DRIVER("RC6 and deep RC6 enabled\n");
 	return (INTEL_RC6_ENABLE | INTEL_RC6p_ENABLE);
 }
Signature · 1 line
1.7.11.7