Skip to content

Commit

Permalink
drm/i915/dram: Consolidate logging of DRAM type
Browse files Browse the repository at this point in the history
Instead of logging the dram type in the per version/platform function,
do it in the generic one. This fixes a few discrepancies depending on
the platform:

	- There was no DRAM type logging for graphics version 12 and
	  above
	- For graphics version 11, it would log the DRAM type in
	  skl_get_dram_info(), but could possibly override it later
	  without any log in icl_pcode_read_mem_global_info()

For bxt_get_dram_info(), there's no need to log the type for each dimm,
as the drm_WARN_ON() already covers the case they are not all the same.

This maintains the behavior of skl_get_dram_info() that would log the
DRAM type even on failures.

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20250324-dram-type-v1-2-bf60ef33ac01@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
  • Loading branch information
Lucas De Marchi committed Mar 31, 2025
1 parent 8d4bd9b commit 930af58
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/gpu/drm/i915/soc/intel_dram.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,6 @@ skl_get_dram_info(struct drm_i915_private *i915)
int ret;

dram_info->type = skl_get_dram_type(i915);
drm_dbg_kms(&i915->drm, "DRAM type: %s\n",
intel_dram_type_str(dram_info->type));

ret = skl_dram_get_channels_info(i915);
if (ret)
Expand Down Expand Up @@ -566,10 +564,9 @@ static int bxt_get_dram_info(struct drm_i915_private *i915)
dram_info->type != type);

drm_dbg_kms(&i915->drm,
"CH%u DIMM size: %u Gb, width: X%u, ranks: %u, type: %s\n",
"CH%u DIMM size: %u Gb, width: X%u, ranks: %u\n",
i - BXT_D_CR_DRP0_DUNIT_START,
dimm.size, dimm.width, dimm.ranks,
intel_dram_type_str(type));
dimm.size, dimm.width, dimm.ranks);

if (valid_ranks == 0)
valid_ranks = dimm.ranks;
Expand Down Expand Up @@ -736,6 +733,10 @@ void intel_dram_detect(struct drm_i915_private *i915)
ret = bxt_get_dram_info(i915);
else
ret = skl_get_dram_info(i915);

drm_dbg_kms(&i915->drm, "DRAM type: %s\n",
intel_dram_type_str(dram_info->type));

if (ret)
return;

Expand Down

0 comments on commit 930af58

Please sign in to comment.