[Intel-gfx] [PATCH 1/2] drm/i915/hdcp: add intel_atomic_state argument to hdcp_enable function
Kandpal, Suraj
suraj.kandpal at intel.com
Thu May 11 09:14:13 UTC 2023
> -----Original Message-----
> From: Jani Nikula <jani.nikula at linux.intel.com>
> Sent: Thursday, May 11, 2023 1:27 PM
> To: Kandpal, Suraj <suraj.kandpal at intel.com>; intel-
> gfx at lists.freedesktop.org
> Cc: Nautiyal, Ankit K <ankit.k.nautiyal at intel.com>; Kandpal, Suraj
> <suraj.kandpal at intel.com>
> Subject: Re: [PATCH 1/2] drm/i915/hdcp: add intel_atomic_state argument to
> hdcp_enable function
>
> On Thu, 11 May 2023, Suraj Kandpal <suraj.kandpal at intel.com> wrote:
> > Pass all the parameter in intel_encoder->enable() to intel_hdcp_enable
> > as we need intel_atomic_state later down to get acquire_ctx.
>
> You're passing connector, not encoder, though.
>
Ohh missed that will fix in the newer revision
Regards,
Suraj Kandpal
> BR,
> Jani.
>
> >
> > Cc: Jani Nikula <jani.nikula at linux.intel.com>
> > Cc: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
> > Signed-off-by: Suraj Kandpal <suraj.kandpal at intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_ddi.c | 5 +++--
> > drivers/gpu/drm/i915/display/intel_dp_mst.c | 4 ++--
> > drivers/gpu/drm/i915/display/intel_hdcp.c | 12 +++++++-----
> > drivers/gpu/drm/i915/display/intel_hdcp.h | 6 ++++--
> > 4 files changed, 16 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> > b/drivers/gpu/drm/i915/display/intel_ddi.c
> > index 29e4bfab4635..e838d56415cd 100644
> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > @@ -3264,9 +3264,10 @@ static void intel_enable_ddi(struct
> intel_atomic_state *state,
> > /* Enable hdcp if it's desired */
> > if (conn_state->content_protection ==
> > DRM_MODE_CONTENT_PROTECTION_DESIRED)
> > - intel_hdcp_enable(to_intel_connector(conn_state-
> >connector),
> > + intel_hdcp_enable(state, to_intel_connector(conn_state-
> >connector),
> > crtc_state,
> > - (u8)conn_state->hdcp_content_type);
> > + conn_state);
> > +
> > }
> >
> > static void intel_disable_ddi_dp(struct intel_atomic_state *state,
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> > b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> > index 2c49d9ab86a2..e1e040434a97 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> > @@ -800,9 +800,9 @@ static void intel_mst_enable_dp(struct
> intel_atomic_state *state,
> > /* Enable hdcp if it's desired */
> > if (conn_state->content_protection ==
> > DRM_MODE_CONTENT_PROTECTION_DESIRED)
> > - intel_hdcp_enable(to_intel_connector(conn_state-
> >connector),
> > + intel_hdcp_enable(state, to_intel_connector(conn_state-
> >connector),
> > pipe_config,
> > - (u8)conn_state->hdcp_content_type);
> > + conn_state);
> > }
> >
> > static bool intel_dp_mst_enc_get_hw_state(struct intel_encoder
> > *encoder, diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c
> > b/drivers/gpu/drm/i915/display/intel_hdcp.c
> > index 650232c4892b..1928c80cb6a2 100644
> > --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> > @@ -2330,8 +2330,10 @@ int intel_hdcp_init(struct intel_connector
> *connector,
> > return 0;
> > }
> >
> > -int intel_hdcp_enable(struct intel_connector *connector,
> > - const struct intel_crtc_state *pipe_config, u8
> content_type)
> > +int intel_hdcp_enable(struct intel_atomic_state *state,
> > + struct intel_connector *connector,
> > + const struct intel_crtc_state *pipe_config,
> > + const struct drm_connector_state *conn_state)
> > {
> > struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
> > struct intel_digital_port *dig_port =
> > intel_attached_dig_port(connector);
> > @@ -2352,7 +2354,7 @@ int intel_hdcp_enable(struct intel_connector
> *connector,
> > mutex_lock(&dig_port->hdcp_mutex);
> > drm_WARN_ON(&dev_priv->drm,
> > hdcp->value ==
> DRM_MODE_CONTENT_PROTECTION_ENABLED);
> > - hdcp->content_type = content_type;
> > + hdcp->content_type = (u8)conn_state->content_type;
> >
> > if (intel_crtc_has_type(pipe_config, INTEL_OUTPUT_DP_MST)) {
> > hdcp->cpu_transcoder = pipe_config-
> >mst_master_transcoder;
> > @@ -2483,9 +2485,9 @@ void intel_hdcp_update_pipe(struct
> intel_atomic_state *state,
> > }
> >
> > if (desired_and_not_enabled || content_protection_type_changed)
> > - intel_hdcp_enable(connector,
> > + intel_hdcp_enable(state, connector,
> > crtc_state,
> > - (u8)conn_state->hdcp_content_type);
> > + conn_state);
> > }
> >
> > void intel_hdcp_component_fini(struct drm_i915_private *dev_priv)
> > diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.h
> > b/drivers/gpu/drm/i915/display/intel_hdcp.h
> > index 8f53b0c7fe5c..6aaec4df6f6c 100644
> > --- a/drivers/gpu/drm/i915/display/intel_hdcp.h
> > +++ b/drivers/gpu/drm/i915/display/intel_hdcp.h
> > @@ -28,8 +28,10 @@ void intel_hdcp_atomic_check(struct drm_connector
> > *connector, int intel_hdcp_init(struct intel_connector *connector,
> > struct intel_digital_port *dig_port,
> > const struct intel_hdcp_shim *hdcp_shim); -int
> > intel_hdcp_enable(struct intel_connector *connector,
> > - const struct intel_crtc_state *pipe_config, u8
> content_type);
> > +int intel_hdcp_enable(struct intel_atomic_state *state,
> > + struct intel_connector *connector,
> > + const struct intel_crtc_state *pipe_config,
> > + const struct drm_connector_state *conn_state);
> > int intel_hdcp_disable(struct intel_connector *connector); void
> > intel_hdcp_update_pipe(struct intel_atomic_state *state,
> > struct intel_encoder *encoder,
>
> --
> Jani Nikula, Intel Open Source Graphics Center
More information about the Intel-gfx
mailing list