diff mbox series

[1/1] drm/i915: Handle the DG2 max bw properly

Message ID 20220322124308.308300-2-vinod.govindapillai@intel.com (mailing list archive)
State New, archived
Headers show
Series Handle the DG2 max bw properly | expand

Commit Message

Vinod Govindapillai March 22, 2022, 12:43 p.m. UTC
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@linux.intel.com>
cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>

Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
---
 drivers/gpu/drm/i915/display/intel_bw.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Arun R Murthy March 24, 2022, 8:39 a.m. UTC | #1
>  }
> 
> +static unsigned int dg2_max_bw(struct drm_i915_private *i915) {
> +	struct intel_bw_info *bi = &i915->max_bw[0];
> +
> +	return bi->deratedbw[0];
> +}

Would it look better to have this as a macro rather than a function?

Thanks and Regards,
Arun R Murthy
--------------------
Vinod Govindapillai March 24, 2022, 11:26 p.m. UTC | #2
On Thu, 2022-03-24 at 08:39 +0000, Murthy, Arun R wrote:
> >  }
> > 
> > +static unsigned int dg2_max_bw(struct drm_i915_private *i915) {
> > +	struct intel_bw_info *bi = &i915->max_bw[0];
> > +
> > +	return bi->deratedbw[0];
> > +}
> 
> Would it look better to have this as a macro rather than a function?

Hey Thanks for the comment! 
Ideally probably yes.. I thought the function might be better here
But in any case, actually V2 for this patch is in progress. I had abandoned that extra function
instead use value directly.

> Thanks and Regards,
> Arun R Murthy
> --------------------
diff mbox series

Patch

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);