Commit 88d0ecbd authored by Vinod Govindapillai's avatar Vinod Govindapillai Committed by Radhakrishna Sripada

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: default avatarVinod Govindapillai <vinod.govindapillai@intel.com>
Reviewed-by: default avatarStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: default avatarRadhakrishna Sripada <radhakrishna.sripada@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230606093509.221709-4-vinod.govindapillai@intel.com
parent 39bea0ff
...@@ -534,10 +534,14 @@ static int tgl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel ...@@ -534,10 +534,14 @@ static int tgl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel
bi->deratedbw[j] = min(maxdebw, bi->deratedbw[j] = min(maxdebw,
bw * (100 - sa->derating) / 100); bw * (100 - sa->derating) / 100);
bi->peakbw[j] = DIV_ROUND_CLOSEST(sp->dclk *
num_channels *
qi.channel_width, 8);
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"BW%d / QGV %d: num_planes=%d deratedbw=%u\n", "BW%d / QGV %d: num_planes=%d deratedbw=%u peakbw: %u\n",
i, j, bi->num_planes, bi->deratedbw[j]); i, j, bi->num_planes, bi->deratedbw[j],
bi->peakbw[j]);
} }
for (j = 0; j < qi.num_psf_points; j++) { for (j = 0; j < qi.num_psf_points; j++) {
......
...@@ -314,6 +314,8 @@ struct intel_display { ...@@ -314,6 +314,8 @@ struct intel_display {
unsigned int deratedbw[I915_NUM_QGV_POINTS]; unsigned int deratedbw[I915_NUM_QGV_POINTS];
/* for each PSF GV point */ /* for each PSF GV point */
unsigned int psf_bw[I915_NUM_PSF_GV_POINTS]; 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_qgv_points;
u8 num_psf_gv_points; u8 num_psf_gv_points;
u8 num_planes; u8 num_planes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment