Skip to content

Commit 59ad01c

Browse files
vsyrjalajnikula
authored andcommitted
drm/i915: Update vblank timestamping stuff on seamless M/N change
When we change the M/N values seamlessly during a fastset we should also update the vblank timestamping stuff to make sure the vblank timestamp corrections/guesstimations come out exact. Note that only crtc_clock and framedur_ns can actually end up changing here during fastsets. Everything else we touch can only change during full modesets. Technically we should try to do this exactly at the start of vblank, but that would require some kind of double buffering scheme. Let's skip that for now and just update things right after the commit has been submitted to the hardware. This means the information will be properly up to date when the vblank irq handler goes to work. Only if someone ends up querying some vblanky stuff in between the commit and start of vblank may we see a slight discrepancy. Also this same problem really exists for the DRRS downclocking stuff. But as that is supposed to be more or less transparent to the user, and it only drops to low gear after a long delay (1 sec currently) we probably don't have to worry about it. Any time something is actively submitting updates DRRS will remain in high gear and so the timestamping constants will match the hardware state. Reviewed-by: Jani Nikula <[email protected]> Reviewed-by: Mitul Golani <[email protected]> Fixes: e6f2992 ("drm/i915: Allow M/N change during fastset on bdw+") Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 8cb1f95) Signed-off-by: Jani Nikula <[email protected]>
1 parent f8d62aa commit 59ad01c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,14 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state)
683683
*/
684684
intel_vrr_send_push(new_crtc_state);
685685

686+
/*
687+
* Seamless M/N update may need to update frame timings.
688+
*
689+
* FIXME Should be synchronized with the start of vblank somehow...
690+
*/
691+
if (new_crtc_state->seamless_m_n && intel_crtc_needs_fastset(new_crtc_state))
692+
intel_crtc_update_active_timings(new_crtc_state);
693+
686694
local_irq_enable();
687695

688696
if (intel_vgpu_active(dev_priv))

0 commit comments

Comments
 (0)