Skip to content

Commit 96abbed

Browse files
animesh-mannavsyrjala
authored andcommitted
drm/i915/vrr: Split vrr-compute-config in two phases
As vrr guardband calculation is dependent on modified vblank start so better to compute late after all vblank adjustement. v1: Initial version. v2: Split in a separate patch from panel-replay workaround. [Ankit] v3: Add a function for late vrr related computation. [Ville] v4: Use flipline instead of vrr.enable and some cosmetic changes. [Ville] v5: Use intel_vrr_possible helper. Signed-off-by: Animesh Manna <animesh.manna@intel.com> Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com> [vsyrjala: Make adjusted_mode const] Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241010040503.1795399-3-mitulkumar.ajitkumar.golani@intel.com
1 parent ffb7ded commit 96abbed

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5050,6 +5050,8 @@ intel_modeset_pipe_config_late(struct intel_atomic_state *state,
50505050
struct drm_connector *connector;
50515051
int i;
50525052

5053+
intel_vrr_compute_config_late(crtc_state);
5054+
50535055
for_each_new_connector_in_state(&state->base, connector,
50545056
conn_state, i) {
50555057
struct intel_encoder *encoder =

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,16 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
244244
(crtc_state->hw.adjusted_mode.crtc_vtotal -
245245
crtc_state->hw.adjusted_mode.vsync_end);
246246
}
247+
}
248+
249+
void intel_vrr_compute_config_late(struct intel_crtc_state *crtc_state)
250+
{
251+
struct intel_display *display = to_intel_display(crtc_state);
252+
const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
253+
254+
if (!intel_vrr_possible(crtc_state))
255+
return;
247256

248-
/*
249-
* For XE_LPD+, we use guardband and pipeline override
250-
* is deprecated.
251-
*/
252257
if (DISPLAY_VER(display) >= 13) {
253258
crtc_state->vrr.guardband =
254259
crtc_state->vrr.vmin + 1 - adjusted_mode->crtc_vblank_start;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ bool intel_vrr_possible(const struct intel_crtc_state *crtc_state);
1919
void intel_vrr_check_modeset(struct intel_atomic_state *state);
2020
void intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
2121
struct drm_connector_state *conn_state);
22+
void intel_vrr_compute_config_late(struct intel_crtc_state *crtc_state);
2223
void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state);
2324
void intel_vrr_enable(const struct intel_crtc_state *crtc_state);
2425
void intel_vrr_send_push(const struct intel_crtc_state *crtc_state);

0 commit comments

Comments
 (0)