Skip to content

Commit 88d0ecb

Browse files
vgovind2Radhakrishna Sripada
authored andcommitted
drm/i915: store the peak bw per QGV point
In MTL onwards, pcode locks the GV point based on the peak BW of a QGV point. So store the peak BW of all the QGV points. v2: use DIV_ROUND_CLOSEST() for the peakBW calculation Bspec: 64636 Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com> Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230606093509.221709-4-vinod.govindapillai@intel.com
1 parent 39bea0f commit 88d0ecb

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

drivers/gpu/drm/i915/display/intel_bw.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,10 +534,14 @@ static int tgl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel
534534

535535
bi->deratedbw[j] = min(maxdebw,
536536
bw * (100 - sa->derating) / 100);
537+
bi->peakbw[j] = DIV_ROUND_CLOSEST(sp->dclk *
538+
num_channels *
539+
qi.channel_width, 8);
537540

538541
drm_dbg_kms(&dev_priv->drm,
539-
"BW%d / QGV %d: num_planes=%d deratedbw=%u\n",
540-
i, j, bi->num_planes, bi->deratedbw[j]);
542+
"BW%d / QGV %d: num_planes=%d deratedbw=%u peakbw: %u\n",
543+
i, j, bi->num_planes, bi->deratedbw[j],
544+
bi->peakbw[j]);
541545
}
542546

543547
for (j = 0; j < qi.num_psf_points; j++) {

drivers/gpu/drm/i915/display/intel_display_core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ struct intel_display {
314314
unsigned int deratedbw[I915_NUM_QGV_POINTS];
315315
/* for each PSF GV point */
316316
unsigned int psf_bw[I915_NUM_PSF_GV_POINTS];
317+
/* Peak BW for each QGV point */
318+
unsigned int peakbw[I915_NUM_QGV_POINTS];
317319
u8 num_qgv_points;
318320
u8 num_psf_gv_points;
319321
u8 num_planes;

0 commit comments

Comments
 (0)