Skip to content

Commit 3a64c19

Browse files
committed
drm/i915/dram: Populate PNV memory type accurately
If PNV doesn't have DDR3 then it has DDR2. Add the appropriate memory type for it. No functional change since we currently only care about the DDR3 vs. not difference. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250902133113.18778-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
1 parent 8d87f08 commit 3a64c19

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

drivers/gpu/drm/i915/soc/intel_dram.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ static const char *intel_dram_type_str(enum intel_dram_type type)
3535
{
3636
static const char * const str[] = {
3737
DRAM_TYPE_STR(UNKNOWN),
38+
DRAM_TYPE_STR(DDR2),
3839
DRAM_TYPE_STR(DDR3),
3940
DRAM_TYPE_STR(DDR4),
4041
DRAM_TYPE_STR(LPDDR3),
@@ -55,9 +56,10 @@ static const char *intel_dram_type_str(enum intel_dram_type type)
5556

5657
#undef DRAM_TYPE_STR
5758

58-
static bool pnv_is_ddr3(struct drm_i915_private *i915)
59+
static enum intel_dram_type pnv_dram_type(struct drm_i915_private *i915)
5960
{
60-
return intel_uncore_read(&i915->uncore, CSHRDDR3CTL) & CSHRDDR3CTL_DDR3;
61+
return intel_uncore_read(&i915->uncore, CSHRDDR3CTL) & CSHRDDR3CTL_DDR3 ?
62+
INTEL_DRAM_DDR3 : INTEL_DRAM_DDR2;
6163
}
6264

6365
static unsigned int pnv_mem_freq(struct drm_i915_private *dev_priv)
@@ -252,8 +254,8 @@ static int i915_get_dram_info(struct drm_i915_private *i915, struct dram_info *d
252254
if (dram_info->mem_freq)
253255
drm_dbg(&i915->drm, "DDR speed: %d kHz\n", dram_info->mem_freq);
254256

255-
if (IS_PINEVIEW(i915) && pnv_is_ddr3(i915))
256-
dram_info->type = INTEL_DRAM_DDR3;
257+
if (IS_PINEVIEW(i915))
258+
dram_info->type = pnv_dram_type(i915);
257259

258260
return 0;
259261
}

drivers/gpu/drm/i915/soc/intel_dram.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct dram_info {
1717
bool symmetric_memory;
1818
enum intel_dram_type {
1919
INTEL_DRAM_UNKNOWN,
20+
INTEL_DRAM_DDR2,
2021
INTEL_DRAM_DDR3,
2122
INTEL_DRAM_DDR4,
2223
INTEL_DRAM_LPDDR3,

0 commit comments

Comments
 (0)