Re: [PATCH v2 05/12] drm/i915: Fix DRAM size reporting for BXT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 26 Feb 2019, Ville Syrjala <ville.syrjala@xxxxxxxxxxxxxxx> wrote:
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
>
> 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)
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index f948d475bdf4..08fb1b1502a0 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1291,9 +1291,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;

I wouldn't object to {bxt,skl}_get_dimm_size() having a comment about
the unit. Also wouldn't object to renaming the BXT_DRAM_SIZE_<N>GB
macros to GBIT. Even Gb vs. GB seems too subtle at times.

Anyway,

Reviewed-by: Jani Nikula <jani.nikula@xxxxxxxxx>



>  }
>  
>  static int

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux