forked from 12to11/12to11
Slightly improve frame prediction cutoff point
* frame_clock.c (PostEndFrame): Use 5000 us by default, only reverting to the old algorithm if the presentation time is less than that.
This commit is contained in:
parent
19f6f6454c
commit
491f1a6a1c
1 changed files with 16 additions and 5 deletions
|
@ -30,6 +30,10 @@ enum
|
||||||
{
|
{
|
||||||
/* 150ms. */
|
/* 150ms. */
|
||||||
MaxPresentationAge = 150000,
|
MaxPresentationAge = 150000,
|
||||||
|
/* 5000 microseconds. This arbitrary value is the longest it
|
||||||
|
normally takes for a sync counter update to be processed by the
|
||||||
|
compositor. */
|
||||||
|
PresentationThreshold = 5000,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Whether or not the compositor supports frame synchronization. */
|
/* Whether or not the compositor supports frame synchronization. */
|
||||||
|
@ -333,9 +337,16 @@ PostEndFrame (FrameClock *clock)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use 3/4ths of the presentation time. Any more and we risk the
|
/* Use 5000 microseconds before the presentation time, or 3/4th of
|
||||||
counter value change signalling the end of the frame arriving
|
it if it is less than 5000. Any more and we risk the counter
|
||||||
after the presentation deadline. */
|
value change signalling the end of the frame arriving after the
|
||||||
|
presentation deadline. */
|
||||||
|
if (clock->presentation_time > PresentationThreshold)
|
||||||
|
target = target - (clock->presentation_time - PresentationThreshold);
|
||||||
|
else
|
||||||
|
/* However, if the presentation time is less than 5000
|
||||||
|
microseconds, use 3/4ths of it. This computation seems to be a
|
||||||
|
good enough fallback. */
|
||||||
target = target - (clock->presentation_time / 4 * 3);
|
target = target - (clock->presentation_time / 4 * 3);
|
||||||
|
|
||||||
/* Add the remainder of now if it was probably truncated by the
|
/* Add the remainder of now if it was probably truncated by the
|
||||||
|
|
Loading…
Add table
Reference in a new issue