Commit 0032cfd6 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Simplify intel_panel_info()



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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-5-ville.syrjala@linux.intel.com


Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 457e992b
Loading
Loading
Loading
Loading
+9 −15
Original line number Diff line number Diff line
@@ -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);