Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D8E3C433FE for ; Thu, 10 Dec 2020 22:39:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B35662332A for ; Thu, 10 Dec 2020 22:39:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B35662332A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2776C6EB82; Thu, 10 Dec 2020 22:39:45 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5149289D43 for ; Thu, 10 Dec 2020 22:39:37 +0000 (UTC) IronPort-SDR: XxESA3Xnis06HwA8wlIxJ0L4adGeikBVBGGIW+ztw1Nd9BCm2ZRH6IMKVwpOy+8s5hcE0hm4IN CdNCcf8KeiQA== X-IronPort-AV: E=McAfee;i="6000,8403,9831"; a="192676668" X-IronPort-AV: E=Sophos;i="5.78,409,1599548400"; d="scan'208";a="192676668" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2020 14:39:32 -0800 IronPort-SDR: 1BwiApFKgx9pQx3/Ga6SpBS7leOMcLgG0sB8lR8kJBenNZ9vgqycQ3gEnuvE8XLxLdcC970ZlP KZ0dMyEA7QQw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,409,1599548400"; d="scan'208";a="544016932" Received: from sean-virtualbox.fm.intel.com ([10.105.158.96]) by fmsmga005.fm.intel.com with ESMTP; 10 Dec 2020 14:39:32 -0800 From: "Huang, Sean Z" To: Intel-gfx@lists.freedesktop.org Date: Thu, 10 Dec 2020 14:38:47 -0800 Message-Id: <20201210223859.23882-10-sean.z.huang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201210223859.23882-1-sean.z.huang@intel.com> References: <20201210223859.23882-1-sean.z.huang@intel.com> Subject: [Intel-gfx] [RFC-v6 09/21] drm/i915/pxp: Expose session state for display protection flip X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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 48e926363696..ce3760206b76 100644 --- a/drivers/gpu/drm/i915/pxp/intel_pxp.c +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c @@ -143,3 +143,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.id != 0 && + 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 ddcc3faa4ea3..027c0eb84a52 100644 --- a/drivers/gpu/drm/i915/pxp/intel_pxp.h +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.h @@ -37,6 +37,8 @@ struct intel_pxp { struct pxp_context ctx; }; +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); @@ -44,6 +46,7 @@ int i915_pxp_global_terminate_complete_callback(struct intel_pxp *pxp); int intel_pxp_init(struct intel_pxp *pxp); void intel_pxp_uninit(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) { @@ -67,6 +70,11 @@ static inline int intel_pxp_init(struct intel_pxp *pxp) static inline void intel_pxp_uninit(struct intel_pxp *pxp) { } + +static inline bool intel_pxp_gem_object_status(struct drm_i915_private *i915) +{ + return false; +} #endif #endif /* __INTEL_PXP_PM_H__ */ -- 2.17.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx