Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Kasireddy <vivek.kasireddy@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>
Subject: [PATCH] drm/i915/xe2hpd: Identify the memory type for SKUs with GDDR + ECC
Date: Fri, 14 Feb 2025 13:59:44 -0800	[thread overview]
Message-ID: <20250214215944.187407-1-vivek.kasireddy@intel.com> (raw)

Some SKUs of Xe2_HPD platforms (such as BMG) have GDDR memory type
with ECC enabled. We need to identify this scenario and add a new
case in xelpdp_get_dram_info() to handle it. In addition, the
derating value needs to be adjusted accordingly to compensate for
the limited bandwidth.

Bspec: 64602
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
 drivers/gpu/drm/i915/display/intel_bw.c | 5 ++++-
 drivers/gpu/drm/i915/i915_drv.h         | 1 +
 drivers/gpu/drm/i915/soc/intel_dram.c   | 4 ++++
 drivers/gpu/drm/xe/xe_device_types.h    | 1 +
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
index 23edc81741de..b8a9651b74d3 100644
--- a/drivers/gpu/drm/i915/display/intel_bw.c
+++ b/drivers/gpu/drm/i915/display/intel_bw.c
@@ -244,6 +244,7 @@ static int icl_get_qgv_points(struct drm_i915_private *dev_priv,
 			qi->deinterleave = 4;
 			break;
 		case INTEL_DRAM_GDDR:
+		case INTEL_DRAM_GDDR_ECC:
 			qi->channel_width = 32;
 			break;
 		default:
@@ -630,9 +631,11 @@ static int xe2_hpd_get_bw_info(struct drm_i915_private *i915,
 	for (i = 0; i < qi.num_points; i++) {
 		const struct intel_qgv_point *point = &qi.points[i];
 		int bw = num_channels * (qi.channel_width / 8) * point->dclk;
+		u8 derating = i915->dram_info.type == INTEL_DRAM_GDDR_ECC ?
+				45 : sa->derating;
 
 		i915->display.bw.max[0].deratedbw[i] =
-			min(maxdebw, (100 - sa->derating) * bw / 100);
+			min(maxdebw, (100 - derating) * bw / 100);
 		i915->display.bw.max[0].peakbw[i] = bw;
 
 		drm_dbg_kms(&i915->drm, "QGV %d: deratedbw=%u peakbw: %u\n",
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ffc346379cc2..54538b6f85df 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -305,6 +305,7 @@ struct drm_i915_private {
 			INTEL_DRAM_DDR5,
 			INTEL_DRAM_LPDDR5,
 			INTEL_DRAM_GDDR,
+			INTEL_DRAM_GDDR_ECC,
 		} 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 9e310f4099f4..f60eedb0e92c 100644
--- a/drivers/gpu/drm/i915/soc/intel_dram.c
+++ b/drivers/gpu/drm/i915/soc/intel_dram.c
@@ -687,6 +687,10 @@ static int xelpdp_get_dram_info(struct drm_i915_private *i915)
 		drm_WARN_ON(&i915->drm, !IS_DGFX(i915));
 		dram_info->type = INTEL_DRAM_GDDR;
 		break;
+	case 9:
+		drm_WARN_ON(&i915->drm, !IS_DGFX(i915));
+		dram_info->type = INTEL_DRAM_GDDR_ECC;
+		break;
 	default:
 		MISSING_CASE(val);
 		return -EINVAL;
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 4656305dd45a..0921e957d784 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -575,6 +575,7 @@ struct xe_device {
 			INTEL_DRAM_DDR5,
 			INTEL_DRAM_LPDDR5,
 			INTEL_DRAM_GDDR,
+			INTEL_DRAM_GDDR_ECC,
 		} type;
 		u8 num_qgv_points;
 		u8 num_psf_gv_points;
-- 
2.47.1


             reply	other threads:[~2025-02-14 22:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14 21:59 Vivek Kasireddy [this message]
2025-02-14 23:13 ` ✓ CI.Patch_applied: success for drm/i915/xe2hpd: Identify the memory type for SKUs with GDDR + ECC Patchwork
2025-02-14 23:14 ` ✓ CI.checkpatch: " Patchwork
2025-02-14 23:15 ` ✓ CI.KUnit: " Patchwork
2025-02-14 23:31 ` ✓ CI.Build: " Patchwork
2025-02-14 23:34 ` ✓ CI.Hooks: " Patchwork
2025-02-14 23:35 ` ✓ CI.checksparse: " Patchwork
2025-02-17  6:47 ` ✓ CI.Patch_applied: success for drm/i915/xe2hpd: Identify the memory type for SKUs with GDDR + ECC (rev2) Patchwork
2025-02-17  6:48 ` ✓ CI.checkpatch: " Patchwork
2025-02-17  6:49 ` ✓ CI.KUnit: " Patchwork
2025-02-17  7:12 ` ✓ CI.Build: " Patchwork
2025-02-17  7:15 ` ✓ CI.Hooks: " Patchwork
2025-02-17  7:18 ` ✓ CI.checksparse: " Patchwork
2025-02-17  7:38 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-17  7:42 ` ✓ Xe.CI.Full: success for drm/i915/xe2hpd: Identify the memory type for SKUs with GDDR + ECC Patchwork
2025-02-17  9:06 ` ✗ Xe.CI.Full: failure for drm/i915/xe2hpd: Identify the memory type for SKUs with GDDR + ECC (rev2) Patchwork
2025-03-21  6:35 ` [PATCH] drm/i915/xe2hpd: Identify the memory type for SKUs with GDDR + ECC Lucas De Marchi
2025-03-21 22:25   ` Matt Roper

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=20250214215944.187407-1-vivek.kasireddy@intel.com \
    --to=vivek.kasireddy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --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