Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Matt Roper <matthew.d.roper@intel.com>
Subject: [PATCH 1/2] drm/i915/dram: Add missing INTEL_DRAM str conversions
Date: Mon, 24 Mar 2025 19:28:41 -0700	[thread overview]
Message-ID: <20250324-dram-type-v1-1-bf60ef33ac01@intel.com> (raw)
In-Reply-To: <20250324-dram-type-v1-0-bf60ef33ac01@intel.com>

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.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h       | 1 +
 drivers/gpu/drm/i915/soc/intel_dram.c | 6 ++++++
 drivers/gpu/drm/xe/xe_device_types.h  | 1 +
 3 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 54538b6f85df5..236c48d282e47 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -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;
diff --git a/drivers/gpu/drm/i915/soc/intel_dram.c b/drivers/gpu/drm/i915/soc/intel_dram.c
index f60eedb0e92cf..39d8520ee621d 100644
--- a/drivers/gpu/drm/i915/soc/intel_dram.c
+++ b/drivers/gpu/drm/i915/soc/intel_dram.c
@@ -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;
 
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 20239d6a2e985..fa9bc0b7d92e2 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -588,6 +588,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;

-- 
2.49.0


  reply	other threads:[~2025-03-25  2:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-25  2:28 [PATCH 0/2] drm/i915: DRAM type logging Lucas De Marchi
2025-03-25  2:28 ` Lucas De Marchi [this message]
2025-03-28 22:25   ` [PATCH 1/2] drm/i915/dram: Add missing INTEL_DRAM str conversions Matt Roper
2025-03-25  2:28 ` [PATCH 2/2] drm/i915/dram: Consolidate logging of DRAM type Lucas De Marchi
2025-03-28 22:29   ` Matt Roper
2025-03-25  2:34 ` ✓ CI.Patch_applied: success for drm/i915: DRAM type logging Patchwork
2025-03-25  2:34 ` ✓ CI.checkpatch: " Patchwork
2025-03-25  2:36 ` ✓ CI.KUnit: " Patchwork
2025-03-25  2:52 ` ✓ CI.Build: " Patchwork
2025-03-25  2:54 ` ✓ CI.Hooks: " Patchwork
2025-03-25  2:56 ` ✗ CI.checksparse: warning " Patchwork
2025-03-25  3:16 ` ✓ Xe.CI.BAT: success " Patchwork
2025-03-31 15:18 ` [PATCH 0/2] " Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250324-dram-type-v1-1-bf60ef33ac01@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=matthew.d.roper@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox