From: Jani Nikula <jani.nikula@linux.intel.com>
To: Suraj Kandpal <suraj.kandpal@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915/hdcp: Create a blanket hdcp enable function
Date: Thu, 26 Oct 2023 13:03:57 +0300 [thread overview]
Message-ID: <875y2t8zua.fsf@intel.com> (raw)
In-Reply-To: <20231026093647.987267-4-suraj.kandpal@intel.com>
On Thu, 26 Oct 2023, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> Let's create a blanket function which just has some conditions
> which need to be checked before connectors enable hdcp.
> This cleans up code and avoids code duplication.
This series has two 2/3 patches... confused me, probably going to
confuse CI too...
BR,
Jani.
>
> --v3
> -Keep function name as intel_hdcp_enable() [Jani]
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_ddi.c | 5 +----
> drivers/gpu/drm/i915/display/intel_dp_mst.c | 5 +----
> drivers/gpu/drm/i915/display/intel_hdcp.c | 21 ++++++++++++++++-----
> drivers/gpu/drm/i915/display/intel_hdcp.h | 8 ++++----
> 4 files changed, 22 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 9151d5add960..b644cf981846 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -3259,10 +3259,7 @@ static void intel_enable_ddi(struct intel_atomic_state *state,
> else
> intel_enable_ddi_dp(state, encoder, crtc_state, conn_state);
>
> - /* Enable hdcp if it's desired */
> - if (conn_state->content_protection ==
> - DRM_MODE_CONTENT_PROTECTION_DESIRED)
> - intel_hdcp_enable(state, encoder, crtc_state, conn_state);
> + intel_hdcp_enable(state, encoder, crtc_state, 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 7b4628f4f124..4366da79fe81 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -836,10 +836,7 @@ static void intel_mst_enable_dp(struct intel_atomic_state *state,
>
> intel_audio_codec_enable(encoder, pipe_config, conn_state);
>
> - /* Enable hdcp if it's desired */
> - if (conn_state->content_protection ==
> - DRM_MODE_CONTENT_PROTECTION_DESIRED)
> - intel_hdcp_enable(state, encoder, pipe_config, conn_state);
> + intel_hdcp_enable(state, encoder, pipe_config, 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 7c0cfcb48521..44c0a93f3af8 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -2324,10 +2324,10 @@ intel_hdcp_set_streams(struct intel_digital_port *dig_port,
> return 0;
> }
>
> -int intel_hdcp_enable(struct intel_atomic_state *state,
> - struct intel_encoder *encoder,
> - const struct intel_crtc_state *pipe_config,
> - const struct drm_connector_state *conn_state)
> +static int _intel_hdcp_enable(struct intel_atomic_state *state,
> + struct intel_encoder *encoder,
> + const struct intel_crtc_state *pipe_config,
> + const struct drm_connector_state *conn_state)
> {
> struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> struct intel_connector *connector =
> @@ -2404,6 +2404,17 @@ int intel_hdcp_enable(struct intel_atomic_state *state,
> return ret;
> }
>
> +void intel_hdcp_enable(struct intel_atomic_state *state,
> + struct intel_encoder *encoder,
> + const struct intel_crtc_state *crtc_state,
> + const struct drm_connector_state *conn_state)
> +{
> + /* Enable hdcp if it's desired */
> + if (conn_state->content_protection ==
> + DRM_MODE_CONTENT_PROTECTION_DESIRED)
> + _intel_hdcp_enable(state, encoder, crtc_state, conn_state);
> +}
> +
> int intel_hdcp_disable(struct intel_connector *connector)
> {
> struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
> @@ -2491,7 +2502,7 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
> }
>
> if (desired_and_not_enabled || content_protection_type_changed)
> - intel_hdcp_enable(state, encoder, crtc_state, conn_state);
> + _intel_hdcp_enable(state, encoder, crtc_state, conn_state);
> }
>
> void intel_hdcp_component_fini(struct drm_i915_private *i915)
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.h b/drivers/gpu/drm/i915/display/intel_hdcp.h
> index 5997c52a0958..a9c784fd9ba5 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.h
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.h
> @@ -28,10 +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_atomic_state *state,
> - struct intel_encoder *encoder,
> - const struct intel_crtc_state *pipe_config,
> - const struct drm_connector_state *conn_state);
> +void intel_hdcp_enable(struct intel_atomic_state *state,
> + struct intel_encoder *encoder,
> + 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
next prev parent reply other threads:[~2023-10-26 10:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 9:36 [Intel-gfx] [PATCH 0/3] drm/i915/hdcp: Additional conditions to enable hdcp Suraj Kandpal
2023-10-26 9:36 ` [Intel-gfx] [PATCH 1/3] drm/i915/hdcp: Rename HCDP 1.4 enablement function Suraj Kandpal
2023-10-26 9:36 ` [Intel-gfx] [PATCH 2/3] drm/i915/hdcp: Convert intel_hdcp_enable to a blanket function Suraj Kandpal
2023-10-26 9:36 ` [Intel-gfx] [PATCH 2/3] drm/i915/hdcp: Create a blanket hdcp enable function Suraj Kandpal
2023-10-26 10:03 ` Jani Nikula [this message]
2023-10-26 12:10 ` Kandpal, Suraj
2023-10-26 9:36 ` [Intel-gfx] [PATCH 3/3] drm/i915/hdcp: Add more conditions to enable hdcp Suraj Kandpal
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=875y2t8zua.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.