[PATCH v2 2/3] drm/i915/display: Use display-specific platform checks in intel_bw.c

Ville Syrjälä ville.syrjala at linux.intel.com
Mon Feb 17 17:49:08 UTC 2025


On Mon, Feb 17, 2025 at 12:35:24PM -0300, Gustavo Sousa wrote:
> Add one step further into making intel_bw.c xe/i915 agnostic by using
> display-specific platform checks.
> 
> v2:
>   - Fix typo that resulted in converting IS_DG1(display) to
>     display->platform.dg2.
> 
> Signed-off-by: Gustavo Sousa <gustavo.sousa at intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_bw.c | 77 ++++++++++++++-----------
>  1 file changed, 43 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
> index 0fb41e6cd8ae..51b82979a8e4 100644
> --- a/drivers/gpu/drm/i915/display/intel_bw.c
> +++ b/drivers/gpu/drm/i915/display/intel_bw.c
> @@ -78,6 +78,7 @@ static int icl_pcode_read_qgv_point_info(struct drm_i915_private *dev_priv,
>  					 struct intel_qgv_point *sp,
>  					 int point)
>  {
> +	struct intel_display *display = &dev_priv->display;
>  	u32 val = 0, val2 = 0;
>  	u16 dclk;
>  	int ret;
> @@ -89,7 +90,7 @@ static int icl_pcode_read_qgv_point_info(struct drm_i915_private *dev_priv,
>  		return ret;
>  
>  	dclk = val & 0xffff;
> -	sp->dclk = DIV_ROUND_UP((16667 * dclk) + (DISPLAY_VER(dev_priv) >= 12 ? 500 : 0),
> +	sp->dclk = DIV_ROUND_UP((16667 * dclk) + (DISPLAY_VER(display) >= 12 ? 500 : 0),

Side note: could you (or someone) fix up this botched rounding stuff?

-- 
Ville Syrjälä
Intel


More information about the Intel-xe mailing list