diff mbox series

[v4,13.5/14] drm/i915: Print HDCP version info for all connectors

Message ID 20200227185714.171466-1-sean@poorly.run (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Sean Paul Feb. 27, 2020, 6:56 p.m. UTC
From: Sean Paul <seanpaul@chromium.org>

De-duplicate the HDCP version code and print it for all connectors.

Cc: Juston Li <juston.li@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>

Changes in v4:
- Added to the set
---
 .../drm/i915/display/intel_display_debugfs.c    | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Comments

Juston Li Feb. 27, 2020, 11:42 p.m. UTC | #1
On Thu, 2020-02-27 at 13:56 -0500, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> De-duplicate the HDCP version code and print it for all connectors.
> 
> Cc: Juston Li <juston.li@intel.com>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> 
> Changes in v4:
> - Added to the set

LGTM, thanks for adding this!
Reviewed-by: Juston Li <juston.li@intel.com>

> ---
>  .../drm/i915/display/intel_display_debugfs.c    | 17 +++++++++----
> ----
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index 46954cc7b6c01..eb948a14cfd61 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -597,6 +597,11 @@ static void intel_hdcp_info(struct seq_file *m,
>  {
>  	bool hdcp_cap, hdcp2_cap;
>  
> +	if (!intel_connector->hdcp.shim) {
> +		seq_puts(m, "No Connector Support");
> +		goto out;
> +	}
> +
>  	hdcp_cap = intel_hdcp_capable(intel_connector);
>  	hdcp2_cap = intel_hdcp2_capable(intel_connector);
>  
> @@ -608,6 +613,7 @@ static void intel_hdcp_info(struct seq_file *m,
>  	if (!hdcp_cap && !hdcp2_cap)
>  		seq_puts(m, "None");
>  
> +out:
>  	seq_puts(m, "\n");
>  }
>  
> @@ -624,10 +630,6 @@ static void intel_dp_info(struct seq_file *m,
>  
>  	drm_dp_downstream_debug(m, intel_dp->dpcd, intel_dp-
> >downstream_ports,
>  				&intel_dp->aux);
> -	if (intel_connector->hdcp.shim) {
> -		seq_puts(m, "\tHDCP version: ");
> -		intel_hdcp_info(m, intel_connector);
> -	}
>  }
>  
>  static void intel_dp_mst_info(struct seq_file *m,
> @@ -651,10 +653,6 @@ static void intel_hdmi_info(struct seq_file *m,
>  	struct intel_hdmi *intel_hdmi =
> enc_to_intel_hdmi(intel_encoder);
>  
>  	seq_printf(m, "\taudio support: %s\n", yesno(intel_hdmi-
> >has_audio));
> -	if (intel_connector->hdcp.shim) {
> -		seq_puts(m, "\tHDCP version: ");
> -		intel_hdcp_info(m, intel_connector);
> -	}
>  }
>  
>  static void intel_lvds_info(struct seq_file *m,
> @@ -710,6 +708,9 @@ static void intel_connector_info(struct seq_file
> *m,
>  		break;
>  	}
>  
> +	seq_puts(m, "\tHDCP version: ");
> +	intel_hdcp_info(m, intel_connector);
> +
>  	seq_printf(m, "\tmodes:\n");
>  	list_for_each_entry(mode, &connector->modes, head)
>  		intel_seq_print_mode(m, 2, mode);
Ramalingam C Feb. 28, 2020, 7:47 a.m. UTC | #2
On 2020-02-27 at 13:56:58 -0500, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> De-duplicate the HDCP version code and print it for all connectors.
> 
> Cc: Juston Li <juston.li@intel.com>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> 
> Changes in v4:
> - Added to the set
> ---
>  .../drm/i915/display/intel_display_debugfs.c    | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index 46954cc7b6c01..eb948a14cfd61 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -597,6 +597,11 @@ static void intel_hdcp_info(struct seq_file *m,
>  {
>  	bool hdcp_cap, hdcp2_cap;
>  
> +	if (!intel_connector->hdcp.shim) {
> +		seq_puts(m, "No Connector Support");
> +		goto out;
> +	}
With shim check moved inside the hdcp_info, we could remove it from
i915_hdcp_sink_capability_show. Let us return "No connector support" for
that debugfs too.

With that addressed.
Reviewed-by: Ramalingam C <ramalingam.c@intel.com>
> +
>  	hdcp_cap = intel_hdcp_capable(intel_connector);
>  	hdcp2_cap = intel_hdcp2_capable(intel_connector);
>  
> @@ -608,6 +613,7 @@ static void intel_hdcp_info(struct seq_file *m,
>  	if (!hdcp_cap && !hdcp2_cap)
>  		seq_puts(m, "None");
>  
> +out:
>  	seq_puts(m, "\n");
>  }
>  
> @@ -624,10 +630,6 @@ static void intel_dp_info(struct seq_file *m,
>  
>  	drm_dp_downstream_debug(m, intel_dp->dpcd, intel_dp->downstream_ports,
>  				&intel_dp->aux);
> -	if (intel_connector->hdcp.shim) {
> -		seq_puts(m, "\tHDCP version: ");
> -		intel_hdcp_info(m, intel_connector);
> -	}
>  }
>  
>  static void intel_dp_mst_info(struct seq_file *m,
> @@ -651,10 +653,6 @@ static void intel_hdmi_info(struct seq_file *m,
>  	struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(intel_encoder);
>  
>  	seq_printf(m, "\taudio support: %s\n", yesno(intel_hdmi->has_audio));
> -	if (intel_connector->hdcp.shim) {
> -		seq_puts(m, "\tHDCP version: ");
> -		intel_hdcp_info(m, intel_connector);
> -	}
>  }
>  
>  static void intel_lvds_info(struct seq_file *m,
> @@ -710,6 +708,9 @@ static void intel_connector_info(struct seq_file *m,
>  		break;
>  	}
>  
> +	seq_puts(m, "\tHDCP version: ");
> +	intel_hdcp_info(m, intel_connector);
> +
>  	seq_printf(m, "\tmodes:\n");
>  	list_for_each_entry(mode, &connector->modes, head)
>  		intel_seq_print_mode(m, 2, mode);
> -- 
> Sean Paul, Software Engineer, Google / Chromium OS
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index 46954cc7b6c01..eb948a14cfd61 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -597,6 +597,11 @@  static void intel_hdcp_info(struct seq_file *m,
 {
 	bool hdcp_cap, hdcp2_cap;
 
+	if (!intel_connector->hdcp.shim) {
+		seq_puts(m, "No Connector Support");
+		goto out;
+	}
+
 	hdcp_cap = intel_hdcp_capable(intel_connector);
 	hdcp2_cap = intel_hdcp2_capable(intel_connector);
 
@@ -608,6 +613,7 @@  static void intel_hdcp_info(struct seq_file *m,
 	if (!hdcp_cap && !hdcp2_cap)
 		seq_puts(m, "None");
 
+out:
 	seq_puts(m, "\n");
 }
 
@@ -624,10 +630,6 @@  static void intel_dp_info(struct seq_file *m,
 
 	drm_dp_downstream_debug(m, intel_dp->dpcd, intel_dp->downstream_ports,
 				&intel_dp->aux);
-	if (intel_connector->hdcp.shim) {
-		seq_puts(m, "\tHDCP version: ");
-		intel_hdcp_info(m, intel_connector);
-	}
 }
 
 static void intel_dp_mst_info(struct seq_file *m,
@@ -651,10 +653,6 @@  static void intel_hdmi_info(struct seq_file *m,
 	struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(intel_encoder);
 
 	seq_printf(m, "\taudio support: %s\n", yesno(intel_hdmi->has_audio));
-	if (intel_connector->hdcp.shim) {
-		seq_puts(m, "\tHDCP version: ");
-		intel_hdcp_info(m, intel_connector);
-	}
 }
 
 static void intel_lvds_info(struct seq_file *m,
@@ -710,6 +708,9 @@  static void intel_connector_info(struct seq_file *m,
 		break;
 	}
 
+	seq_puts(m, "\tHDCP version: ");
+	intel_hdcp_info(m, intel_connector);
+
 	seq_printf(m, "\tmodes:\n");
 	list_for_each_entry(mode, &connector->modes, head)
 		intel_seq_print_mode(m, 2, mode);