[PATCH v3 09/12] drm/xe/pxp: Add API to mark a BO as using PXP

Jani Nikula jani.nikula at linux.intel.com
Thu Nov 21 09:57:22 UTC 2024


On Wed, 20 Nov 2024, Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com> wrote:
> diff --git a/drivers/gpu/drm/xe/compat-i915-headers/pxp/intel_pxp.h b/drivers/gpu/drm/xe/compat-i915-headers/pxp/intel_pxp.h
> index 419e8e926f00..533bc82255b6 100644
> --- a/drivers/gpu/drm/xe/compat-i915-headers/pxp/intel_pxp.h
> +++ b/drivers/gpu/drm/xe/compat-i915-headers/pxp/intel_pxp.h
> @@ -9,6 +9,9 @@
>  #include <linux/errno.h>
>  #include <linux/types.h>
>  
> +#include "xe_bo.h"
> +#include "xe_pxp.h"
> +

Can't have this. This will include xe_bo.h and xe_pxp.h from i915
display.

Basically you can't use gem_to_xe_bo() in static inlines in headers that
get included to i915 display. It all needs to stay opaque.

BR,
Jani.

>  struct drm_gem_object;
>  struct xe_pxp;
>  
> @@ -16,7 +19,15 @@ static inline int intel_pxp_key_check(struct xe_pxp *pxp,
>  				      struct drm_gem_object *obj,
>  				      bool assign)
>  {
> -	return -ENODEV;
> +	/*
> +	 * The assign variable is used in i915 to assign the key to the BO at
> +	 * first submission time. In Xe the key is instead assigned at BO
> +	 * creation time, so the assign variable must always be false.
> +	 */
> +	if (assign)
> +		return -EINVAL;
> +
> +	return xe_pxp_key_check(pxp, gem_to_xe_bo(obj));
>  }
>  
>  #endif

-- 
Jani Nikula, Intel


More information about the Intel-xe mailing list