Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Huang, Sean Z" <sean.z.huang@intel.com>
To: Intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [RFC-v16 09/13] drm/i915/pxp: Expose session state for display protection flip
Date: Wed, 30 Dec 2020 15:40:56 -0800	[thread overview]
Message-ID: <20201230234100.30104-10-sean.z.huang@intel.com> (raw)
In-Reply-To: <20201230234100.30104-1-sean.z.huang@intel.com>

Implement the intel_pxp_gem_object_status() to allow i915 display
querying the current PXP session state. In the design, display
should not perform protection flip on the protected buffers if
there is no PXP session alive.

Signed-off-by: Huang, Sean Z <sean.z.huang@intel.com>
---
 drivers/gpu/drm/i915/pxp/intel_pxp.c | 9 +++++++++
 drivers/gpu/drm/i915/pxp/intel_pxp.h | 8 ++++++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/pxp/intel_pxp.c
index 23d4cfc1fb1f..72f7d9d966a8 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp.c
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c
@@ -158,3 +158,12 @@ void intel_pxp_irq_handler(struct intel_pxp *pxp, u16 iir)
 	pxp->current_events |= events;
 	schedule_work(&pxp->irq_work);
 }
+
+bool intel_pxp_gem_object_status(struct drm_i915_private *i915)
+{
+	if (i915->gt.pxp.ctx.inited &&
+	    i915->gt.pxp.ctx.flag_display_hm_surface_keys)
+		return true;
+	else
+		return false;
+}
diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.h b/drivers/gpu/drm/i915/pxp/intel_pxp.h
index cdaa6ce6fdca..976baf9b08e3 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp.h
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp.h
@@ -29,6 +29,8 @@ enum pxp_protection_modes {
 	PROTECTION_MODE_ALL
 };
 
+struct drm_i915_private;
+
 #ifdef CONFIG_DRM_I915_PXP
 void intel_pxp_irq_handler(struct intel_pxp *pxp, u16 iir);
 int i915_pxp_teardown_required_callback(struct intel_pxp *pxp);
@@ -36,6 +38,7 @@ int i915_pxp_global_terminate_complete_callback(struct intel_pxp *pxp);
 
 void intel_pxp_init(struct intel_pxp *pxp);
 void intel_pxp_fini(struct intel_pxp *pxp);
+bool intel_pxp_gem_object_status(struct drm_i915_private *i915);
 #else
 static inline void intel_pxp_irq_handler(struct intel_pxp *pxp, u16 iir)
 {
@@ -58,6 +61,11 @@ static inline void intel_pxp_init(struct intel_pxp *pxp)
 static inline void intel_pxp_fini(struct intel_pxp *pxp)
 {
 }
+
+static inline bool intel_pxp_gem_object_status(struct drm_i915_private *i915)
+{
+	return false;
+}
 #endif
 
 #endif /* __INTEL_PXP_H__ */
-- 
2.17.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2020-12-30 23:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 23:40 [Intel-gfx] [RFC-v16 00/13] Introduce Intel PXP component - Mesa single session Huang, Sean Z
2020-12-30 23:40 ` [Intel-gfx] [RFC-v16 01/13] drm/i915/pxp: Introduce Intel PXP component Huang, Sean Z
2020-12-30 23:40 ` [Intel-gfx] [RFC-v16 02/13] drm/i915/pxp: set KCR reg init during the boot time Huang, Sean Z
2020-12-30 23:40 ` [Intel-gfx] [RFC-v16 03/13] drm/i915/pxp: Implement funcs to create the TEE channel Huang, Sean Z
2020-12-30 23:40 ` [Intel-gfx] [RFC-v16 04/13] drm/i915/pxp: Create the arbitrary session after boot Huang, Sean Z
2020-12-30 23:40 ` [Intel-gfx] [RFC-v16 05/13] drm/i915/pxp: Func to send hardware session termination Huang, Sean Z
2020-12-30 23:40 ` [Intel-gfx] [RFC-v16 06/13] drm/i915/pxp: Enable PXP irq worker and callback stub Huang, Sean Z
2020-12-30 23:40 ` [Intel-gfx] [RFC-v16 07/13] drm/i915/pxp: Destroy arb session upon teardown Huang, Sean Z
2020-12-30 23:40 ` [Intel-gfx] [RFC-v16 08/13] drm/i915/pxp: Enable PXP power management Huang, Sean Z
2020-12-30 23:40 ` Huang, Sean Z [this message]
2020-12-30 23:40 ` [Intel-gfx] [RFC-v16 10/13] mei: pxp: export pavp client to me client bus Huang, Sean Z
2020-12-30 23:40 ` [Intel-gfx] [RFC-v16 11/13] drm/i915/uapi: introduce drm_i915_gem_create_ext Huang, Sean Z
2020-12-30 23:40 ` [Intel-gfx] [RFC-v16 12/13] drm/i915/pxp: User interface for Protected buffer Huang, Sean Z
2020-12-30 23:41 ` [Intel-gfx] [RFC-v16 13/13] drm/i915/pxp: Add plane decryption support Huang, Sean Z
2020-12-30 23:58 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Introduce Intel PXP component - Mesa single session (rev16) Patchwork
2020-12-31  0:28 ` [Intel-gfx] ✗ Fi.CI.BAT: 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=20201230234100.30104-10-sean.z.huang@intel.com \
    --to=sean.z.huang@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