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

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
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -534,10 +534,14 @@ static int tgl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel

			bi->deratedbw[j] = min(maxdebw,
					       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,
				    "BW%d / QGV %d: num_planes=%d deratedbw=%u\n",
				    i, j, bi->num_planes, bi->deratedbw[j]);
				    "BW%d / QGV %d: num_planes=%d deratedbw=%u peakbw: %u\n",
				    i, j, bi->num_planes, bi->deratedbw[j],
				    bi->peakbw[j]);
		}

		for (j = 0; j < qi.num_psf_points; j++) {
+2 −0
Original line number Diff line number Diff line
@@ -314,6 +314,8 @@ struct intel_display {
			unsigned int deratedbw[I915_NUM_QGV_POINTS];
			/* 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;
			u8 num_planes;