aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/display/intel_bw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_bw.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_bw.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
index 753ac3165061..7b908e10d32e 100644
--- a/drivers/gpu/drm/i915/display/intel_bw.c
+++ b/drivers/gpu/drm/i915/display/intel_bw.c
@@ -178,6 +178,8 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv)
178 clpchgroup = (sa->deburst * deinterleave / num_channels) << i; 178 clpchgroup = (sa->deburst * deinterleave / num_channels) << i;
179 bi->num_planes = (ipqdepth - clpchgroup) / clpchgroup + 1; 179 bi->num_planes = (ipqdepth - clpchgroup) / clpchgroup + 1;
180 180
181 bi->num_qgv_points = qi.num_points;
182
181 for (j = 0; j < qi.num_points; j++) { 183 for (j = 0; j < qi.num_points; j++) {
182 const struct intel_qgv_point *sp = &qi.points[j]; 184 const struct intel_qgv_point *sp = &qi.points[j];
183 int ct, bw; 185 int ct, bw;
@@ -195,7 +197,7 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv)
195 bi->deratedbw[j] = min(maxdebw, 197 bi->deratedbw[j] = min(maxdebw,
196 bw * 9 / 10); /* 90% */ 198 bw * 9 / 10); /* 90% */
197 199
198 DRM_DEBUG_KMS("BW%d / QGV %d: num_planes=%d deratedbw=%d\n", 200 DRM_DEBUG_KMS("BW%d / QGV %d: num_planes=%d deratedbw=%u\n",
199 i, j, bi->num_planes, bi->deratedbw[j]); 201 i, j, bi->num_planes, bi->deratedbw[j]);
200 } 202 }
201 203
@@ -211,14 +213,17 @@ static unsigned int icl_max_bw(struct drm_i915_private *dev_priv,
211{ 213{
212 int i; 214 int i;
213 215
214 /* Did we initialize the bw limits successfully? */
215 if (dev_priv->max_bw[0].num_planes == 0)
216 return UINT_MAX;
217
218 for (i = 0; i < ARRAY_SIZE(dev_priv->max_bw); i++) { 216 for (i = 0; i < ARRAY_SIZE(dev_priv->max_bw); i++) {
219 const struct intel_bw_info *bi = 217 const struct intel_bw_info *bi =
220 &dev_priv->max_bw[i]; 218 &dev_priv->max_bw[i];
221 219
220 /*
221 * Pcode will not expose all QGV points when
222 * SAGV is forced to off/min/med/max.
223 */
224 if (qgv_point >= bi->num_qgv_points)
225 return UINT_MAX;
226
222 if (num_planes >= bi->num_planes) 227 if (num_planes >= bi->num_planes)
223 return bi->deratedbw[qgv_point]; 228 return bi->deratedbw[qgv_point];
224 } 229 }