Commit 74d6f31f authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Add intel_panel_highest_mode()

Add a function to get the fixed_mode with the highest clock.
The plan is to use this for the link bw calculation on seamless
DRRS panels so that we alwasy end up with the same link params
regardless of the requested refresh rate. This will allow fastset
to do seamless refresh rate changes based on userspace request
instead of having to go for a full modeset.

TODO: the function name isn't great
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-15-ville.syrjala@linux.intel.com
parent 3917c9d3
...@@ -114,6 +114,21 @@ intel_panel_downclock_mode(struct intel_connector *connector, ...@@ -114,6 +114,21 @@ intel_panel_downclock_mode(struct intel_connector *connector,
return best_mode; return best_mode;
} }
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 *fixed_mode, *best_mode = adjusted_mode;
/* pick the fixed_mode that has the highest clock */
list_for_each_entry(fixed_mode, &connector->panel.fixed_modes, head) {
if (fixed_mode->clock > best_mode->clock)
best_mode = fixed_mode;
}
return best_mode;
}
int intel_panel_get_modes(struct intel_connector *connector) int intel_panel_get_modes(struct intel_connector *connector)
{ {
const struct drm_display_mode *fixed_mode; const struct drm_display_mode *fixed_mode;
......
...@@ -31,6 +31,9 @@ intel_panel_fixed_mode(struct intel_connector *connector, ...@@ -31,6 +31,9 @@ intel_panel_fixed_mode(struct intel_connector *connector,
const struct drm_display_mode * const struct drm_display_mode *
intel_panel_downclock_mode(struct intel_connector *connector, intel_panel_downclock_mode(struct intel_connector *connector,
const struct drm_display_mode *adjusted_mode); const struct drm_display_mode *adjusted_mode);
const struct drm_display_mode *
intel_panel_highest_mode(struct intel_connector *connector,
const struct drm_display_mode *adjusted_mode);
int intel_panel_get_modes(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 drrs_type intel_panel_drrs_type(struct intel_connector *connector);
enum drm_mode_status enum drm_mode_status
......
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