[Intel-gfx] [PATCH] drm/i915/hdcp: Check if media_gt exists

Nautiyal, Ankit K ankit.k.nautiyal at intel.com
Wed May 3 09:41:08 UTC 2023


On 5/3/2023 7:07 AM, Suraj Kandpal wrote:
> Check if media_gt exists if we are using gsc cs
>
> --v2
> -correct typo [Ankit]
> -assign gsc variable if gt exists [Ankit]
>
> Cc: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
> Signed-off-by: Suraj Kandpal <suraj.kandpal at intel.com>
> Reviewed-by: Gustavo Sousa <gustavo.sousa at intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_hdcp.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index 650232c4892b..a7faafd1dcc5 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -205,7 +205,7 @@ bool intel_hdcp2_capable(struct intel_connector *connector)
>   	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
>   	struct intel_hdcp *hdcp = &connector->hdcp;
>   	struct intel_gt *gt = dev_priv->media_gt;
> -	struct intel_gsc_uc *gsc = &gt->uc.gsc;
> +	struct intel_gsc_uc *gsc;
>   	bool capable = false;
>   
>   	/* I915 support for HDCP2.2 */
> @@ -213,9 +213,11 @@ bool intel_hdcp2_capable(struct intel_connector *connector)
>   		return false;
>   
>   	/* If MTL+ make sure gsc is loaded and proxy is setup */
> -	if (intel_hdcp_gsc_cs_required(dev_priv))
> -		if (!intel_uc_fw_is_running(&gsc->fw))
> +	if (intel_hdcp_gsc_cs_required(dev_priv)) {

The variables, gt and gsc are used in this block only, so lets declare 
them here.

I think it would be good to add fixes tag.

Regards,

Ankit

> +		gsc = gt ? &gt->uc.gsc : NULL;
> +		if (!gsc || !intel_uc_fw_is_running(&gsc->fw))
>   			return false;
> +	}
>   
>   	/* MEI/GSC interface is solid depending on which is used */
>   	mutex_lock(&dev_priv->display.hdcp.comp_mutex);


More information about the Intel-gfx mailing list