diff mbox series

[v2,04/16] drm/i915: Simplify intel_panel_info()

Message ID 20220311172428.14685-5-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: DRRS fixes/cleanups and start of static DRRS | expand

Commit Message

Ville Syrjälä March 11, 2022, 5:24 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

No need for all this connector type special casing. If the
connector has a fixed mode just print it, otherwise don't.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 .../drm/i915/display/intel_display_debugfs.c  | 24 +++++++------------
 1 file changed, 9 insertions(+), 15 deletions(-)

Comments

Jani Nikula March 14, 2022, 9:47 a.m. UTC | #1
On Fri, 11 Mar 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> No need for all this connector type special casing. If the
> connector has a fixed mode just print it, otherwise don't.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  .../drm/i915/display/intel_display_debugfs.c  | 24 +++++++------------
>  1 file changed, 9 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index 798bf233a60f..e511500ee26a 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -544,11 +544,15 @@ static void intel_encoder_info(struct seq_file *m,
>  	drm_connector_list_iter_end(&conn_iter);
>  }
>  
> -static void intel_panel_info(struct seq_file *m, struct intel_panel *panel)
> +static void intel_panel_info(struct seq_file *m,
> +			     struct intel_connector *connector)
>  {
> -	const struct drm_display_mode *mode = panel->fixed_mode;
> +	const struct drm_display_mode *fixed_mode = connector->panel.fixed_mode;
>  
> -	seq_printf(m, "\tfixed mode: " DRM_MODE_FMT "\n", DRM_MODE_ARG(mode));
> +	if (!fixed_mode)
> +		return;
> +
> +	seq_printf(m, "\tfixed mode: " DRM_MODE_FMT "\n", DRM_MODE_ARG(fixed_mode));
>  }
>  
>  static void intel_hdcp_info(struct seq_file *m,
> @@ -586,8 +590,6 @@ static void intel_dp_info(struct seq_file *m,
>  	seq_printf(m, "\tDPCD rev: %x\n", intel_dp->dpcd[DP_DPCD_REV]);
>  	seq_printf(m, "\taudio support: %s\n",
>  		   str_yes_no(intel_dp->has_audio));
> -	if (intel_connector->base.connector_type == DRM_MODE_CONNECTOR_eDP)
> -		intel_panel_info(m, &intel_connector->panel);
>  
>  	drm_dp_downstream_debug(m, intel_dp->dpcd, intel_dp->downstream_ports,
>  				edid ? edid->data : NULL, &intel_dp->aux);
> @@ -611,12 +613,6 @@ static void intel_hdmi_info(struct seq_file *m,
>  		   str_yes_no(intel_hdmi->has_audio));
>  }
>  
> -static void intel_lvds_info(struct seq_file *m,
> -			    struct intel_connector *intel_connector)
> -{
> -	intel_panel_info(m, &intel_connector->panel);
> -}
> -
>  static void intel_connector_info(struct seq_file *m,
>  				 struct drm_connector *connector)
>  {
> @@ -651,10 +647,6 @@ static void intel_connector_info(struct seq_file *m,
>  		else
>  			intel_dp_info(m, intel_connector);
>  		break;
> -	case DRM_MODE_CONNECTOR_LVDS:
> -		if (encoder->type == INTEL_OUTPUT_LVDS)
> -			intel_lvds_info(m, intel_connector);
> -		break;
>  	case DRM_MODE_CONNECTOR_HDMIA:
>  		if (encoder->type == INTEL_OUTPUT_HDMI ||
>  		    encoder->type == INTEL_OUTPUT_DDI)
> @@ -667,6 +659,8 @@ static void intel_connector_info(struct seq_file *m,
>  	seq_puts(m, "\tHDCP version: ");
>  	intel_hdcp_info(m, intel_connector);
>  
> +	intel_panel_info(m, intel_connector);
> +
>  	seq_printf(m, "\tmodes:\n");
>  	list_for_each_entry(mode, &connector->modes, head)
>  		intel_seq_print_mode(m, 2, mode);
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 798bf233a60f..e511500ee26a 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -544,11 +544,15 @@  static void intel_encoder_info(struct seq_file *m,
 	drm_connector_list_iter_end(&conn_iter);
 }
 
-static void intel_panel_info(struct seq_file *m, struct intel_panel *panel)
+static void intel_panel_info(struct seq_file *m,
+			     struct intel_connector *connector)
 {
-	const struct drm_display_mode *mode = panel->fixed_mode;
+	const struct drm_display_mode *fixed_mode = connector->panel.fixed_mode;
 
-	seq_printf(m, "\tfixed mode: " DRM_MODE_FMT "\n", DRM_MODE_ARG(mode));
+	if (!fixed_mode)
+		return;
+
+	seq_printf(m, "\tfixed mode: " DRM_MODE_FMT "\n", DRM_MODE_ARG(fixed_mode));
 }
 
 static void intel_hdcp_info(struct seq_file *m,
@@ -586,8 +590,6 @@  static void intel_dp_info(struct seq_file *m,
 	seq_printf(m, "\tDPCD rev: %x\n", intel_dp->dpcd[DP_DPCD_REV]);
 	seq_printf(m, "\taudio support: %s\n",
 		   str_yes_no(intel_dp->has_audio));
-	if (intel_connector->base.connector_type == DRM_MODE_CONNECTOR_eDP)
-		intel_panel_info(m, &intel_connector->panel);
 
 	drm_dp_downstream_debug(m, intel_dp->dpcd, intel_dp->downstream_ports,
 				edid ? edid->data : NULL, &intel_dp->aux);
@@ -611,12 +613,6 @@  static void intel_hdmi_info(struct seq_file *m,
 		   str_yes_no(intel_hdmi->has_audio));
 }
 
-static void intel_lvds_info(struct seq_file *m,
-			    struct intel_connector *intel_connector)
-{
-	intel_panel_info(m, &intel_connector->panel);
-}
-
 static void intel_connector_info(struct seq_file *m,
 				 struct drm_connector *connector)
 {
@@ -651,10 +647,6 @@  static void intel_connector_info(struct seq_file *m,
 		else
 			intel_dp_info(m, intel_connector);
 		break;
-	case DRM_MODE_CONNECTOR_LVDS:
-		if (encoder->type == INTEL_OUTPUT_LVDS)
-			intel_lvds_info(m, intel_connector);
-		break;
 	case DRM_MODE_CONNECTOR_HDMIA:
 		if (encoder->type == INTEL_OUTPUT_HDMI ||
 		    encoder->type == INTEL_OUTPUT_DDI)
@@ -667,6 +659,8 @@  static void intel_connector_info(struct seq_file *m,
 	seq_puts(m, "\tHDCP version: ");
 	intel_hdcp_info(m, intel_connector);
 
+	intel_panel_info(m, intel_connector);
+
 	seq_printf(m, "\tmodes:\n");
 	list_for_each_entry(mode, &connector->modes, head)
 		intel_seq_print_mode(m, 2, mode);