[Intel-gfx] [PATCH 2/2] drm/i915/vlv: fixup DDR freq detection per Punit spec

Jesse Barnes jbarnes at virtuousgeek.org
Tue Nov 5 01:07:00 CET 2013


Either the docs were wrong or the values have changed since the old days
before we had wheels.

Reported-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_pm.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 2e7072e..71da695 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5319,15 +5319,22 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 	mutex_unlock(&dev_priv->rps.hw_lock);
 	switch ((val >> 6) & 3) {
 	case 0:
-	case 1:
 		dev_priv->mem_freq = 800;
 		break;
-	case 2:
+	case 1:
 		dev_priv->mem_freq = 1066;
 		break;
-	case 3:
+	case 2:
 		dev_priv->mem_freq = 1333;
 		break;
+	case 3:
+		/*
+		 * Probably a BIOS/Punit bug, or a new platform we don't
+		 * support yet.
+		 */
+		WARN(1, "invalid DDR freq detected, assuming 800MHz\n");
+		dev_priv->mem_freq = 800;
+		break;
 	}
 	DRM_DEBUG_DRIVER("DDR speed: %d MHz", dev_priv->mem_freq);
 
-- 
1.8.3.1




More information about the Intel-gfx mailing list