Commit 14daee24 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Extract intel_panel_vbt_sdvo_fixed_mode()



We have a function for duplicating the VBT LFP mode. Add the same
for the VBT SDVO mode.

Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-7-ville.syrjala@linux.intel.com


Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 688a9bbc
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -272,6 +272,26 @@ intel_panel_vbt_lfp_fixed_mode(struct intel_connector *connector)
	return fixed_mode;
}

struct drm_display_mode *
intel_panel_vbt_sdvo_fixed_mode(struct intel_connector *connector)
{
	struct drm_i915_private *i915 = to_i915(connector->base.dev);
	struct drm_display_mode *fixed_mode;

	if (!i915->vbt.sdvo_lvds_vbt_mode)
		return NULL;

	fixed_mode = drm_mode_duplicate(&i915->drm,
					i915->vbt.sdvo_lvds_vbt_mode);
	if (!fixed_mode)
		return NULL;

	/* Guarantee the mode is preferred */
	fixed_mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;

	return fixed_mode;
}

/* adjusted_mode has been preset to be the panel's fixed mode */
static int pch_panel_fitting(struct intel_crtc_state *crtc_state,
			     const struct drm_connector_state *conn_state)
+2 −0
Original line number Diff line number Diff line
@@ -48,5 +48,7 @@ struct drm_display_mode *
intel_panel_edid_fixed_mode(struct intel_connector *connector);
struct drm_display_mode *
intel_panel_vbt_lfp_fixed_mode(struct intel_connector *connector);
struct drm_display_mode *
intel_panel_vbt_sdvo_fixed_mode(struct intel_connector *connector);

#endif /* __INTEL_PANEL_H__ */
+4 −10
Original line number Diff line number Diff line
@@ -2301,17 +2301,11 @@ static int intel_sdvo_get_lvds_modes(struct drm_connector *connector)
	 * Fetch modes from VBT. For SDVO prefer the VBT mode since some
	 * SDVO->LVDS transcoders can't cope with the EDID mode.
	 */
	if (dev_priv->vbt.sdvo_lvds_vbt_mode != NULL) {
		newmode = drm_mode_duplicate(connector->dev,
					     dev_priv->vbt.sdvo_lvds_vbt_mode);
		if (newmode != NULL) {
			/* Guarantee the mode is preferred */
			newmode->type = (DRM_MODE_TYPE_PREFERRED |
					 DRM_MODE_TYPE_DRIVER);
	newmode = intel_panel_vbt_sdvo_fixed_mode(to_intel_connector(connector));
	if (newmode) {
		drm_mode_probed_add(connector, newmode);
		num_modes++;
	}
	}

	/*
	 * Attempt to get the mode list from DDC.