Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Suraj Kandpal <suraj.kandpal@intel.com>,
	<intel-gfx@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 2/4] drm/xe: Use gsc_proxy_init_done to check proxy status
Date: Thu, 8 Feb 2024 16:51:06 -0800	[thread overview]
Message-ID: <db011053-eba5-4925-8e67-a052c0145f27@intel.com> (raw)
In-Reply-To: <20240207113531.1265801-3-suraj.kandpal@intel.com>



On 2/7/2024 3:35 AM, Suraj Kandpal wrote:
> Expose gsc_proxy_init_done so that we can check if gsc proxy has
> been initialized or not.
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
>   drivers/gpu/drm/xe/display/xe_hdcp_gsc.c | 25 ++++++++++++++++++++++--
>   drivers/gpu/drm/xe/xe_gsc_proxy.c        |  2 +-
>   drivers/gpu/drm/xe/xe_gsc_proxy.h        |  1 +
>   3 files changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
> index 0f11a39333e2..ca17dfbc3fe9 100644
> --- a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
> +++ b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
> @@ -5,15 +5,36 @@
>   
>   #include "i915_drv.h"
>   #include "intel_hdcp_gsc.h"
> +#include "xe_gt.h"
> +#include "xe_gsc_proxy.h"
> +#include "xe_pm.h"
>   
>   bool intel_hdcp_gsc_cs_required(struct drm_i915_private *i915)
>   {
>   	return true;
>   }
>   
> -bool intel_hdcp_gsc_check_status(struct drm_i915_private *i915)
> +bool intel_hdcp_gsc_check_status(struct xe_device *xe)

I think it'd be nice to have a prep patch to convert all the 
drm_i915_private in this file to xe_device and drop i915_drv.h, so we 
don't have the changes sprinkled through the patches.

>   {
> -	return false;
> +	struct xe_tile *tile = xe_device_get_root_tile(xe);
> +	struct xe_gt *gt = tile->media_gt;
> +	int ret = true;

why are you initializing this integer to true?

> +
> +	xe_pm_runtime_get(xe);
> +	ret = xe_force_wake_get(gt_to_fw(gt), XE_FW_GSC);
> +	if (ret) {
> +		drm_dbg_kms(&xe->drm, "failed to get forcewake to disable GSC interrupts\n");

incorrect message, this has nothing to do with interrupts.

> +		return false;
> +	}
> +
> +	if (!gsc_proxy_init_done(&gt->uc.gsc))
> +		ret = false;
> +
> +	if (!ret)
> +		xe_force_wake_put(gt_to_fw(gt), XE_FW_GSC);

Why is this conditional on !ret? you can't reach here if the _get fails 
and also you overwrite ret in the if above, so you can't use it as a 
condition here. This looks like it should just be an unconditional put.

> +	xe_pm_runtime_get(xe);

this should be a put

> +
> +	return ret;
>   }
>   
>   int intel_hdcp_gsc_init(struct drm_i915_private *i915)
> diff --git a/drivers/gpu/drm/xe/xe_gsc_proxy.c b/drivers/gpu/drm/xe/xe_gsc_proxy.c
> index 309ef80e3b95..f37f18a36209 100644
> --- a/drivers/gpu/drm/xe/xe_gsc_proxy.c
> +++ b/drivers/gpu/drm/xe/xe_gsc_proxy.c
> @@ -66,7 +66,7 @@ static inline struct xe_device *kdev_to_xe(struct device *kdev)
>   	return dev_get_drvdata(kdev);
>   }
>   
> -static bool gsc_proxy_init_done(struct xe_gsc *gsc)
> +bool gsc_proxy_init_done(struct xe_gsc *gsc)

this needs an xe_ prefix now that it is exposed.

Daniele

>   {
>   	struct xe_gt *gt = gsc_to_gt(gsc);
>   	u32 fwsts1 = xe_mmio_read32(gt, HECI_FWSTS1(MTL_GSC_HECI1_BASE));
> diff --git a/drivers/gpu/drm/xe/xe_gsc_proxy.h b/drivers/gpu/drm/xe/xe_gsc_proxy.h
> index 908f9441f093..10de5359fbb8 100644
> --- a/drivers/gpu/drm/xe/xe_gsc_proxy.h
> +++ b/drivers/gpu/drm/xe/xe_gsc_proxy.h
> @@ -11,6 +11,7 @@
>   struct xe_gsc;
>   
>   int xe_gsc_proxy_init(struct xe_gsc *gsc);
> +bool gsc_proxy_init_done(struct xe_gsc *gsc);
>   void xe_gsc_proxy_remove(struct xe_gsc *gsc);
>   int xe_gsc_proxy_start(struct xe_gsc *gsc);
>   


  reply	other threads:[~2024-02-09  0:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 11:35 [PATCH 0/4] XE HDCP Enablement Suraj Kandpal
2024-02-07 11:35 ` [PATCH 1/4] drm/i915/hdcp: Move intel_hdcp_gsc_message def away from header file Suraj Kandpal
2024-02-07 11:35 ` [PATCH 2/4] drm/xe: Use gsc_proxy_init_done to check proxy status Suraj Kandpal
2024-02-09  0:51   ` Daniele Ceraolo Spurio [this message]
2024-02-07 11:35 ` [PATCH 3/4] drm/xe/hdcp: Enable HDCP for XE Suraj Kandpal
2024-02-09  1:11   ` Daniele Ceraolo Spurio
2024-02-07 11:35 ` [PATCH 4/4] drm/xe/hdcp: Add intel_hdcp_gsc_message to Makefile Suraj Kandpal
2024-02-07 12:46 ` ✓ CI.Patch_applied: success for XE HDCP Enablement (rev3) Patchwork
2024-02-07 12:47 ` ✓ CI.checkpatch: " Patchwork
2024-02-07 12:47 ` ✓ CI.KUnit: " Patchwork
2024-02-07 12:55 ` ✓ CI.Build: " Patchwork
2024-02-07 12:55 ` ✓ CI.Hooks: " Patchwork
2024-02-07 12:56 ` ✗ CI.checksparse: warning " Patchwork
2024-02-07 13:38 ` ✓ CI.BAT: success " 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=db011053-eba5-4925-8e67-a052c0145f27@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=suraj.kandpal@intel.com \
    /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