diff mbox series

[1/2] drm/i915/hdcp: Move aux assignment after connector type check

Message ID 20240430064030.887080-2-suraj.kandpal@intel.com (mailing list archive)
State New, archived
Headers show
Series Fixes in hdcp remote capability | expand

Commit Message

Suraj Kandpal April 30, 2024, 6:40 a.m. UTC
Move assignment of aux after connector type check as port may not
exist if connector is not DPMST.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Jani Nikula May 2, 2024, 10:43 a.m. UTC | #1
On Tue, 30 Apr 2024, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> Move assignment of aux after connector type check as port may not
> exist if connector is not DPMST.
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> index 92b03073acdd..92be53d7c81f 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> @@ -687,15 +687,16 @@ int intel_dp_hdcp_get_remote_capability(struct intel_connector *connector,
>  					bool *hdcp2_capable)
>  {
>  	struct drm_i915_private *i915 = to_i915(connector->base.dev);
> -	struct drm_dp_aux *aux = &connector->port->aux;
> +	struct drm_dp_aux *aux;
>  	u8 bcaps;
>  	int ret;
>  
>  	*hdcp_capable = false;
>  	*hdcp2_capable = false;
> -	if (!intel_encoder_is_mst(connector->encoder))
> +	if (intel_encoder_is_mst(connector->encoder))

Suspicious.

>  		return -EINVAL;
>  
> +	aux = &connector->port->aux;
>  	ret =  _intel_dp_hdcp2_get_capability(aux, hdcp2_capable);
>  	if (ret)
>  		drm_dbg_kms(&i915->drm,
Suraj Kandpal May 2, 2024, 12:13 p.m. UTC | #2
> -----Original Message-----
> From: Jani Nikula <jani.nikula@linux.intel.com>
> Sent: Thursday, May 2, 2024 4:14 PM
> To: Kandpal, Suraj <suraj.kandpal@intel.com>; intel-gfx@lists.freedesktop.org
> Cc: Shankar, Uma <uma.shankar@intel.com>; Nautiyal, Ankit K
> <ankit.k.nautiyal@intel.com>; Kandpal, Suraj <suraj.kandpal@intel.com>
> Subject: Re: [PATCH 1/2] drm/i915/hdcp: Move aux assignment after
> connector type check
> 
> On Tue, 30 Apr 2024, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> > Move assignment of aux after connector type check as port may not
> > exist if connector is not DPMST.
> >
> > Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > index 92b03073acdd..92be53d7c81f 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > @@ -687,15 +687,16 @@ int intel_dp_hdcp_get_remote_capability(struct
> intel_connector *connector,
> >  					bool *hdcp2_capable)
> >  {
> >  	struct drm_i915_private *i915 = to_i915(connector->base.dev);
> > -	struct drm_dp_aux *aux = &connector->port->aux;
> > +	struct drm_dp_aux *aux;
> >  	u8 bcaps;
> >  	int ret;
> >
> >  	*hdcp_capable = false;
> >  	*hdcp2_capable = false;
> > -	if (!intel_encoder_is_mst(connector->encoder))
> > +	if (intel_encoder_is_mst(connector->encoder))
> 
> Suspicious.
Oops typo here will remove this change.
Regards,
Suraj Kandpal
> 
> >  		return -EINVAL;
> >
> > +	aux = &connector->port->aux;
> >  	ret =  _intel_dp_hdcp2_get_capability(aux, hdcp2_capable);
> >  	if (ret)
> >  		drm_dbg_kms(&i915->drm,
> 
> --
> 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 92b03073acdd..92be53d7c81f 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
@@ -687,15 +687,16 @@  int intel_dp_hdcp_get_remote_capability(struct intel_connector *connector,
 					bool *hdcp2_capable)
 {
 	struct drm_i915_private *i915 = to_i915(connector->base.dev);
-	struct drm_dp_aux *aux = &connector->port->aux;
+	struct drm_dp_aux *aux;
 	u8 bcaps;
 	int ret;
 
 	*hdcp_capable = false;
 	*hdcp2_capable = false;
-	if (!intel_encoder_is_mst(connector->encoder))
+	if (intel_encoder_is_mst(connector->encoder))
 		return -EINVAL;
 
+	aux = &connector->port->aux;
 	ret =  _intel_dp_hdcp2_get_capability(aux, hdcp2_capable);
 	if (ret)
 		drm_dbg_kms(&i915->drm,