[v3,2/2] drm/i915/hdcp: Return 0 on config_stream_type() +ve return
diff mbox series

Message ID 20200220123217.23635-3-anshuman.gupta@intel.com
State New
Headers show
Series
  • HDCP 2.2 Comp fixes
Related show

Commit Message

Anshuman Gupta Feb. 20, 2020, 12:32 p.m. UTC
As DP shim's config_stream_type returns size of message
to be written in case of success therefore on
config_stream_type success return a zero success
value in order to succeed the HDCP auth.

CC: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 drivers/gpu/drm/i915/display/intel_hdcp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ramalingam C March 2, 2020, 2:08 p.m. UTC | #1
On 2020-02-20 at 18:02:17 +0530, Anshuman Gupta wrote:
> As DP shim's config_stream_type returns size of message
> to be written in case of success therefore on
> config_stream_type success return a zero success
> value in order to succeed the HDCP auth.
> 
> CC: Ramalingam C <ramalingam.c@intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdcp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index 75f60ca282fc..464ef7ba4db4 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -1538,7 +1538,9 @@ static int hdcp2_authenticate_sink(struct intel_connector *connector)
>  		ret = shim->config_stream_type(intel_dig_port,
>  					       hdcp->is_repeater,
>  					       hdcp->content_type);
> -		if (ret < 0)
> +		if (ret >= 0)
> +			ret = 0;
> +		else
Anshuman, could we convert the return value of
intel_dp_hdcp2_config_stream_type to return the 0 or -ve, as the
functions is for configuring thr stream_type? Returning the bytes
written is not useful for the caller.

-Ram.
>  			return ret;
>  	}
>  
> -- 
> 2.24.0
>

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
index 75f60ca282fc..464ef7ba4db4 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -1538,7 +1538,9 @@  static int hdcp2_authenticate_sink(struct intel_connector *connector)
 		ret = shim->config_stream_type(intel_dig_port,
 					       hdcp->is_repeater,
 					       hdcp->content_type);
-		if (ret < 0)
+		if (ret >= 0)
+			ret = 0;
+		else
 			return ret;
 	}