[Intel-xe] [PATCH 2/4] drm/i915: abstract plane protection check

Rodrigo Vivi rodrigo.vivi at intel.com
Thu Nov 9 19:08:34 UTC 2023


On Thu, Nov 09, 2023 at 06:17:56PM +0200, Jani Nikula wrote:
> Centralize the conditions in a function.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> Link: https://patchwork.freedesktop.org/patch/msgid/20231109160722.3372379-1-jani.nikula@intel.com
> ---
>  .../gpu/drm/i915/display/skl_universal_plane.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> index a4d0e2ede2f7..c1d426dbcc62 100644
> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> @@ -1870,6 +1870,19 @@ static bool pxp_is_borked(struct drm_i915_gem_object *obj)
>  	return i915_gem_object_is_protected(obj) && !bo_has_valid_encryption(obj);
>  }
>  
> +static void check_protection(struct intel_plane_state *plane_state)

only not sure about this function name. maybe something with content_protection on it?!

but on the lack of a better suggestion:


Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
(for the series)

> +{
> +	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
> +	struct drm_i915_private *i915 = to_i915(plane->base.dev);
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +
> +	if (DISPLAY_VER(i915) < 11)
> +		return;
> +
> +	plane_state->decrypt = bo_has_valid_encryption(intel_fb_obj(fb));
> +	plane_state->force_black = pxp_is_borked(intel_fb_obj(fb));
> +}
> +
>  static int skl_plane_check(struct intel_crtc_state *crtc_state,
>  			   struct intel_plane_state *plane_state)
>  {
> @@ -1914,10 +1927,7 @@ static int skl_plane_check(struct intel_crtc_state *crtc_state,
>  	if (ret)
>  		return ret;
>  
> -	if (DISPLAY_VER(dev_priv) >= 11) {
> -		plane_state->decrypt = bo_has_valid_encryption(intel_fb_obj(fb));
> -		plane_state->force_black = pxp_is_borked(intel_fb_obj(fb));
> -	}
> +	check_protection(plane_state);
>  
>  	/* HW only has 8 bits pixel precision, disable plane if invisible */
>  	if (!(plane_state->hw.alpha >> 8))
> -- 
> 2.39.2
> 


More information about the Intel-xe mailing list