diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2022-03-31 13:28:19 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2022-03-31 13:28:19 +0200 |
commit | c19909d037b640a5e3580c68f420e7ba058c68e4 (patch) | |
tree | 2586ecc644eae386aa8e7ce612d9ed8870400897 /drivers/gpu/drm/i915/display/intel_panel.c | |
parent | drm/i915: Allow an arbitrary number of downclock modes (diff) | |
download | linux-c19909d037b640a5e3580c68f420e7ba058c68e4.tar.xz linux-c19909d037b640a5e3580c68f420e7ba058c68e4.zip |
drm/i915: Allow higher refresh rate alternate fixed modes
We shouldn't restrict ourselves to just downclock modes with
lower refresh rate than the preferred mode. Laptops these
days can offer higher refresh rate modes as well.
Remove the arbitrary limit and allow all modes that, apart
from the clock, match the preferred mode.
v2: s/add_edid_downclock_modes/add_edid_alt_fixed_modes/ (Jani)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-9-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_panel.c')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_panel.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index d359c8050fdc..03398feb6676 100644 --- a/drivers/gpu/drm/i915/display/intel_panel.c +++ b/drivers/gpu/drm/i915/display/intel_panel.c @@ -149,29 +149,29 @@ int intel_panel_compute_config(struct intel_connector *connector, return 0; } -static bool is_downclock_mode(const struct drm_display_mode *downclock_mode, - const struct drm_display_mode *fixed_mode) +static bool is_alt_fixed_mode(const struct drm_display_mode *mode, + const struct drm_display_mode *preferred_mode) { - return drm_mode_match(downclock_mode, fixed_mode, + return drm_mode_match(mode, preferred_mode, DRM_MODE_MATCH_TIMINGS | DRM_MODE_MATCH_FLAGS | DRM_MODE_MATCH_3D_FLAGS) && - downclock_mode->clock < fixed_mode->clock; + mode->clock != preferred_mode->clock; } -static void intel_panel_add_edid_downclock_modes(struct intel_connector *connector) +static void intel_panel_add_edid_alt_fixed_modes(struct intel_connector *connector) { struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - const struct drm_display_mode *fixed_mode = + const struct drm_display_mode *preferred_mode = intel_panel_preferred_fixed_mode(connector); struct drm_display_mode *mode, *next; list_for_each_entry_safe(mode, next, &connector->base.probed_modes, head) { - if (!is_downclock_mode(mode, fixed_mode)) + if (!is_alt_fixed_mode(mode, preferred_mode)) continue; drm_dbg_kms(&dev_priv->drm, - "[CONNECTOR:%d:%s] using EDID downclock mode: " DRM_MODE_FMT "\n", + "[CONNECTOR:%d:%s] using alternate EDID fixed mode: " DRM_MODE_FMT "\n", connector->base.base.id, connector->base.name, DRM_MODE_ARG(mode)); @@ -179,7 +179,7 @@ static void intel_panel_add_edid_downclock_modes(struct intel_connector *connect } } -static void intel_panel_add_edid_fixed_mode(struct intel_connector *connector) +static void intel_panel_add_edid_preferred_mode(struct intel_connector *connector) { struct drm_i915_private *dev_priv = to_i915(connector->base.dev); struct drm_display_mode *scan, *fixed_mode = NULL; @@ -223,9 +223,9 @@ static void intel_panel_destroy_probed_modes(struct intel_connector *connector) void intel_panel_add_edid_fixed_modes(struct intel_connector *connector, bool has_drrs) { - intel_panel_add_edid_fixed_mode(connector); + intel_panel_add_edid_preferred_mode(connector); if (intel_panel_preferred_fixed_mode(connector) && has_drrs) - intel_panel_add_edid_downclock_modes(connector); + intel_panel_add_edid_alt_fixed_modes(connector); intel_panel_destroy_probed_modes(connector); } |