Commit f0f7ec74 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Relocate is_in_vrr_range()

Move is_in_vrr_range() into intel_vrr.c in anticipation of
more users, and rename it accordingly.

Cc: Manasi Navare <navaremanasi@chromium.org>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-8-ville.syrjala@linux.intel.comReviewed-by: default avatarManasi Navare <navaremanasi@chromium.org>
Reviewed-by: default avatarMitul Golani <mitulkumar.ajitkumar.golani@intel.com>
parent b4ac591b
...@@ -59,15 +59,6 @@ intel_panel_preferred_fixed_mode(struct intel_connector *connector) ...@@ -59,15 +59,6 @@ intel_panel_preferred_fixed_mode(struct intel_connector *connector)
struct drm_display_mode, head); struct drm_display_mode, head);
} }
static bool is_in_vrr_range(struct intel_connector *connector, int vrefresh)
{
const struct drm_display_info *info = &connector->base.display_info;
return intel_vrr_is_capable(connector) &&
vrefresh >= info->monitor_range.min_vfreq &&
vrefresh <= info->monitor_range.max_vfreq;
}
static bool is_best_fixed_mode(struct intel_connector *connector, static bool is_best_fixed_mode(struct intel_connector *connector,
int vrefresh, int fixed_mode_vrefresh, int vrefresh, int fixed_mode_vrefresh,
const struct drm_display_mode *best_mode) const struct drm_display_mode *best_mode)
...@@ -81,8 +72,8 @@ static bool is_best_fixed_mode(struct intel_connector *connector, ...@@ -81,8 +72,8 @@ static bool is_best_fixed_mode(struct intel_connector *connector,
* vrefresh, which we can then reduce to match the requested * vrefresh, which we can then reduce to match the requested
* vrefresh by extending the vblank length. * vrefresh by extending the vblank length.
*/ */
if (is_in_vrr_range(connector, vrefresh) && if (intel_vrr_is_in_range(connector, vrefresh) &&
is_in_vrr_range(connector, fixed_mode_vrefresh) && intel_vrr_is_in_range(connector, fixed_mode_vrefresh) &&
fixed_mode_vrefresh < vrefresh) fixed_mode_vrefresh < vrefresh)
return false; return false;
...@@ -224,8 +215,8 @@ int intel_panel_compute_config(struct intel_connector *connector, ...@@ -224,8 +215,8 @@ int intel_panel_compute_config(struct intel_connector *connector,
* Assume that we shouldn't muck about with the * Assume that we shouldn't muck about with the
* timings if they don't land in the VRR range. * timings if they don't land in the VRR range.
*/ */
is_vrr = is_in_vrr_range(connector, vrefresh) && is_vrr = intel_vrr_is_in_range(connector, vrefresh) &&
is_in_vrr_range(connector, fixed_mode_vrefresh); intel_vrr_is_in_range(connector, fixed_mode_vrefresh);
if (!is_vrr) { if (!is_vrr) {
/* /*
......
...@@ -42,6 +42,15 @@ bool intel_vrr_is_capable(struct intel_connector *connector) ...@@ -42,6 +42,15 @@ bool intel_vrr_is_capable(struct intel_connector *connector)
info->monitor_range.max_vfreq - info->monitor_range.min_vfreq > 10; info->monitor_range.max_vfreq - info->monitor_range.min_vfreq > 10;
} }
bool intel_vrr_is_in_range(struct intel_connector *connector, int vrefresh)
{
const struct drm_display_info *info = &connector->base.display_info;
return intel_vrr_is_capable(connector) &&
vrefresh >= info->monitor_range.min_vfreq &&
vrefresh <= info->monitor_range.max_vfreq;
}
void void
intel_vrr_check_modeset(struct intel_atomic_state *state) intel_vrr_check_modeset(struct intel_atomic_state *state)
{ {
......
...@@ -14,6 +14,7 @@ struct intel_connector; ...@@ -14,6 +14,7 @@ struct intel_connector;
struct intel_crtc_state; struct intel_crtc_state;
bool intel_vrr_is_capable(struct intel_connector *connector); bool intel_vrr_is_capable(struct intel_connector *connector);
bool intel_vrr_is_in_range(struct intel_connector *connector, int vrefresh);
void intel_vrr_check_modeset(struct intel_atomic_state *state); void intel_vrr_check_modeset(struct intel_atomic_state *state);
void intel_vrr_compute_config(struct intel_crtc_state *crtc_state, void intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
struct drm_connector_state *conn_state); struct drm_connector_state *conn_state);
......
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