[Intel-gfx] [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface
MTL uses GSC command streamer i.e gsc cs to send HDCP/PXP commands to GSC f/w. It requires to keep hdcp display driver agnostic to content protection f/w (ME/GSC fw) in the form of i915_hdcp_fw_ops generic ops. Adding HDCP GSC CS interface by leveraging the i915_hdcp_fw_ops generic ops instead of I915_HDCP_COMPONENT as integral part of i915. Adding checks to see if GSC is loaded and proxy is setup --v6 -dont change the license date in same patch series [Jani] -fix the license year {Jani] --v8 -remove stale comment [Ankit] -get headers in alphabetical order [Ankit] -fix hdcp2_supported check [Ankit] --v9 -remove return statement from hdcp_gsc_fini [Ankit] Cc: Tomas Winkler Cc: Rodrigo Vivi Cc: Uma Shankar Cc: Ankit Nautiyal Signed-off-by: Anshuman Gupta Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_hdcp.c | 28 +- drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 637 +- drivers/gpu/drm/i915/display/intel_hdcp_gsc.h | 3 + 3 files changed, 660 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 0d6aed1eb171..61bb2bbd0349 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -23,6 +23,7 @@ #include "intel_display_power_well.h" #include "intel_display_types.h" #include "intel_hdcp.h" +#include "intel_hdcp_gsc.h" #include "intel_hdcp_regs.h" #include "intel_pcode.h" @@ -203,13 +204,20 @@ bool intel_hdcp2_capable(struct intel_connector *connector) struct intel_digital_port *dig_port = intel_attached_dig_port(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 = >->uc.gsc; bool capable = false; /* I915 support for HDCP2.2 */ if (!hdcp->hdcp2_supported) return false; - /* MEI interface is solid */ + /* 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)) + return false; + + /* MEI/GSC interface is solid depending on which is used */ mutex_lock(&dev_priv->display.hdcp.comp_mutex); if (!dev_priv->display.hdcp.comp_added || !dev_priv->display.hdcp.master) { mutex_unlock(&dev_priv->display.hdcp.comp_mutex); @@ -2235,6 +2243,9 @@ static int initialize_hdcp_port_data(struct intel_connector *connector, static bool is_hdcp2_supported(struct drm_i915_private *dev_priv) { + if (intel_hdcp_gsc_cs_required(dev_priv)) + return true; + if (!IS_ENABLED(CONFIG_INTEL_MEI_HDCP)) return false; @@ -2256,10 +2267,14 @@ void intel_hdcp_component_init(struct drm_i915_private *dev_priv) dev_priv->display.hdcp.comp_added = true; mutex_unlock(&dev_priv->display.hdcp.comp_mutex); - ret = component_add_typed(dev_priv->drm.dev, &i915_hdcp_ops, - I915_COMPONENT_HDCP); + if (intel_hdcp_gsc_cs_required(dev_priv)) + ret = intel_hdcp_gsc_init(dev_priv); + else + ret = component_add_typed(dev_priv->drm.dev, &i915_hdcp_ops, + I915_COMPONENT_HDCP); + if (ret < 0) { - drm_dbg_kms(&dev_priv->drm, "Failed at component add(%d)\n", + drm_dbg_kms(&dev_priv->drm, "Failed at fw component add(%d)\n", ret); mutex_lock(&dev_priv->display.hdcp.comp_mutex); dev_priv->display.hdcp.comp_added = false; @@ -2486,7 +2501,10 @@ void intel_hdcp_component_fini(struct drm_i915_private *dev_priv) dev_priv->display.hdcp.comp_added = false; mutex_unlock(&dev_priv->display.hdcp.comp_mutex); - component_del(dev_priv->drm.dev, &i915_hdcp_ops); + if (intel_hdcp_gsc_cs_required(dev_priv)) + intel_hdcp_gsc_fini(dev_priv); + else + component_del(dev_priv->drm.dev, &i915_hdcp_ops); } void intel_hdcp_cleanup(struct intel_connector *connector) diff --git a/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c b/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c index 8e3b5e6733d7..7eb1eeeb5a51 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c @@ -3,12 +3,617 @@ * Copyright 2023, Intel Corporation. */ +#include + #include "display/intel_hdcp_gsc.h" #include "gem/i915_gem_region.h" #include "gt/uc/intel_gsc_uc_heci_cmd_submit.h" #include "i915_drv.h" #include "i915_utils.h" +bool intel_hdcp_gsc_cs_required(struct drm_i915_private *i915) +{ + return DISPLAY_VER(i915) >= 14; +} + +static int +gsc_hdcp_initiate_session(struct device *dev, struct hdcp_port
Re: [Intel-gfx] [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface
> -Original Message- > From: Kandpal, Suraj > Sent: Wednesday, February 1, 2023 2:38 PM > To: intel-gfx@lists.freedesktop.org > Cc: Nautiyal, Ankit K ; Kandpal, Suraj > ; Winkler, Tomas ; Vivi, > Rodrigo ; Shankar, Uma ; Gupta, > Anshuman > Subject: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > MTL uses GSC command streamer i.e gsc cs to send HDCP/PXP commands to GSC > f/w. It requires to keep hdcp display driver agnostic to content protection > f/w > (ME/GSC fw) in the form of i915_hdcp_fw_ops generic ops. > > Adding HDCP GSC CS interface by leveraging the i915_hdcp_fw_ops generic ops > instead of I915_HDCP_COMPONENT as integral part of i915. > > Adding checks to see if GSC is loaded and proxy is setup > > --v6 > -dont change the license date in same patch series [Jani] -fix the license > year {Jani] > > --v8 > -remove stale comment [Ankit] > -get headers in alphabetical order [Ankit] -fix hdcp2_supported check [Ankit] > > --v9 > -remove return statement from hdcp_gsc_fini [Ankit] Looks Good to me. Reviewed-by: Uma Shankar > Cc: Tomas Winkler > Cc: Rodrigo Vivi > Cc: Uma Shankar > Cc: Ankit Nautiyal > Signed-off-by: Anshuman Gupta > Signed-off-by: Suraj Kandpal > Reviewed-by: Ankit Nautiyal > --- > drivers/gpu/drm/i915/display/intel_hdcp.c | 28 +- > drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 637 +- > drivers/gpu/drm/i915/display/intel_hdcp_gsc.h | 3 + > 3 files changed, 660 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c > b/drivers/gpu/drm/i915/display/intel_hdcp.c > index 0d6aed1eb171..61bb2bbd0349 100644 > --- a/drivers/gpu/drm/i915/display/intel_hdcp.c > +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c > @@ -23,6 +23,7 @@ > #include "intel_display_power_well.h" > #include "intel_display_types.h" > #include "intel_hdcp.h" > +#include "intel_hdcp_gsc.h" > #include "intel_hdcp_regs.h" > #include "intel_pcode.h" > > @@ -203,13 +204,20 @@ bool intel_hdcp2_capable(struct intel_connector > *connector) > struct intel_digital_port *dig_port = > intel_attached_dig_port(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 = >->uc.gsc; > bool capable = false; > > /* I915 support for HDCP2.2 */ > if (!hdcp->hdcp2_supported) > return false; > > - /* MEI interface is solid */ > + /* 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)) > + return false; > + > + /* MEI/GSC interface is solid depending on which is used */ > mutex_lock(&dev_priv->display.hdcp.comp_mutex); > if (!dev_priv->display.hdcp.comp_added || > !dev_priv->display.hdcp.master) > { > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > @@ -2235,6 +2243,9 @@ static int initialize_hdcp_port_data(struct > intel_connector > *connector, > > static bool is_hdcp2_supported(struct drm_i915_private *dev_priv) { > + if (intel_hdcp_gsc_cs_required(dev_priv)) > + return true; > + > if (!IS_ENABLED(CONFIG_INTEL_MEI_HDCP)) > return false; > > @@ -2256,10 +2267,14 @@ void intel_hdcp_component_init(struct > drm_i915_private *dev_priv) > > dev_priv->display.hdcp.comp_added = true; > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > - ret = component_add_typed(dev_priv->drm.dev, &i915_hdcp_ops, > - I915_COMPONENT_HDCP); > + if (intel_hdcp_gsc_cs_required(dev_priv)) > + ret = intel_hdcp_gsc_init(dev_priv); > + else > + ret = component_add_typed(dev_priv->drm.dev, &i915_hdcp_ops, > + I915_COMPONENT_HDCP); > + > if (ret < 0) { > - drm_dbg_kms(&dev_priv->drm, "Failed at component add(%d)\n", > + drm_dbg_kms(&dev_priv->drm, "Failed at fw component > add(%d)\n", > ret); > mutex_lock(&dev_priv->display.hdcp.comp_mutex); > dev_priv->display.hdcp.comp_added = false; @@ -2486,7 +2501,10 > @@ void intel_hdcp_component_fini(struct drm_i915_private *dev_priv) > dev_priv->display.hdcp.comp_added = false; > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > > - component_del(dev_priv->drm.dev, &i915_hdcp_ops); > + if (intel_hdcp_gsc_cs_required(dev_priv)) > + intel_hdcp_gsc_fini(dev_priv); > + else > + component_del(dev_priv->drm.dev, &i915_hdcp_ops); > } > > void intel_hdcp_cleanup(struct intel_connector *connector) diff --git > a/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c > b/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c > index 8e3b5e6733d7..7eb1eeeb5a51 100644 > --- a/drivers/gpu/drm/i915/display/i
Re: [Intel-gfx] [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface
> -Original Message- > From: Shankar, Uma > Sent: Monday, March 6, 2023 6:05 PM > To: Kandpal, Suraj ; intel-gfx@lists.freedesktop.org > Cc: Nautiyal, Ankit K ; Winkler, Tomas > ; Vivi, Rodrigo ; Gupta, > Anshuman > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > -Original Message- > > From: Kandpal, Suraj > > Sent: Wednesday, February 1, 2023 2:38 PM > > To: intel-gfx@lists.freedesktop.org > > Cc: Nautiyal, Ankit K ; Kandpal, Suraj > > ; Winkler, Tomas ; > > Vivi, Rodrigo ; Shankar, Uma > > ; Gupta, Anshuman > > Subject: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > MTL uses GSC command streamer i.e gsc cs to send HDCP/PXP commands to > > GSC f/w. It requires to keep hdcp display driver agnostic to content > > protection f/w (ME/GSC fw) in the form of i915_hdcp_fw_ops generic ops. > > > > Adding HDCP GSC CS interface by leveraging the i915_hdcp_fw_ops > > generic ops instead of I915_HDCP_COMPONENT as integral part of i915. > > > > Adding checks to see if GSC is loaded and proxy is setup > > > > --v6 > > -dont change the license date in same patch series [Jani] -fix the > > license year {Jani] > > > > --v8 > > -remove stale comment [Ankit] > > -get headers in alphabetical order [Ankit] -fix hdcp2_supported check > > [Ankit] > > > > --v9 > > -remove return statement from hdcp_gsc_fini [Ankit] > > Looks Good to me. > Reviewed-by: Uma Shankar > > > Cc: Tomas Winkler > > Cc: Rodrigo Vivi > > Cc: Uma Shankar > > Cc: Ankit Nautiyal > > Signed-off-by: Anshuman Gupta > > Signed-off-by: Suraj Kandpal > > Reviewed-by: Ankit Nautiyal > > --- > > drivers/gpu/drm/i915/display/intel_hdcp.c | 28 +- > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 637 +- > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.h | 3 + > > 3 files changed, 660 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c > > b/drivers/gpu/drm/i915/display/intel_hdcp.c > > index 0d6aed1eb171..61bb2bbd0349 100644 > > --- a/drivers/gpu/drm/i915/display/intel_hdcp.c > > +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c > > @@ -23,6 +23,7 @@ > > #include "intel_display_power_well.h" > > #include "intel_display_types.h" > > #include "intel_hdcp.h" > > +#include "intel_hdcp_gsc.h" > > #include "intel_hdcp_regs.h" > > #include "intel_pcode.h" > > > > @@ -203,13 +204,20 @@ bool intel_hdcp2_capable(struct intel_connector > > *connector) > > struct intel_digital_port *dig_port = > > intel_attached_dig_port(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 = >->uc.gsc; > > bool capable = false; > > > > /* I915 support for HDCP2.2 */ > > if (!hdcp->hdcp2_supported) > > return false; > > > > - /* MEI interface is solid */ > > + /* 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)) > > + return false; > > + > > + /* MEI/GSC interface is solid depending on which is used */ > > mutex_lock(&dev_priv->display.hdcp.comp_mutex); > > if (!dev_priv->display.hdcp.comp_added || > > !dev_priv->display.hdcp.master) { > > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > > @@ -2235,6 +2243,9 @@ static int initialize_hdcp_port_data(struct > > intel_connector *connector, > > > > static bool is_hdcp2_supported(struct drm_i915_private *dev_priv) { > > + if (intel_hdcp_gsc_cs_required(dev_priv)) > > + return true; > > + > > if (!IS_ENABLED(CONFIG_INTEL_MEI_HDCP)) > > return false; > > > > @@ -2256,10 +2267,14 @@ void intel_hdcp_component_init(struct > > drm_i915_private *dev_priv) > > > > dev_priv->display.hdcp.comp_added = true; > > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > > - ret = component_add_typed(dev_priv->drm.dev, &i915_hdcp_ops, > > - I915_COMPONENT_HDCP); > > + if (intel_hdcp_gsc_cs_required(dev_priv)) > > + ret = intel_hdcp_gsc_init(dev_priv); > > + else > > + ret = component_add_typed(dev_priv->drm.dev, &i915_hdcp_ops, > > + I915_COMPONENT_HDCP); > > + > > if (ret < 0) { > > - drm_dbg_kms(&dev_priv->drm, "Failed at component add(%d)\n", > > + drm_dbg_kms(&dev_priv->drm, "Failed at fw component > > add(%d)\n", > > ret); > > mutex_lock(&dev_priv->display.hdcp.comp_mutex); > > dev_priv->display.hdcp.comp_added = false; @@ -2486,7 +2501,10 > @@ > > void intel_hdcp_component_fini(struct drm_i915_private *dev_priv) > > dev_priv->display.hdcp.comp_added = false; > > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > > > > - component_del(dev_priv->drm.dev, &i915_hdcp_ops)
Re: [Intel-gfx] [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface
> -Original Message- > From: Shankar, Uma > Sent: Tuesday, March 7, 2023 12:15 PM > To: Kandpal, Suraj ; intel- > g...@lists.freedesktop.org > Cc: Nautiyal, Ankit K ; Winkler, Tomas > ; Vivi, Rodrigo ; Gupta, > Anshuman > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > -Original Message- > > From: Shankar, Uma > > Sent: Monday, March 6, 2023 6:05 PM > > To: Kandpal, Suraj ; > > intel-gfx@lists.freedesktop.org > > Cc: Nautiyal, Ankit K ; Winkler, Tomas > > ; Vivi, Rodrigo ; > > Gupta, Anshuman > > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > > > > -Original Message- > > > From: Kandpal, Suraj > > > Sent: Wednesday, February 1, 2023 2:38 PM > > > To: intel-gfx@lists.freedesktop.org > > > Cc: Nautiyal, Ankit K ; Kandpal, Suraj > > > ; Winkler, Tomas ; > > > Vivi, Rodrigo ; Shankar, Uma > > > ; Gupta, Anshuman > > > > Subject: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > MTL uses GSC command streamer i.e gsc cs to send HDCP/PXP commands > > > to GSC f/w. It requires to keep hdcp display driver agnostic to > > > content protection f/w (ME/GSC fw) in the form of i915_hdcp_fw_ops > generic ops. > > > > > > Adding HDCP GSC CS interface by leveraging the i915_hdcp_fw_ops > > > generic ops instead of I915_HDCP_COMPONENT as integral part of i915. > > > > > > Adding checks to see if GSC is loaded and proxy is setup > > > > > > --v6 > > > -dont change the license date in same patch series [Jani] -fix the > > > license year {Jani] > > > > > > --v8 > > > -remove stale comment [Ankit] > > > -get headers in alphabetical order [Ankit] -fix hdcp2_supported > > > check [Ankit] > > > > > > --v9 > > > -remove return statement from hdcp_gsc_fini [Ankit] > > > > Looks Good to me. > > Reviewed-by: Uma Shankar > > > > > Cc: Tomas Winkler > > > Cc: Rodrigo Vivi > > > Cc: Uma Shankar > > > Cc: Ankit Nautiyal > > > Signed-off-by: Anshuman Gupta > > > Signed-off-by: Suraj Kandpal > > > Reviewed-by: Ankit Nautiyal > > > --- > > > drivers/gpu/drm/i915/display/intel_hdcp.c | 28 +- > > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 637 > +- > > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.h | 3 + > > > 3 files changed, 660 insertions(+), 8 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c > > > b/drivers/gpu/drm/i915/display/intel_hdcp.c > > > index 0d6aed1eb171..61bb2bbd0349 100644 > > > --- a/drivers/gpu/drm/i915/display/intel_hdcp.c > > > +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c > > > @@ -23,6 +23,7 @@ > > > #include "intel_display_power_well.h" > > > #include "intel_display_types.h" > > > #include "intel_hdcp.h" > > > +#include "intel_hdcp_gsc.h" > > > #include "intel_hdcp_regs.h" > > > #include "intel_pcode.h" > > > > > > @@ -203,13 +204,20 @@ bool intel_hdcp2_capable(struct > > > intel_connector > > > *connector) > > > struct intel_digital_port *dig_port = > intel_attached_dig_port(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 = >->uc.gsc; > > > bool capable = false; > > > > > > /* I915 support for HDCP2.2 */ > > > if (!hdcp->hdcp2_supported) > > > return false; > > > > > > - /* MEI interface is solid */ > > > + /* 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)) > > > + return false; > > > + > > > + /* MEI/GSC interface is solid depending on which is used */ > > > mutex_lock(&dev_priv->display.hdcp.comp_mutex); > > > if (!dev_priv->display.hdcp.comp_added || > > > !dev_priv->display.hdcp.master) { > > > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > > > @@ -2235,6 +2243,9 @@ static int initialize_hdcp_port_data(struct > > > intel_connector *connector, > > > > > > static bool is_hdcp2_supported(struct drm_i915_private *dev_priv) > > > { > > > + if (intel_hdcp_gsc_cs_required(dev_priv)) > > > + return true; > > > + > > > if (!IS_ENABLED(CONFIG_INTEL_MEI_HDCP)) > > > return false; > > > > > > @@ -2256,10 +2267,14 @@ void intel_hdcp_component_init(struct > > > drm_i915_private *dev_priv) > > > > > > dev_priv->display.hdcp.comp_added = true; > > > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > > > - ret = component_add_typed(dev_priv->drm.dev, &i915_hdcp_ops, > > > - I915_COMPONENT_HDCP); > > > + if (intel_hdcp_gsc_cs_required(dev_priv)) > > > + ret = intel_hdcp_gsc_init(dev_priv); > > > + else > > > + ret = component_add_typed(dev_priv->drm.dev, > &i915_hdcp_ops, > > > + I915_COMPONENT_HDCP); > > > + > > > if (ret < 0) { > > > - drm_dbg_kms(&dev_priv->drm, "Failed at component > add(%d)\n", > > > +
Re: [Intel-gfx] [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface
> -Original Message- > From: Shankar, Uma > Sent: Tuesday, March 7, 2023 12:15 PM > To: Kandpal, Suraj ; intel- > g...@lists.freedesktop.org > Cc: Nautiyal, Ankit K ; Winkler, Tomas > ; Vivi, Rodrigo ; Gupta, > Anshuman > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > -Original Message- > > From: Shankar, Uma > > Sent: Monday, March 6, 2023 6:05 PM > > To: Kandpal, Suraj ; > > intel-gfx@lists.freedesktop.org > > Cc: Nautiyal, Ankit K ; Winkler, Tomas > > ; Vivi, Rodrigo ; > > Gupta, Anshuman > > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > > > > -Original Message- > > > From: Kandpal, Suraj > > > Sent: Wednesday, February 1, 2023 2:38 PM > > > To: intel-gfx@lists.freedesktop.org > > > Cc: Nautiyal, Ankit K ; Kandpal, Suraj > > > ; Winkler, Tomas > ; > > > Vivi, Rodrigo ; Shankar, Uma > > > ; Gupta, Anshuman > > > > Subject: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > MTL uses GSC command streamer i.e gsc cs to send HDCP/PXP > commands > > > to GSC f/w. It requires to keep hdcp display driver agnostic to > > > content protection f/w (ME/GSC fw) in the form of i915_hdcp_fw_ops > generic ops. > > > > > > Adding HDCP GSC CS interface by leveraging the i915_hdcp_fw_ops > > > generic ops instead of I915_HDCP_COMPONENT as integral part of i915. > > > > > > Adding checks to see if GSC is loaded and proxy is setup > > > > > > --v6 > > > -dont change the license date in same patch series [Jani] -fix the > > > license year {Jani] > > > > > > --v8 > > > -remove stale comment [Ankit] > > > -get headers in alphabetical order [Ankit] -fix hdcp2_supported > > > check [Ankit] > > > > > > --v9 > > > -remove return statement from hdcp_gsc_fini [Ankit] > > > > Looks Good to me. > > Reviewed-by: Uma Shankar > > > > > Cc: Tomas Winkler > > > Cc: Rodrigo Vivi > > > Cc: Uma Shankar > > > Cc: Ankit Nautiyal > > > Signed-off-by: Anshuman Gupta > > > Signed-off-by: Suraj Kandpal > > > Reviewed-by: Ankit Nautiyal > > > --- > > > drivers/gpu/drm/i915/display/intel_hdcp.c | 28 +- > > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 637 > +- > > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.h | 3 + > > > 3 files changed, 660 insertions(+), 8 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c > > > b/drivers/gpu/drm/i915/display/intel_hdcp.c > > > index 0d6aed1eb171..61bb2bbd0349 100644 > > > --- a/drivers/gpu/drm/i915/display/intel_hdcp.c > > > +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c > > > @@ -23,6 +23,7 @@ > > > #include "intel_display_power_well.h" > > > #include "intel_display_types.h" > > > #include "intel_hdcp.h" > > > +#include "intel_hdcp_gsc.h" > > > #include "intel_hdcp_regs.h" > > > #include "intel_pcode.h" > > > > > > @@ -203,13 +204,20 @@ bool intel_hdcp2_capable(struct > > > intel_connector > > > *connector) > > > struct intel_digital_port *dig_port = > intel_attached_dig_port(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 = >->uc.gsc; > > > bool capable = false; > > > > > > /* I915 support for HDCP2.2 */ > > > if (!hdcp->hdcp2_supported) > > > return false; > > > > > > - /* MEI interface is solid */ > > > + /* 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)) > > > + return false; > > > + > > > + /* MEI/GSC interface is solid depending on which is used */ > > > mutex_lock(&dev_priv->display.hdcp.comp_mutex); > > > if (!dev_priv->display.hdcp.comp_added || > > > !dev_priv->display.hdcp.master) { > > > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > > > @@ -2235,6 +2243,9 @@ static int initialize_hdcp_port_data(struct > > > intel_connector *connector, > > > > > > static bool is_hdcp2_supported(struct drm_i915_private *dev_priv) > > > { > > > + if (intel_hdcp_gsc_cs_required(dev_priv)) > > > + return true; > > > + > > > if (!IS_ENABLED(CONFIG_INTEL_MEI_HDCP)) > > > return false; > > > > > > @@ -2256,10 +2267,14 @@ void intel_hdcp_component_init(struct > > > drm_i915_private *dev_priv) > > > > > > dev_priv->display.hdcp.comp_added = true; > > > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > > > - ret = component_add_typed(dev_priv->drm.dev, &i915_hdcp_ops, > > > - I915_COMPONENT_HDCP); > > > + if (intel_hdcp_gsc_cs_required(dev_priv)) > > > + ret = intel_hdcp_gsc_init(dev_priv); > > > + else > > > + ret = component_add_typed(dev_priv->drm.dev, > &i915_hdcp_ops, > > > + I915_COMPONENT_HDCP); > > > + > > > if (ret < 0) { > > > - drm_dbg_kms(&dev_priv->drm, "Failed at component > add(%d)\n", > >
Re: [Intel-gfx] [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface
> -Original Message- > From: Kandpal, Suraj > Sent: Thursday, March 9, 2023 1:22 PM > To: Shankar, Uma ; intel-gfx@lists.freedesktop.org > Cc: Nautiyal, Ankit K ; Winkler, Tomas > ; Vivi, Rodrigo ; Gupta, > Anshuman > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > -Original Message- > > From: Shankar, Uma > > Sent: Tuesday, March 7, 2023 12:15 PM > > To: Kandpal, Suraj ; intel- > > g...@lists.freedesktop.org > > Cc: Nautiyal, Ankit K ; Winkler, Tomas > > ; Vivi, Rodrigo ; > > Gupta, Anshuman > > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > > > > -Original Message- > > > From: Shankar, Uma > > > Sent: Monday, March 6, 2023 6:05 PM > > > To: Kandpal, Suraj ; > > > intel-gfx@lists.freedesktop.org > > > Cc: Nautiyal, Ankit K ; Winkler, Tomas > > > ; Vivi, Rodrigo ; > > > Gupta, Anshuman > > > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > > > > > > > > -Original Message- > > > > From: Kandpal, Suraj > > > > Sent: Wednesday, February 1, 2023 2:38 PM > > > > To: intel-gfx@lists.freedesktop.org > > > > Cc: Nautiyal, Ankit K ; Kandpal, Suraj > > > > ; Winkler, Tomas > > ; > > > > Vivi, Rodrigo ; Shankar, Uma > > > > ; Gupta, Anshuman > > > > > > Subject: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > > > MTL uses GSC command streamer i.e gsc cs to send HDCP/PXP > > commands > > > > to GSC f/w. It requires to keep hdcp display driver agnostic to > > > > content protection f/w (ME/GSC fw) in the form of i915_hdcp_fw_ops > > generic ops. > > > > > > > > Adding HDCP GSC CS interface by leveraging the i915_hdcp_fw_ops > > > > generic ops instead of I915_HDCP_COMPONENT as integral part of i915. > > > > > > > > Adding checks to see if GSC is loaded and proxy is setup > > > > > > > > --v6 > > > > -dont change the license date in same patch series [Jani] -fix the > > > > license year {Jani] > > > > > > > > --v8 > > > > -remove stale comment [Ankit] > > > > -get headers in alphabetical order [Ankit] -fix hdcp2_supported > > > > check [Ankit] > > > > > > > > --v9 > > > > -remove return statement from hdcp_gsc_fini [Ankit] > > > > > > Looks Good to me. > > > Reviewed-by: Uma Shankar > > > > > > > Cc: Tomas Winkler > > > > Cc: Rodrigo Vivi > > > > Cc: Uma Shankar > > > > Cc: Ankit Nautiyal > > > > Signed-off-by: Anshuman Gupta > > > > Signed-off-by: Suraj Kandpal > > > > Reviewed-by: Ankit Nautiyal > > > > --- > > > > drivers/gpu/drm/i915/display/intel_hdcp.c | 28 +- > > > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 637 > > +- > > > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.h | 3 + > > > > 3 files changed, 660 insertions(+), 8 deletions(-) > > > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > b/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > index 0d6aed1eb171..61bb2bbd0349 100644 > > > > --- a/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > @@ -23,6 +23,7 @@ > > > > #include "intel_display_power_well.h" > > > > #include "intel_display_types.h" > > > > #include "intel_hdcp.h" > > > > +#include "intel_hdcp_gsc.h" > > > > #include "intel_hdcp_regs.h" > > > > #include "intel_pcode.h" > > > > > > > > @@ -203,13 +204,20 @@ bool intel_hdcp2_capable(struct > > > > intel_connector > > > > *connector) > > > > struct intel_digital_port *dig_port = > > intel_attached_dig_port(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 = >->uc.gsc; > > > > bool capable = false; > > > > > > > > /* I915 support for HDCP2.2 */ > > > > if (!hdcp->hdcp2_supported) > > > > return false; > > > > > > > > - /* MEI interface is solid */ > > > > + /* 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)) > > > > + return false; > > > > + > > > > + /* MEI/GSC interface is solid depending on which is used */ > > > > mutex_lock(&dev_priv->display.hdcp.comp_mutex); > > > > if (!dev_priv->display.hdcp.comp_added || > > > > !dev_priv->display.hdcp.master) { > > > > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > > > > @@ -2235,6 +2243,9 @@ static int initialize_hdcp_port_data(struct > > > > intel_connector *connector, > > > > > > > > static bool is_hdcp2_supported(struct drm_i915_private *dev_priv) > > > > { > > > > + if (intel_hdcp_gsc_cs_required(dev_priv)) > > > > + return true; > > > > + > > > > if (!IS_ENABLED(CONFIG_INTEL_MEI_HDCP)) > > > > return false; > > > > > > > > @@ -2256,10
Re: [Intel-gfx] [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface
> -Original Message- > From: Shankar, Uma > Sent: Thursday, March 16, 2023 1:43 PM > To: Kandpal, Suraj ; intel- > g...@lists.freedesktop.org > Cc: Nautiyal, Ankit K ; Winkler, Tomas > ; Vivi, Rodrigo ; Gupta, > Anshuman > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > -Original Message- > > From: Kandpal, Suraj > > Sent: Thursday, March 9, 2023 1:22 PM > > To: Shankar, Uma ; > > intel-gfx@lists.freedesktop.org > > Cc: Nautiyal, Ankit K ; Winkler, Tomas > > ; Vivi, Rodrigo ; > > Gupta, Anshuman > > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > > > > -Original Message- > > > From: Shankar, Uma > > > Sent: Tuesday, March 7, 2023 12:15 PM > > > To: Kandpal, Suraj ; intel- > > > g...@lists.freedesktop.org > > > Cc: Nautiyal, Ankit K ; Winkler, Tomas > > > ; Vivi, Rodrigo ; > > > Gupta, Anshuman > > > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > > > > > > > > -Original Message- > > > > From: Shankar, Uma > > > > Sent: Monday, March 6, 2023 6:05 PM > > > > To: Kandpal, Suraj ; > > > > intel-gfx@lists.freedesktop.org > > > > Cc: Nautiyal, Ankit K ; Winkler, Tomas > > > > ; Vivi, Rodrigo ; > > > > Gupta, Anshuman > > > > Subject: RE: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > > > > > > > > > > > > -Original Message- > > > > > From: Kandpal, Suraj > > > > > Sent: Wednesday, February 1, 2023 2:38 PM > > > > > To: intel-gfx@lists.freedesktop.org > > > > > Cc: Nautiyal, Ankit K ; Kandpal, > > > > > Suraj ; Winkler, Tomas > > > ; > > > > > Vivi, Rodrigo ; Shankar, Uma > > > > > ; Gupta, Anshuman > > > > > > > > Subject: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > > > > > MTL uses GSC command streamer i.e gsc cs to send HDCP/PXP > > > commands > > > > > to GSC f/w. It requires to keep hdcp display driver agnostic to > > > > > content protection f/w (ME/GSC fw) in the form of > > > > > i915_hdcp_fw_ops > > > generic ops. > > > > > > > > > > Adding HDCP GSC CS interface by leveraging the i915_hdcp_fw_ops > > > > > generic ops instead of I915_HDCP_COMPONENT as integral part of > i915. > > > > > > > > > > Adding checks to see if GSC is loaded and proxy is setup > > > > > > > > > > --v6 > > > > > -dont change the license date in same patch series [Jani] -fix > > > > > the license year {Jani] > > > > > > > > > > --v8 > > > > > -remove stale comment [Ankit] > > > > > -get headers in alphabetical order [Ankit] -fix hdcp2_supported > > > > > check [Ankit] > > > > > > > > > > --v9 > > > > > -remove return statement from hdcp_gsc_fini [Ankit] > > > > > > > > Looks Good to me. > > > > Reviewed-by: Uma Shankar > > > > > > > > > Cc: Tomas Winkler > > > > > Cc: Rodrigo Vivi > > > > > Cc: Uma Shankar > > > > > Cc: Ankit Nautiyal > > > > > Signed-off-by: Anshuman Gupta > > > > > Signed-off-by: Suraj Kandpal > > > > > Reviewed-by: Ankit Nautiyal > > > > > --- > > > > > drivers/gpu/drm/i915/display/intel_hdcp.c | 28 +- > > > > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 637 > > > +- > > > > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.h | 3 + > > > > > 3 files changed, 660 insertions(+), 8 deletions(-) > > > > > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > > b/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > > index 0d6aed1eb171..61bb2bbd0349 100644 > > > > > --- a/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > > +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > > @@ -23,6 +23,7 @@ > > > > > #include "intel_display_power_well.h" > > > > > #include "intel_display_types.h" > > > > > #include "intel_hdcp.h" > > > > > +#include "intel_hdcp_gsc.h" > > > > > #include "intel_hdcp_regs.h" > > > > > #include "intel_pcode.h" > > > > > > > > > > @@ -203,13 +204,20 @@ bool intel_hdcp2_capable(struct > > > > > intel_connector > > > > > *connector) > > > > > struct intel_digital_port *dig_port = > > > intel_attached_dig_port(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 = >->uc.gsc; > > > > > bool capable = false; > > > > > > > > > > /* I915 support for HDCP2.2 */ > > > > > if (!hdcp->hdcp2_supported) > > > > > return false; > > > > > > > > > > - /* MEI interface is solid */ > > > > > + /* 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)) > > > > > + return false; > > > > > + > > > > > + /* MEI/GSC interface is solid depending on which is used */ > > > > > mutex_lock(&dev_priv->display.hdcp.comp_mutex); > > > > > if (!dev_priv->display.hdcp.comp_added || > > > > >
Re: [Intel-gfx] [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface
> > > > > > -Original Message- > > > > > > From: Kandpal, Suraj > > > > > > Sent: Wednesday, February 1, 2023 2:38 PM > > > > > > To: intel-gfx@lists.freedesktop.org > > > > > > Cc: Nautiyal, Ankit K ; Kandpal, > > > > > > Suraj ; Winkler, Tomas > > > > ; > > > > > > Vivi, Rodrigo ; Shankar, Uma > > > > > > ; Gupta, Anshuman > > > > > > > > > > Subject: [PATCH v10 6/6] drm/i915/mtl: Add HDCP GSC interface > > > > > > > > > > > > MTL uses GSC command streamer i.e gsc cs to send HDCP/PXP > > > > commands > > > > > > to GSC f/w. It requires to keep hdcp display driver agnostic > > > > > > to content protection f/w (ME/GSC fw) in the form of > > > > > > i915_hdcp_fw_ops > > > > generic ops. > > > > > > > > > > > > Adding HDCP GSC CS interface by leveraging the > > > > > > i915_hdcp_fw_ops generic ops instead of I915_HDCP_COMPONENT as > > > > > > integral part of > > i915. > > > > > > > > > > > > Adding checks to see if GSC is loaded and proxy is setup > > > > > > > > > > > > --v6 > > > > > > -dont change the license date in same patch series [Jani] -fix > > > > > > the license year {Jani] > > > > > > > > > > > > --v8 > > > > > > -remove stale comment [Ankit] > > > > > > -get headers in alphabetical order [Ankit] -fix > > > > > > hdcp2_supported check [Ankit] > > > > > > > > > > > > --v9 > > > > > > -remove return statement from hdcp_gsc_fini [Ankit] > > > > > > > > > > Looks Good to me. > > > > > Reviewed-by: Uma Shankar > > > > > > > > > > > Cc: Tomas Winkler > > > > > > Cc: Rodrigo Vivi > > > > > > Cc: Uma Shankar > > > > > > Cc: Ankit Nautiyal > > > > > > Signed-off-by: Anshuman Gupta > > > > > > Signed-off-by: Suraj Kandpal > > > > > > Reviewed-by: Ankit Nautiyal > > > > > > --- > > > > > > drivers/gpu/drm/i915/display/intel_hdcp.c | 28 +- > > > > > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 637 > > > > +- > > > > > > drivers/gpu/drm/i915/display/intel_hdcp_gsc.h | 3 + > > > > > > 3 files changed, 660 insertions(+), 8 deletions(-) > > > > > > > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > > > b/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > > > index 0d6aed1eb171..61bb2bbd0349 100644 > > > > > > --- a/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > > > +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c > > > > > > @@ -23,6 +23,7 @@ > > > > > > #include "intel_display_power_well.h" > > > > > > #include "intel_display_types.h" > > > > > > #include "intel_hdcp.h" > > > > > > +#include "intel_hdcp_gsc.h" > > > > > > #include "intel_hdcp_regs.h" > > > > > > #include "intel_pcode.h" > > > > > > > > > > > > @@ -203,13 +204,20 @@ bool intel_hdcp2_capable(struct > > > > > > intel_connector > > > > > > *connector) > > > > > > struct intel_digital_port *dig_port = > > > > intel_attached_dig_port(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 = >->uc.gsc; > > > > > > bool capable = false; > > > > > > > > > > > > /* I915 support for HDCP2.2 */ > > > > > > if (!hdcp->hdcp2_supported) > > > > > > return false; > > > > > > > > > > > > - /* MEI interface is solid */ > > > > > > + /* 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)) > > > > > > + return false; > > > > > > + > > > > > > + /* MEI/GSC interface is solid depending on which is used */ > > > > > > mutex_lock(&dev_priv->display.hdcp.comp_mutex); > > > > > > if (!dev_priv->display.hdcp.comp_added || > > > > > > !dev_priv->display.hdcp.master) { > > > > > > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > > > > > > @@ -2235,6 +2243,9 @@ static int > > > > > > initialize_hdcp_port_data(struct intel_connector *connector, > > > > > > > > > > > > static bool is_hdcp2_supported(struct drm_i915_private > > > > > > *dev_priv) { > > > > > > + if (intel_hdcp_gsc_cs_required(dev_priv)) > > > > > > + return true; > > > > > > + > > > > > > if (!IS_ENABLED(CONFIG_INTEL_MEI_HDCP)) > > > > > > return false; > > > > > > > > > > > > @@ -2256,10 +2267,14 @@ void intel_hdcp_component_init(struct > > > > > > drm_i915_private *dev_priv) > > > > > > > > > > > > dev_priv->display.hdcp.comp_added = true; > > > > > > mutex_unlock(&dev_priv->display.hdcp.comp_mutex); > > > > > > - ret = component_add_typed(dev_priv->drm.dev, > > &i915_hdcp_ops, > > > > > > - I915_COMPONENT_HDCP); > > > > > > + if (intel_hdcp_gsc_cs_required(dev_priv)) > > > > > > + ret = intel_hdcp_gsc_init(dev_priv); > > > > > > + else > > > > > > + ret = component_add_typed(dev_priv->drm.dev, > > > > &i915_hdcp_ops, > > > > > > +