Commit 3a3c4ce9 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Combine the EDID fixed_mode+downclock_mode lookup into one

The intel_panel_add_edid_fixed_mode() vs.
intel_panel_add_edid_downclock_mode() split is not really
helpful. Let's just roll those into a single function so
that the connector init code doesn't have to care too much
about this. All we need to know is whether DRRS should be
allowed or not.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-6-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 05d2d45e
......@@ -5072,10 +5072,8 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
}
intel_connector->edid = edid;
intel_panel_add_edid_fixed_mode(intel_connector);
if (intel_panel_preferred_fixed_mode(intel_connector) &&
intel_edp_has_drrs(intel_dp))
intel_panel_add_edid_downclock_mode(intel_connector);
intel_panel_add_edid_fixed_modes(intel_connector,
intel_edp_has_drrs(intel_dp));
/* MSO requires information from the EDID */
intel_edp_mso_init(intel_dp);
......
......@@ -968,7 +968,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
intel_connector->edid = edid;
/* Try EDID first */
intel_panel_add_edid_fixed_mode(intel_connector);
intel_panel_add_edid_fixed_modes(intel_connector, false);
/* Failed to get EDID, what about VBT? */
if (!intel_panel_preferred_fixed_mode(intel_connector))
......
......@@ -159,7 +159,7 @@ static bool is_downclock_mode(const struct drm_display_mode *downclock_mode,
downclock_mode->clock < fixed_mode->clock;
}
void intel_panel_add_edid_downclock_mode(struct intel_connector *connector)
static void intel_panel_add_edid_downclock_mode(struct intel_connector *connector)
{
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
const struct drm_display_mode *fixed_mode =
......@@ -202,7 +202,7 @@ void intel_panel_add_edid_downclock_mode(struct intel_connector *connector)
list_add_tail(&downclock_mode->head, &connector->panel.fixed_modes);
}
void intel_panel_add_edid_fixed_mode(struct intel_connector *connector)
static void intel_panel_add_edid_fixed_mode(struct intel_connector *connector)
{
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
const struct drm_display_mode *scan;
......@@ -244,6 +244,13 @@ void intel_panel_add_edid_fixed_mode(struct intel_connector *connector)
list_add_tail(&fixed_mode->head, &connector->panel.fixed_modes);
}
void intel_panel_add_edid_fixed_modes(struct intel_connector *connector, bool has_drrs)
{
intel_panel_add_edid_fixed_mode(connector);
if (intel_panel_preferred_fixed_mode(connector) && has_drrs)
intel_panel_add_edid_downclock_mode(connector);
}
static void intel_panel_add_fixed_mode(struct intel_connector *connector,
struct drm_display_mode *fixed_mode,
const char *type)
......
......@@ -40,8 +40,7 @@ int intel_panel_fitting(struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state);
int intel_panel_compute_config(struct intel_connector *connector,
struct drm_display_mode *adjusted_mode);
void intel_panel_add_edid_fixed_mode(struct intel_connector *connector);
void intel_panel_add_edid_downclock_mode(struct intel_connector *connector);
void intel_panel_add_edid_fixed_modes(struct intel_connector *connector, bool has_drrs);
void intel_panel_add_vbt_lfp_fixed_mode(struct intel_connector *connector);
void intel_panel_add_vbt_sdvo_fixed_mode(struct intel_connector *connector);
void intel_panel_add_encoder_fixed_mode(struct intel_connector *connector,
......
......@@ -2907,7 +2907,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
if (!intel_panel_preferred_fixed_mode(intel_connector)) {
intel_ddc_get_modes(connector, &intel_sdvo->ddc);
intel_panel_add_edid_fixed_mode(intel_connector);
intel_panel_add_edid_fixed_modes(intel_connector, false);
}
intel_panel_init(intel_connector);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment