[1/2] drm/i915/hdcp: Add update_pipe early return
diff mbox series

Message ID 20200513121845.19437-2-anshuman.gupta@intel.com
State New
Headers show
Series
  • HDCP minor refactoring
Related show

Commit Message

Anshuman Gupta May 13, 2020, 12:18 p.m. UTC
Currently intel_hdcp_update_pipe() is also getting called for non-hdcp
connectors and got though its conditional code flow, which is completely
unnecessary for non-hdcp connectors, therefore it make sense to
have an early return. No functional change.

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 drivers/gpu/drm/i915/display/intel_hdcp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Shankar, Uma May 18, 2020, 10:14 a.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Anshuman Gupta
> Sent: Wednesday, May 13, 2020 5:49 PM
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 1/2] drm/i915/hdcp: Add update_pipe early return
> 
> Currently intel_hdcp_update_pipe() is also getting called for non-hdcp
> connectors and got though its conditional code flow, which is completely
> unnecessary for non-hdcp connectors, therefore it make sense to have an early
> return. No functional change.

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdcp.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c
> b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index 2cbc4619b4ce..d0a2bee9035a 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -2079,11 +2079,15 @@ void intel_hdcp_update_pipe(struct
> intel_atomic_state *state,
>  	struct intel_connector *connector =
>  				to_intel_connector(conn_state->connector);
>  	struct intel_hdcp *hdcp = &connector->hdcp;
> -	bool content_protection_type_changed =
> +	bool content_protection_type_changed;
> +
> +	if (!connector->hdcp.shim)
> +		return;
> +
> +	content_protection_type_changed =
>  		(conn_state->hdcp_content_type != hdcp->content_type &&
>  		 conn_state->content_protection !=
>  		 DRM_MODE_CONTENT_PROTECTION_UNDESIRED);
> -
>  	/*
>  	 * During the HDCP encryption session if Type change is requested,
>  	 * disable the HDCP and reenable it with new TYPE value.
> --
> 2.26.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Anshuman Gupta May 18, 2020, 10:18 a.m. UTC | #2
-----Original Message-----
From: Shankar, Uma <uma.shankar@intel.com> 
Sent: Monday, May 18, 2020 3:45 PM
To: Gupta, Anshuman <anshuman.gupta@intel.com>; intel-gfx@lists.freedesktop.org
Subject: RE: [Intel-gfx] [PATCH 1/2] drm/i915/hdcp: Add update_pipe early return



> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of 
> Anshuman Gupta
> Sent: Wednesday, May 13, 2020 5:49 PM
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 1/2] drm/i915/hdcp: Add update_pipe early 
> return
> 
> Currently intel_hdcp_update_pipe() is also getting called for non-hdcp 
> connectors and got though its conditional code flow, which is 
> completely unnecessary for non-hdcp connectors, therefore it make 
> sense to have an early return. No functional change.

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Thanks Uma for review!
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdcp.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c
> b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index 2cbc4619b4ce..d0a2bee9035a 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -2079,11 +2079,15 @@ void intel_hdcp_update_pipe(struct 
> intel_atomic_state *state,
>  	struct intel_connector *connector =
>  				to_intel_connector(conn_state->connector);
>  	struct intel_hdcp *hdcp = &connector->hdcp;
> -	bool content_protection_type_changed =
> +	bool content_protection_type_changed;
> +
> +	if (!connector->hdcp.shim)
> +		return;
> +
> +	content_protection_type_changed =
>  		(conn_state->hdcp_content_type != hdcp->content_type &&
>  		 conn_state->content_protection !=
>  		 DRM_MODE_CONTENT_PROTECTION_UNDESIRED);
> -
>  	/*
>  	 * During the HDCP encryption session if Type change is requested,
>  	 * disable the HDCP and reenable it with new TYPE value.
> --
> 2.26.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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 2cbc4619b4ce..d0a2bee9035a 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -2079,11 +2079,15 @@  void intel_hdcp_update_pipe(struct intel_atomic_state *state,
 	struct intel_connector *connector =
 				to_intel_connector(conn_state->connector);
 	struct intel_hdcp *hdcp = &connector->hdcp;
-	bool content_protection_type_changed =
+	bool content_protection_type_changed;
+
+	if (!connector->hdcp.shim)
+		return;
+
+	content_protection_type_changed =
 		(conn_state->hdcp_content_type != hdcp->content_type &&
 		 conn_state->content_protection !=
 		 DRM_MODE_CONTENT_PROTECTION_UNDESIRED);
-
 	/*
 	 * During the HDCP encryption session if Type change is requested,
 	 * disable the HDCP and reenable it with new TYPE value.