Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH 08/11] drm/i915/bw: Move peakbw[] out from the plane group
Date: Thu, 28 May 2026 13:34:55 +0300	[thread overview]
Message-ID: <20260528103458.18069-9-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260528103458.18069-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The peak bandwidth doesn't depend on the number of planes,
so there is no need to repeat the same information for each
plane group.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bw.c       | 24 ++++++++++++-------
 .../gpu/drm/i915/display/intel_display_core.h |  4 ++--
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
index ef86fac8e664..59df01b8ad7c 100644
--- a/drivers/gpu/drm/i915/display/intel_bw.c
+++ b/drivers/gpu/drm/i915/display/intel_bw.c
@@ -666,15 +666,21 @@ static int tgl_get_bw_info(struct intel_display *display,
 
 			bi->deratedbw[j] = min(maxdebw,
 					       bw * (100 - soc_bw_params->derating) / 100);
-			bi->peakbw[j] = tgl_peakbw(num_channels, qi.channel_width, sp->dclk);
 
 			drm_dbg_kms(display->drm,
-				    "BW%d / QGV %d: num_planes=%d deratedbw=%u peakbw: %u\n",
-				    i, j, bi->num_planes, bi->deratedbw[j],
-				    bi->peakbw[j]);
+				    "BW%d / QGV %d: num_planes=%d deratedbw=%u\n",
+				    i, j, bi->num_planes, bi->deratedbw[j]);
 		}
 	}
 
+	for (i = 0; i < qi.num_qgv_points; i++) {
+		const struct intel_qgv_point *sp = &qi.points[i];
+
+		display->bw.peakbw[i] = tgl_peakbw(num_channels, qi.channel_width, sp->dclk);
+
+		drm_dbg_kms(display->drm, "QGV %d: peakbw=%u\n", i, display->bw.peakbw[i]);
+	}
+
 	for (i = 0; i < qi.num_psf_points; i++) {
 		const struct intel_psf_gv_point *sp = &qi.psf_points[i];
 
@@ -741,11 +747,11 @@ static int xe2_hpd_get_bw_info(struct intel_display *display,
 
 		display->bw.max[0].deratedbw[i] =
 			min(maxdebw, (100 - soc_bw_params->derating) * bw / 100);
-		display->bw.max[0].peakbw[i] = bw;
 
-		drm_dbg_kms(display->drm, "QGV %d: deratedbw=%u peakbw: %u\n",
-			    i, display->bw.max[0].deratedbw[i],
-			    display->bw.max[0].peakbw[i]);
+		display->bw.peakbw[i] = bw;
+
+		drm_dbg_kms(display->drm, "QGV %d: deratedbw=%u peakbw=%u\n",
+			    i, display->bw.max[0].deratedbw[i], display->bw.peakbw[i]);
 	}
 
 	/* Bandwidth does not depend on # of planes; set all groups the same */
@@ -1110,7 +1116,7 @@ static int mtl_find_qgv_points(struct intel_display *display,
 
 		if (max_data_rate - data_rate < best_rate) {
 			best_rate = max_data_rate - data_rate;
-			qgv_peak_bw = display->bw.max[bw_index].peakbw[i];
+			qgv_peak_bw = display->bw.peakbw[i];
 		}
 
 		drm_dbg_kms(display->drm, "QGV point %d: max bw %d required %d qgv_peak_bw: %d\n",
diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
index 58cd0961031b..3c17cac1eb97 100644
--- a/drivers/gpu/drm/i915/display/intel_display_core.h
+++ b/drivers/gpu/drm/i915/display/intel_display_core.h
@@ -325,12 +325,12 @@ struct intel_display {
 		struct intel_bw_info {
 			/* for each QGV point */
 			unsigned int deratedbw[I915_NUM_QGV_POINTS];
-			/* Peak BW for each QGV point */
-			unsigned int peakbw[I915_NUM_QGV_POINTS];
 			u8 num_planes;
 		} max[6];
 		/* for each PSF GV point */
 		unsigned int psf_bw[I915_NUM_PSF_GV_POINTS];
+		/* Peak BW for each QGV point */
+		unsigned int peakbw[I915_NUM_QGV_POINTS];
 		u8 num_qgv_points;
 		u8 num_psf_gv_points;
 	} bw;
-- 
2.53.0


  parent reply	other threads:[~2026-05-28 10:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28 10:34 [PATCH 00/11] drm/i915/bw: Cleanups Ville Syrjala
2026-05-28 10:34 ` [PATCH 01/11] drm/i915/bw: Don't memcpy() pointlessly Ville Syrjala
2026-06-01 20:54   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 02/11] drm/i915/bw: Streamline dg2_get_bw_info() Ville Syrjala
2026-06-01 21:02   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 03/11] drm/i915/bw: Initialize num_planes sensibly for the first plane group in TGL+ Ville Syrjala
2026-06-04 14:46   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 04/11] drm/i915/bw: Move 'bi_next' to tighter scope Ville Syrjala
2026-06-04 14:48   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 05/11] drn/i915/bw: s/num_points/num_qgv_points/ Ville Syrjala
2026-06-04 14:49   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 06/11] drm/i915/bw: Move num_{qgv, psf}_points out from the plane group Ville Syrjala
2026-06-04 14:53   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 07/11] drm/i915/bw: Move psf_bw[] " Ville Syrjala
2026-06-04 14:55   ` Govindapillai, Vinod
2026-05-28 10:34 ` Ville Syrjala [this message]
2026-06-04 14:57   ` [PATCH 08/11] drm/i915/bw: Move peakbw[] " Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 09/11] drm/i915/bw: Print derated bandwidth numbers for DG2 Ville Syrjala
2026-06-04 14:58   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 10/11] drm/i915/bw: Use icl_qgv_bw() Ville Syrjala
2026-06-04 14:59   ` Govindapillai, Vinod
2026-06-04 15:12     ` Ville Syrjälä
2026-06-04 15:22       ` Govindapillai, Vinod
2026-06-04 15:31         ` Ville Syrjälä
2026-06-04 15:40           ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 11/11] drm/i915/bw: Simplify the best max_data_rate search Ville Syrjala
2026-06-04 16:14   ` Govindapillai, Vinod
2026-05-28 11:58 ` ✓ i915.CI.BAT: success for drm/i915/bw: Cleanups Patchwork
2026-05-28 18:10 ` ✗ i915.CI.Full: failure " Patchwork

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=20260528103458.18069-9-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /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