All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/hdcp: Remove drm_modeset_lock in intel_conn_to_vcpi
Date: Thu, 16 Mar 2023 12:05:14 +0200	[thread overview]
Message-ID: <ZBLp2jMspLQ9i3ef@intel.com> (raw)
In-Reply-To: <20230316082232.666630-1-suraj.kandpal@intel.com>

On Thu, Mar 16, 2023 at 01:52:32PM +0530, Suraj Kandpal wrote:
> Remove drm_modeset_lock in intel_conn_to_vcpi as we don't need it
> anymore since all the required locks are taken in atomic check and
> prepare phases.
> 
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdcp.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index 2984d2810e42..f957b4bd9c26 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -41,7 +41,6 @@ static int intel_conn_to_vcpi(struct intel_connector *connector)
>  		return 0;
>  	mgr = connector->port->mgr;
>  
> -	drm_modeset_lock(&mgr->base.lock, NULL);
>  	mst_state = to_drm_dp_mst_topology_state(mgr->base.state);
>  	payload = drm_atomic_get_mst_payload_state(mst_state, connector->port);
>  	if (drm_WARN_ON(mgr->dev, !payload))
> @@ -53,7 +52,6 @@ static int intel_conn_to_vcpi(struct intel_connector *connector)
>  		goto out;
>  	}
>  out:
> -	drm_modeset_unlock(&mgr->base.lock);
>  	return vcpi;
>  }

That whole function looks like it something that should be
part of the drm_dp_mst_helper.c.

Also, it's directly accessing mgr->base.state which is just
wrong.

And it looks like it can get called from outside the normal
atomic commit flows (like so many other things in the hdcp
code, sigh), so what you're doing here is also wrong in
that case.

So the whole thing looks just very broken to me. Not to
mention the HDCP vs. MST<->SST switch is also still
fundementally broken. I'm really tempted to just send
a patch to nuke the entire HDCP MST code.

-- 
Ville Syrjälä
Intel

  parent reply	other threads:[~2023-03-16 10:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16  8:22 [Intel-gfx] [PATCH] drm/i915/hdcp: Remove drm_modeset_lock in intel_conn_to_vcpi Suraj Kandpal
2023-03-16  9:08 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-03-16 10:05 ` Ville Syrjälä [this message]
2023-03-16 12:15   ` [Intel-gfx] [PATCH] " Kandpal, Suraj
2023-03-16 10:31 ` [Intel-gfx] ✓ Fi.CI.IGT: 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=ZBLp2jMspLQ9i3ef@intel.com \
    --to=ville.syrjala@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.