[Intel-gfx] [PATCH 05/12] drm/i915: Fix DRAM size reporting for BXT

Ville Syrjala ville.syrjala at linux.intel.com
Mon Feb 25 20:29:00 UTC 2019


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

The BXT DUNIT register tells us the size of each DRAM device
in Gb. We want to report the size of the whole DIMM in GB, so
that it matches how we report it for non-LP platforms.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 1f4a966a9727..c40a738dabd3 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1322,7 +1322,14 @@ bxt_get_dram_info(struct drm_i915_private *dev_priv)
 		width = bxt_get_dimm_width(val);
 		ranks = bxt_get_dimm_ranks(val);
 
-		DRM_DEBUG_KMS("CH%d DIMM size: % dGB, width: X%d, ranks:%d\n",
+		/*
+		 * Size in register is Gb per DRAM device.
+		 * Convert to total GB to match the way
+		 * we report this for non-LP platforms.
+		 */
+		size = size * ranks * 8 / (width ?: 1);
+
+		DRM_DEBUG_KMS("CH%d DIMM size: %d GB, width: X%d, ranks: %d\n",
 			      i - BXT_D_CR_DRP0_DUNIT_START,
 			      size, width, ranks);
 
-- 
2.19.2



More information about the Intel-gfx mailing list