Separate the max bw call for DG2 as it has a constant bandwidth regardless of the number of planes enabled. cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> cc: Stanislav Lisovskiy <stanislav.lisovskiy@xxxxxxxxx> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@xxxxxxxxx> --- drivers/gpu/drm/i915/display/intel_bw.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c index 395e48930b08..f1e1feb8db06 100644 --- a/drivers/gpu/drm/i915/display/intel_bw.c +++ b/drivers/gpu/drm/i915/display/intel_bw.c @@ -538,6 +538,13 @@ static unsigned int tgl_max_bw(struct drm_i915_private *dev_priv, return dev_priv->max_bw[0].deratedbw[qgv_point]; } +static unsigned int dg2_max_bw(struct drm_i915_private *i915) +{ + struct intel_bw_info *bi = &i915->max_bw[0]; + + return bi->deratedbw[0]; +} + static unsigned int adl_psf_bw(struct drm_i915_private *dev_priv, int psf_gv_point) { @@ -931,7 +938,9 @@ int intel_bw_atomic_check(struct intel_atomic_state *state) for (i = 0; i < num_qgv_points; i++) { unsigned int max_data_rate; - if (DISPLAY_VER(dev_priv) > 11) + if (IS_DG2(dev_priv)) + max_data_rate = dg2_max_bw(dev_priv); + else if (DISPLAY_VER(dev_priv) > 11) max_data_rate = tgl_max_bw(dev_priv, num_active_planes, i); else max_data_rate = icl_max_bw(dev_priv, num_active_planes, i); -- 2.25.1