Add intel_panel_highest_fixed_mode() to return the fixed mode with the highest pixel clock. Unlike intel_panel_highest_mode(), this function does not fall back to the adjusted mode and returns NULL if no fixed modes are available.
Signed-off-by: Ankit Nautiyal <ankit.k.nauti...@intel.com> --- drivers/gpu/drm/i915/display/intel_panel.c | 13 +++++++++++++ drivers/gpu/drm/i915/display/intel_panel.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 2a20aaaaac39..ea4351d11e63 100644 --- a/drivers/gpu/drm/i915/display/intel_panel.c +++ b/drivers/gpu/drm/i915/display/intel_panel.c @@ -158,6 +158,19 @@ intel_panel_highest_mode(struct intel_connector *connector, return best_mode; } +const struct drm_display_mode * +intel_panel_highest_fixed_mode(struct intel_connector *connector) +{ + const struct drm_display_mode *fixed_mode, *highest_mode = NULL; + + list_for_each_entry(fixed_mode, &connector->panel.fixed_modes, head) { + if (!highest_mode || fixed_mode->clock > highest_mode->clock) + highest_mode = fixed_mode; + } + + return highest_mode; +} + int intel_panel_get_modes(struct intel_connector *connector) { const struct drm_display_mode *fixed_mode; diff --git a/drivers/gpu/drm/i915/display/intel_panel.h b/drivers/gpu/drm/i915/display/intel_panel.h index 56a6412cf0fb..60f6873cdbaa 100644 --- a/drivers/gpu/drm/i915/display/intel_panel.h +++ b/drivers/gpu/drm/i915/display/intel_panel.h @@ -39,6 +39,8 @@ intel_panel_downclock_mode(struct intel_connector *connector, const struct drm_display_mode * intel_panel_highest_mode(struct intel_connector *connector, const struct drm_display_mode *adjusted_mode); +const struct drm_display_mode * +intel_panel_highest_fixed_mode(struct intel_connector *connector); int intel_panel_get_modes(struct intel_connector *connector); enum drrs_type intel_panel_drrs_type(struct intel_connector *connector); enum drm_mode_status -- 2.45.2