From: "Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>
To: Alan Previn <alan.previn.teres.alexis@intel.com>,
<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v3 6/6] drm/i915/pxp: Make intel_pxp_key_check implicitly sort PXP-owning-GT
Date: Mon, 14 Nov 2022 20:21:49 -0800 [thread overview]
Message-ID: <c08b5cba-67df-28e5-e310-e261e25c233c@intel.com> (raw)
In-Reply-To: <20221021173946.366210-7-alan.previn.teres.alexis@intel.com>
On 10/21/2022 10:39 AM, Alan Previn wrote:
> Make intel_pxp_key_check implicitly find the PXP-owning-GT.
> Callers of this function shall now pass in i915 since PXP
> is a global GPU feature. Make intel_pxp_key_check implicitly
> find the right gt to verify pxp session key establishment count
> so it's transparent to the callers.
>
> Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Daniele
> ---
> drivers/gpu/drm/i915/display/skl_universal_plane.c | 2 +-
> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 +-
> drivers/gpu/drm/i915/pxp/intel_pxp.c | 10 +++++++++-
> drivers/gpu/drm/i915/pxp/intel_pxp.h | 2 +-
> 4 files changed, 12 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 7cb713043408..04e78acbaf5f 100644
> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> @@ -1841,7 +1841,7 @@ static bool bo_has_valid_encryption(struct drm_i915_gem_object *obj)
> {
> struct drm_i915_private *i915 = to_i915(obj->base.dev);
>
> - return intel_pxp_key_check(&to_gt(i915)->pxp, obj, false) == 0;
> + return intel_pxp_key_check(i915, obj, false) == 0;
> }
>
> static bool pxp_is_borked(struct drm_i915_gem_object *obj)
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index 1160723c9d2d..23224977e003 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -868,7 +868,7 @@ static struct i915_vma *eb_lookup_vma(struct i915_execbuffer *eb, u32 handle)
> */
> if (i915_gem_context_uses_protected_content(eb->gem_context) &&
> i915_gem_object_is_protected(obj)) {
> - err = intel_pxp_key_check(&vm->gt->pxp, obj, true);
> + err = intel_pxp_key_check(vm->gt->i915, obj, true);
> if (err) {
> i915_gem_object_put(obj);
> return ERR_PTR(err);
> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/pxp/intel_pxp.c
> index c87f812ba13a..5c9a4b2c9a75 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp.c
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c
> @@ -313,10 +313,18 @@ void intel_pxp_fini_hw(struct intel_pxp *pxp)
> intel_pxp_irq_disable(pxp);
> }
>
> -int intel_pxp_key_check(struct intel_pxp *pxp,
> +int intel_pxp_key_check(struct drm_i915_private *i915,
> struct drm_i915_gem_object *obj,
> bool assign)
> {
> + struct intel_gt *gt = intel_pxp_get_owning_gt(i915);
> + struct intel_pxp *pxp;
> +
> + if (!gt)
> + return -ENODEV;
> +
> + pxp = >->pxp;
> +
> if (!intel_gtpxp_is_active(pxp))
> return -ENODEV;
>
> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.h b/drivers/gpu/drm/i915/pxp/intel_pxp.h
> index c45949bb1f7b..85c5499daba5 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp.h
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.h
> @@ -33,7 +33,7 @@ void intel_pxp_mark_termination_in_progress(struct intel_pxp *pxp);
>
> int intel_pxp_start(struct drm_i915_private *i915);
>
> -int intel_pxp_key_check(struct intel_pxp *pxp,
> +int intel_pxp_key_check(struct drm_i915_private *i915,
> struct drm_i915_gem_object *obj,
> bool assign);
>
next prev parent reply other threads:[~2022-11-15 4:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-21 17:39 [Intel-gfx] [PATCH v3 0/6] drm/i915/pxp: Prepare intel_pxp entry points for MTL Alan Previn
2022-10-21 17:39 ` [Intel-gfx] [PATCH v3 1/6] drm/i915/pxp: Make gt and pxp init/fini aware of PXP-owning-GT Alan Previn
2022-11-15 4:00 ` Ceraolo Spurio, Daniele
2022-11-15 5:10 ` Teres Alexis, Alan Previn
2022-11-16 21:41 ` Teres Alexis, Alan Previn
2022-10-21 17:39 ` [Intel-gfx] [PATCH v3 2/6] drm/i915/pxp: Make intel_pxp_is_enabled implicitly sort PXP-owning-GT Alan Previn
2022-11-15 4:11 ` Ceraolo Spurio, Daniele
2022-11-15 5:23 ` Teres Alexis, Alan Previn
2022-10-21 17:39 ` [Intel-gfx] [PATCH v3 3/6] drm/i915/pxp: Make intel_pxp_is_active " Alan Previn
2022-11-15 4:17 ` Ceraolo Spurio, Daniele
2022-11-15 5:26 ` Teres Alexis, Alan Previn
2022-10-21 17:39 ` [Intel-gfx] [PATCH v3 4/6] drm/i915/pxp: Make PXP tee component bind/unbind aware of PXP-owning-GT Alan Previn
2022-11-15 4:19 ` Ceraolo Spurio, Daniele
2022-10-21 17:39 ` [Intel-gfx] [PATCH v3 5/6] drm/i915/pxp: Make intel_pxp_start implicitly sort PXP-owning-GT Alan Previn
2022-11-15 4:20 ` Ceraolo Spurio, Daniele
2022-10-21 17:39 ` [Intel-gfx] [PATCH v3 6/6] drm/i915/pxp: Make intel_pxp_key_check " Alan Previn
2022-11-15 4:21 ` Ceraolo Spurio, Daniele [this message]
2022-10-21 18:34 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/pxp: Prepare intel_pxp entry points for MTL (rev3) Patchwork
2022-10-22 11:44 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c08b5cba-67df-28e5-e310-e261e25c233c@intel.com \
--to=daniele.ceraolospurio@intel.com \
--cc=alan.previn.teres.alexis@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox