summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2019-03-06 22:35:44 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2019-03-07 23:17:56 +0200
commit8860343cc9a7f31fa6d0fb904770924593f6c311 (patch)
tree313eb6ad87d758a9737d9370efc409b280657e73 /drivers/gpu/drm/i915/i915_drv.c
parenta62819a301d8d68d6d305adc20fbea6fbcb67a14 (diff)
downloadlinux-stable-8860343cc9a7f31fa6d0fb904770924593f6c311.tar.gz
linux-stable-8860343cc9a7f31fa6d0fb904770924593f6c311.tar.bz2
linux-stable-8860343cc9a7f31fa6d0fb904770924593f6c311.zip
drm/i915: Fix DRAM size reporting for BXT
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. v2: Deobfuscate the math (Chris) s/GB/GBIT/ in the register bit definitions (Jani) Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190306203551.24592-6-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.c')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index bba051d9f21d..a3cf74a00b3f 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1242,15 +1242,15 @@ skl_get_dram_info(struct drm_i915_private *dev_priv)
static int bxt_get_dimm_size(u32 val)
{
switch (val & BXT_DRAM_SIZE_MASK) {
- case BXT_DRAM_SIZE_4GB:
+ case BXT_DRAM_SIZE_4GBIT:
return 4;
- case BXT_DRAM_SIZE_6GB:
+ case BXT_DRAM_SIZE_6GBIT:
return 6;
- case BXT_DRAM_SIZE_8GB:
+ case BXT_DRAM_SIZE_8GBIT:
return 8;
- case BXT_DRAM_SIZE_12GB:
+ case BXT_DRAM_SIZE_12GBIT:
return 12;
- case BXT_DRAM_SIZE_16GB:
+ case BXT_DRAM_SIZE_16GBIT:
return 16;
default:
MISSING_CASE(val);
@@ -1287,9 +1287,14 @@ static int bxt_get_dimm_ranks(u32 val)
static void bxt_get_dimm_info(struct dram_dimm_info *dimm,
u32 val)
{
- dimm->size = bxt_get_dimm_size(val);
dimm->width = bxt_get_dimm_width(val);
dimm->ranks = bxt_get_dimm_ranks(val);
+
+ /*
+ * Size in register is Gb per DRAM device. Convert to total
+ * GB to match the way we report this for non-LP platforms.
+ */
+ dimm->size = bxt_get_dimm_size(val) * intel_dimm_num_devices(dimm) / 8;
}
static int