diff mbox series

drm/i915/hdcp: Use correct cp_irq_count

Message ID 20240809054424.3938842-1-suraj.kandpal@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/hdcp: Use correct cp_irq_count | expand

Commit Message

Kandpal, Suraj Aug. 9, 2024, 5:44 a.m. UTC
We are checking cp_irq_count from the wrong hdcp structure which
ends up giving timed out errors. Extract it from the correct
intel_hdcp structure.

Fixes: 8c9e4f68b861 ("drm/i915/hdcp: Use per-device debugs")
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jani Nikula Aug. 9, 2024, 8:21 a.m. UTC | #1
On Fri, 09 Aug 2024, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> We are checking cp_irq_count from the wrong hdcp structure which
> ends up giving timed out errors. Extract it from the correct
> intel_hdcp structure.

The change in the referenced commit seems natural. Please explain *why*
it's the wrong hdcp structure.

BR,
Jani.


>
> Fixes: 8c9e4f68b861 ("drm/i915/hdcp: Use per-device debugs")
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> index ec357d2670f1..3425b3643143 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> @@ -39,7 +39,9 @@ static u32 transcoder_to_stream_enc_status(enum transcoder cpu_transcoder)
>  static void intel_dp_hdcp_wait_for_cp_irq(struct intel_connector *connector,
>  					  int timeout)
>  {
> -	struct intel_hdcp *hdcp = &connector->hdcp;
> +	struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
> +	struct intel_dp *dp = &dig_port->dp;
> +	struct intel_hdcp *hdcp = &dp->attached_connector->hdcp;
>  	long ret;
>  
>  #define C (hdcp->cp_irq_count_cached != atomic_read(&hdcp->cp_irq_count))
Kandpal, Suraj Aug. 9, 2024, 11:38 a.m. UTC | #2
> -----Original Message-----
> From: Jani Nikula <jani.nikula@linux.intel.com>
> Sent: Friday, August 9, 2024 1:51 PM
> To: Kandpal, Suraj <suraj.kandpal@intel.com>; intel-
> gfx@lists.freedesktop.org
> Cc: Nautiyal, Ankit K <ankit.k.nautiyal@intel.com>; Kandpal, Suraj
> <suraj.kandpal@intel.com>
> Subject: Re: [PATCH] drm/i915/hdcp: Use correct cp_irq_count
> 
> On Fri, 09 Aug 2024, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> > We are checking cp_irq_count from the wrong hdcp structure which ends
> > up giving timed out errors. Extract it from the correct intel_hdcp
> > structure.
> 
> The change in the referenced commit seems natural. Please explain *why*
> it's the wrong hdcp structure.
> 

Sure Jani will update the commit description. 
It's the wrong hdcp_structure to check the cp_irq_count on because we only increment
the cp_irq_count of the primary connector's hdcp structure but here we check the irq count from
the secondary connector's hdcp structure too which is incorrect.

Regards,
Suraj Kandpal
 
> BR,
> Jani.
> 
> 
> >
> > Fixes: 8c9e4f68b861 ("drm/i915/hdcp: Use per-device debugs")
> > Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > index ec357d2670f1..3425b3643143 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > @@ -39,7 +39,9 @@ static u32 transcoder_to_stream_enc_status(enum
> > transcoder cpu_transcoder)  static void
> intel_dp_hdcp_wait_for_cp_irq(struct intel_connector *connector,
> >  					  int timeout)
> >  {
> > -	struct intel_hdcp *hdcp = &connector->hdcp;
> > +	struct intel_digital_port *dig_port =
> intel_attached_dig_port(connector);
> > +	struct intel_dp *dp = &dig_port->dp;
> > +	struct intel_hdcp *hdcp = &dp->attached_connector->hdcp;
> >  	long ret;
> >
> >  #define C (hdcp->cp_irq_count_cached !=
> > atomic_read(&hdcp->cp_irq_count))
> 
> --
> Jani Nikula, Intel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
index ec357d2670f1..3425b3643143 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
@@ -39,7 +39,9 @@  static u32 transcoder_to_stream_enc_status(enum transcoder cpu_transcoder)
 static void intel_dp_hdcp_wait_for_cp_irq(struct intel_connector *connector,
 					  int timeout)
 {
-	struct intel_hdcp *hdcp = &connector->hdcp;
+	struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
+	struct intel_dp *dp = &dig_port->dp;
+	struct intel_hdcp *hdcp = &dp->attached_connector->hdcp;
 	long ret;
 
 #define C (hdcp->cp_irq_count_cached != atomic_read(&hdcp->cp_irq_count))