Skip to content

Commit ffb7ded

Browse files
gmitulvsyrjala
authored andcommitted
drm/i915/vrr: Add helper to check if vrr possible
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
1 parent 750a954 commit ffb7ded

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/gpu/drm/i915/display/intel_vrr.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ bool intel_vrr_is_in_range(struct intel_connector *connector, int vrefresh)
5656
vrefresh <= info->monitor_range.max_vfreq;
5757
}
5858

59+
bool intel_vrr_possible(const struct intel_crtc_state *crtc_state)
60+
{
61+
return crtc_state->vrr.flipline;
62+
}
63+
5964
void
6065
intel_vrr_check_modeset(struct intel_atomic_state *state)
6166
{
@@ -281,7 +286,7 @@ void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state)
281286
intel_de_rmw(display, CHICKEN_TRANS(cpu_transcoder),
282287
0, PIPE_VBLANK_WITH_DELAY);
283288

284-
if (!crtc_state->vrr.flipline) {
289+
if (!intel_vrr_possible(crtc_state)) {
285290
intel_de_write(display,
286291
TRANS_VRR_CTL(display, cpu_transcoder), 0);
287292
return;

drivers/gpu/drm/i915/display/intel_vrr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ struct intel_crtc_state;
1515

1616
bool intel_vrr_is_capable(struct intel_connector *connector);
1717
bool intel_vrr_is_in_range(struct intel_connector *connector, int vrefresh);
18+
bool intel_vrr_possible(const struct intel_crtc_state *crtc_state);
1819
void intel_vrr_check_modeset(struct intel_atomic_state *state);
1920
void intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
2021
struct drm_connector_state *conn_state);

0 commit comments

Comments
 (0)