From b0dfd8223adee87e28b391a019effa7bb3630533 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 13 May 2012 08:33:23 +0100 Subject: [PATCH] sna: Flush the batch before blocking if the GPU is idle If we have work pending for the GPU and we believe it is idle, just submit the batch in order to improve GPU/CPU concurrency and reduce latency. Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index b8ca2147..1467fa32 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -12334,6 +12334,11 @@ void sna_accel_block_handler(struct sna *sna, struct timeval **tv) { sna->time = GetTimeInMillis(); + if (!sna->kgem.need_retire) { + kgem_submit(&sna->kgem); + sna->kgem.flush_now = 0; + } + if (sna_accel_do_flush(sna)) sna_accel_flush(sna);