Skip to content

Commit

Permalink
drm/i915/dram: Add missing INTEL_DRAM str conversions
Browse files Browse the repository at this point in the history
Some new dram types were added without adding the corresponding string
conversion, probably because it's not being used by recent platforms.
Add them, together with a BUILD_BUG_ON() to ensure it keeps in sync, in
preparation to make use of them in recent platforms.

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20250324-dram-type-v1-1-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 bee964b commit 8d4bd9b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ struct drm_i915_private {
INTEL_DRAM_LPDDR5,
INTEL_DRAM_GDDR,
INTEL_DRAM_GDDR_ECC,
__INTEL_DRAM_TYPE_MAX,
} type;
u8 num_qgv_points;
u8 num_psf_gv_points;
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/i915/soc/intel_dram.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ static const char *intel_dram_type_str(enum intel_dram_type type)
DRAM_TYPE_STR(DDR4),
DRAM_TYPE_STR(LPDDR3),
DRAM_TYPE_STR(LPDDR4),
DRAM_TYPE_STR(DDR5),
DRAM_TYPE_STR(LPDDR5),
DRAM_TYPE_STR(GDDR),
DRAM_TYPE_STR(GDDR_ECC),
};

BUILD_BUG_ON(ARRAY_SIZE(str) != __INTEL_DRAM_TYPE_MAX);

if (type >= ARRAY_SIZE(str))
type = INTEL_DRAM_UNKNOWN;

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/xe/xe_device_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ struct xe_device {
INTEL_DRAM_LPDDR5,
INTEL_DRAM_GDDR,
INTEL_DRAM_GDDR_ECC,
__INTEL_DRAM_TYPE_MAX,
} type;
u8 num_qgv_points;
u8 num_psf_gv_points;
Expand Down

0 comments on commit 8d4bd9b

Please sign in to comment.