mirror of
https://github.com/X11Libre/xf86-video-ati.git
synced 2026-03-24 01:24:43 +00:00
DRI2: add interpolated blanks to frame number in event handlers
The 'frame' argument passed to event handlers is the plain CRTC vblank counter that stops progressing when the associated display is in DPMS-off mode. If we have a DPMS-off period the frame counter and MSC will diverge, which can cause some higher-level functions to return incorrect values. This patch fixes the problem by adding interpolated vblanks to the frame counter before using it in handler functions. Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Michel Dänzer
parent
385a92b4fb
commit
bd2557ea5e
@@ -799,6 +799,9 @@ void radeon_dri2_frame_event_handler(unsigned int frame, unsigned int tv_sec,
|
||||
M_ANY, DixWriteAccess);
|
||||
if (status != Success)
|
||||
goto cleanup;
|
||||
if (!event->crtc)
|
||||
goto cleanup;
|
||||
frame += radeon_get_interpolated_vblanks(event->crtc);
|
||||
|
||||
screen = drawable->pScreen;
|
||||
scrn = xf86ScreenToScrn(screen);
|
||||
@@ -1254,6 +1257,11 @@ void radeon_dri2_flip_event_handler(unsigned int frame, unsigned int tv_sec,
|
||||
free(flip);
|
||||
return;
|
||||
}
|
||||
if (!flip->crtc) {
|
||||
free(flip);
|
||||
return;
|
||||
}
|
||||
frame += radeon_get_interpolated_vblanks(flip->crtc);
|
||||
|
||||
screen = drawable->pScreen;
|
||||
scrn = xf86ScreenToScrn(screen);
|
||||
|
||||
Reference in New Issue
Block a user