[Intel-gfx] [PATCH] drm/i915/wm: use REG_FIELD_PREP for PLANE_WM_BLOCKS_MASK

Ville Syrjälä ville.syrjala at linux.intel.com
Wed Feb 23 10:17:33 UTC 2022


On Wed, Feb 23, 2022 at 12:10:23PM +0200, Jani Nikula wrote:
> Use REG_FIELD_PREP for completeness, and to avoid bitwise operations
> with different sizes.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 5af16ca4dabd..3411ebaa767f 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -5930,7 +5930,7 @@ static void skl_write_wm_level(struct drm_i915_private *dev_priv,
>  		val |= PLANE_WM_EN;
>  	if (level->ignore_lines)
>  		val |= PLANE_WM_IGNORE_LINES;
> -	val |= level->blocks;
> +	val |= REG_FIELD_PREP(PLANE_WM_BLOCKS_MASK, level->blocks);
>  	val |= REG_FIELD_PREP(PLANE_WM_LINES_MASK, level->lines);
>  
>  	intel_de_write_fw(dev_priv, reg, val);a

skl_wm_level_from_reg_val() could use similar treatment for symmetry.

Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

> -- 
> 2.30.2

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list