Skip to content

Commit

Permalink
drm/i915/vrr: Add helper to check if vrr possible
Browse files Browse the repository at this point in the history
Add helper to check if vrr is possible based on flipline
is computed.

--v1:
return just flipline instead using ternary operator [Jonathan, Ville].

Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241010040503.1795399-2-mitulkumar.ajitkumar.golani@intel.com
  • Loading branch information
Mitul Golani authored and Ville Syrjälä committed Oct 16, 2024
1 parent 750a954 commit ffb7ded
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/gpu/drm/i915/display/intel_vrr.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ bool intel_vrr_is_in_range(struct intel_connector *connector, int vrefresh)
vrefresh <= info->monitor_range.max_vfreq;
}

bool intel_vrr_possible(const struct intel_crtc_state *crtc_state)
{
return crtc_state->vrr.flipline;
}

void
intel_vrr_check_modeset(struct intel_atomic_state *state)
{
Expand Down Expand Up @@ -281,7 +286,7 @@ void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state)
intel_de_rmw(display, CHICKEN_TRANS(cpu_transcoder),
0, PIPE_VBLANK_WITH_DELAY);

if (!crtc_state->vrr.flipline) {
if (!intel_vrr_possible(crtc_state)) {
intel_de_write(display,
TRANS_VRR_CTL(display, cpu_transcoder), 0);
return;
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/display/intel_vrr.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct intel_crtc_state;

bool intel_vrr_is_capable(struct intel_connector *connector);
bool intel_vrr_is_in_range(struct intel_connector *connector, int vrefresh);
bool intel_vrr_possible(const struct intel_crtc_state *crtc_state);
void intel_vrr_check_modeset(struct intel_atomic_state *state);
void intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
struct drm_connector_state *conn_state);
Expand Down

0 comments on commit ffb7ded

Please sign in to comment.