On Tue, 02 Sep 2025, Ville Syrjala <ville.syrj...@linux.intel.com> wrote: > From: Ville Syrjälä <ville.syrj...@linux.intel.com> > > 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.syrj...@linux.intel.com>
Yeah, I dropped the ball at around here with my previous refactorings. Reviewed-by: Jani Nikula <jani.nik...@intel.com> > --- > drivers/gpu/drm/i915/soc/intel_dram.c | 10 ++++++---- > drivers/gpu/drm/i915/soc/intel_dram.h | 1 + > 2 files changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/soc/intel_dram.c > b/drivers/gpu/drm/i915/soc/intel_dram.c > index 3eb748ab44d9..7d8b8f81e215 100644 > --- a/drivers/gpu/drm/i915/soc/intel_dram.c > +++ b/drivers/gpu/drm/i915/soc/intel_dram.c > @@ -35,6 +35,7 @@ static const char *intel_dram_type_str(enum intel_dram_type > type) > { > static const char * const str[] = { > DRAM_TYPE_STR(UNKNOWN), > + DRAM_TYPE_STR(DDR2), > DRAM_TYPE_STR(DDR3), > DRAM_TYPE_STR(DDR4), > DRAM_TYPE_STR(LPDDR3), > @@ -55,9 +56,10 @@ static const char *intel_dram_type_str(enum > intel_dram_type type) > > #undef DRAM_TYPE_STR > > -static bool pnv_is_ddr3(struct drm_i915_private *i915) > +static enum intel_dram_type pnv_dram_type(struct drm_i915_private *i915) > { > - return intel_uncore_read(&i915->uncore, CSHRDDR3CTL) & CSHRDDR3CTL_DDR3; > + return intel_uncore_read(&i915->uncore, CSHRDDR3CTL) & CSHRDDR3CTL_DDR3 > ? > + INTEL_DRAM_DDR3 : INTEL_DRAM_DDR2; > } > > 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 > if (dram_info->mem_freq) > drm_dbg(&i915->drm, "DDR speed: %d kHz\n", dram_info->mem_freq); > > - if (IS_PINEVIEW(i915) && pnv_is_ddr3(i915)) > - dram_info->type = INTEL_DRAM_DDR3; > + if (IS_PINEVIEW(i915)) > + dram_info->type = pnv_dram_type(i915); > > return 0; > } > diff --git a/drivers/gpu/drm/i915/soc/intel_dram.h > b/drivers/gpu/drm/i915/soc/intel_dram.h > index 97d21894abdc..7e3b3d961fcb 100644 > --- a/drivers/gpu/drm/i915/soc/intel_dram.h > +++ b/drivers/gpu/drm/i915/soc/intel_dram.h > @@ -17,6 +17,7 @@ struct dram_info { > bool symmetric_memory; > enum intel_dram_type { > INTEL_DRAM_UNKNOWN, > + INTEL_DRAM_DDR2, > INTEL_DRAM_DDR3, > INTEL_DRAM_DDR4, > INTEL_DRAM_LPDDR3, -- Jani Nikula, Intel