On Tue, May 07, 2024 at 09:20:37AM +0530, Suraj Kandpal wrote:
> Check mst_port field in intel_connector to check connector type
> rather than rely on encoder as it may not be attached to connector
> at times.
> 
> Signed-off-by: Suraj Kandpal <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 2 +-
>  1 file changed, 1 insertion(+), 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 551c862ed7a6..2edffe62f360 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> @@ -693,7 +693,7 @@ int intel_dp_hdcp_get_remote_capability(struct 
> intel_connector *connector,
>  
>       *hdcp_capable = false;
>       *hdcp2_capable = false;
> -     if (!intel_encoder_is_mst(connector->encoder))
> +     if (!connector->mst_port)

I suppose this fixes
https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10898

Could you add the Closes: line for it?

Can this function be called for anything else than an MST connector?

Afaics it's only called from 

intel_connector_info() ->
        intel_hdcp_info(..., remote_req = true)

only for MST connectors, which makes sense since only MST connectors
would have remote caps. In that case it would be enough to simply remove
the encoder check which leads to the NULL deref in case the output is
disabled.

>               return -EINVAL;
>  
>       aux = &connector->port->aux;
> -- 
> 2.43.2
> 

Reply via email to