sna: Only retire the flush handler if nothing was submitted within the period
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
7758e33340
commit
1d82fe3e52
|
|
@ -186,6 +186,8 @@ static int gem_read(int fd, uint32_t handle, const void *dst, int length)
|
|||
Bool kgem_bo_write(struct kgem *kgem, struct kgem_bo *bo,
|
||||
const void *data, int length)
|
||||
{
|
||||
assert(!gem_busy(kgem->fd, bo->handle));
|
||||
|
||||
if (gem_write(kgem->fd, bo->handle, 0, length, data))
|
||||
return FALSE;
|
||||
|
||||
|
|
@ -1022,6 +1024,7 @@ void _kgem_submit(struct kgem *kgem)
|
|||
kgem_cleanup(kgem);
|
||||
|
||||
kgem_reset(kgem);
|
||||
kgem->busy = 1;
|
||||
}
|
||||
|
||||
void kgem_throttle(struct kgem *kgem)
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ struct kgem {
|
|||
uint32_t flush:1;
|
||||
uint32_t need_expire:1;
|
||||
uint32_t need_purge:1;
|
||||
uint32_t busy:1;
|
||||
|
||||
uint32_t has_vmap :1;
|
||||
uint32_t has_relaxed_fencing :1;
|
||||
|
|
|
|||
|
|
@ -4064,13 +4064,15 @@ static bool sna_accel_flush(struct sna *sna)
|
|||
bool nothing_to_do =
|
||||
priv->cpu_damage == NULL && priv->gpu_bo->rq == NULL;
|
||||
|
||||
DBG(("%s (time=%ld), nothing_to_do=%d\n",
|
||||
__FUNCTION__, (long)GetTimeInMillis(), nothing_to_do));
|
||||
DBG(("%s (time=%ld), nothing_to_do=%d, busy? %d\n",
|
||||
__FUNCTION__, (long)GetTimeInMillis(),
|
||||
nothing_to_do, sna->kgem.busy));
|
||||
|
||||
if (nothing_to_do)
|
||||
if (nothing_to_do && !sna->kgem.busy)
|
||||
_sna_accel_disarm_timer(sna, FLUSH_TIMER);
|
||||
else
|
||||
sna_pixmap_move_to_gpu(priv->pixmap);
|
||||
sna->kgem.busy = 0;
|
||||
kgem_bo_flush(&sna->kgem, priv->gpu_bo);
|
||||
return !nothing_to_do;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue