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] drm/i915/hdcp: Additional conditions to enable hdcp
Date: Wed, 25 Oct 2023 14:32:46 +0300 [thread overview]
Message-ID: <87ttqf7x9d.fsf@intel.com> (raw)
In-Reply-To: <20231025083338.929123-1-suraj.kandpal@intel.com>
On Wed, 25 Oct 2023, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> When we dock a monitor we end up with a enable and disable connector
> cycle but if hdcp content is running we get the userspace in
> enabled state and driver maintaing a undesired state which causes
> the content to stop playing and we only enabe hdcp if the userspace
> state in desired. This patch fixes that.
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_ddi.c | 14 ++++++++++++--
> drivers/gpu/drm/i915/display/intel_dp_mst.c | 11 +++++++++--
> 2 files changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 9151d5add960..3dbf2d545f24 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -3242,6 +3242,10 @@ static void intel_enable_ddi(struct intel_atomic_state *state,
> const struct intel_crtc_state *crtc_state,
> const struct drm_connector_state *conn_state)
> {
> + struct intel_connector *connector =
> + to_intel_connector(conn_state->connector);
> + struct intel_hdcp *hdcp = &connector->hdcp;
> +
> drm_WARN_ON(state->base.dev, crtc_state->has_pch_encoder);
>
> if (!intel_crtc_is_bigjoiner_slave(crtc_state))
> @@ -3259,9 +3263,15 @@ 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 */
> + /*
> + * Enable hdcp if it's desired or if userspace is enabled and
> + * driver set its state to undesired
> + */
> if (conn_state->content_protection ==
> - DRM_MODE_CONTENT_PROTECTION_DESIRED)
> + DRM_MODE_CONTENT_PROTECTION_DESIRED ||
> + (conn_state->content_protection ==
> + DRM_MODE_CONTENT_PROTECTION_ENABLED && hdcp->value ==
> + DRM_MODE_CONTENT_PROTECTION_UNDESIRED))
Why don't we move all of this inside intel_hdcp.c to not pollute
intel_ddi.c with the logic?
> intel_hdcp_enable(state, encoder, crtc_state, conn_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..008ff14fad18 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -788,6 +788,7 @@ static void intel_mst_enable_dp(struct intel_atomic_state *state,
> struct intel_digital_port *dig_port = intel_mst->primary;
> struct intel_dp *intel_dp = &dig_port->dp;
> struct intel_connector *connector = to_intel_connector(conn_state->connector);
> + struct intel_hdcp *hdcp = &connector->hdcp;
> struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> struct drm_dp_mst_topology_state *mst_state =
> drm_atomic_get_new_mst_topology_state(&state->base, &intel_dp->mst_mgr);
> @@ -836,9 +837,15 @@ 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 */
> + /*
> + * Enable hdcp if it's desired or if userspace is enabled and
> + * driver set its state to undesired
> + */
> if (conn_state->content_protection ==
> - DRM_MODE_CONTENT_PROTECTION_DESIRED)
> + DRM_MODE_CONTENT_PROTECTION_DESIRED ||
> + (conn_state->content_protection ==
> + DRM_MODE_CONTENT_PROTECTION_ENABLED && hdcp->value ==
> + DRM_MODE_CONTENT_PROTECTION_UNDESIRED))
Ditto. This is just copy-paste here anyway.
> intel_hdcp_enable(state, encoder, pipe_config, conn_state);
> }
--
Jani Nikula, Intel
next prev parent reply other threads:[~2023-10-25 11:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-25 8:33 [Intel-gfx] [PATCH] drm/i915/hdcp: Additional conditions to enable hdcp Suraj Kandpal
2023-10-25 11:32 ` Jani Nikula [this message]
2023-10-25 18:05 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " 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=87ttqf7x9d.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox