sna: Run the deferred flush at vrefresh

This helps to reduce the perceived jerkiness of the redraw.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42413
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-11-04 23:30:09 +00:00
parent 8052c3904a
commit 676cb4e38d
4 changed files with 8 additions and 8 deletions

View File

@ -225,7 +225,7 @@ struct sna {
int timer[NUM_TIMERS];
int timer_active;
int flush_interval;
int vblank_interval;
struct list deferred_free;
struct list dirty_pixmaps;

View File

@ -8089,13 +8089,13 @@ static Bool sna_accel_do_flush(struct sna *sna)
DBG(("%s, starting flush timer, at time=%ld\n",
__FUNCTION__, (long)GetTimeInMillis()));
/* Initial redraw after 10ms. */
/* Initial redraw hopefully before this vblank */
to.it_value.tv_sec = 0;
to.it_value.tv_nsec = 10 * 1000 * 1000;
to.it_value.tv_nsec = sna->vblank_interval / 2;
/* Then periodic updates at half-vrefresh (update every other vblank) */
/* Then periodic updates for every vblank */
to.it_interval.tv_sec = 0;
to.it_interval.tv_nsec = sna->flush_interval;
to.it_interval.tv_nsec = sna->vblank_interval;
timerfd_settime(sna->timer[FLUSH_TIMER], 0, &to, NULL);
sna->timer_active |= 1 << FLUSH_TIMER;

View File

@ -601,7 +601,7 @@ static void update_flush_interval(struct sna *sna)
if (max_vrefresh == 0)
max_vrefresh = 40;
sna->flush_interval = 2000 * 1000 * 1000 / max_vrefresh;
sna->vblank_interval = 1000 * 1000 * 1000 / max_vrefresh; /* Hz -> ns */
DBG(("max_vrefresh=%d, flush_interval=%d ns\n",
max_vrefresh, sna->flush_interval));
}

View File

@ -504,8 +504,8 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
if (xf86ReturnOptValBool(sna->Options, OPTION_TILING_FB, FALSE))
sna->tiling &= ~SNA_TILING_FB;
/* Default fail-safe value of 25 Hz */
sna->flush_interval = 40 * 1000 * 1000;
/* Default fail-safe value of 75 Hz */
sna->vblank_interval = 1000 * 1000 * 1000 / 75;
sna->flags = 0;
if (!xf86ReturnOptValBool(sna->Options, OPTION_THROTTLE, TRUE))