summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-10 11:05:16 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-12-10 11:05:16 +0000
commit3e9120d73c6f0c0e06b617da91cc2edce4434bc3 (patch)
tree0e488bf7d615a0cd3e8453b9e5440ec6e85a79df /src
parentaa8c5d8201006397bb32ed6bc28618f9aa77a68a (diff)
sna: Immediately flush a split batch
If we submit a batch early (for example if the GPU is idle), then submit whatever else the client drew immediately upon completion of its blockhandler. This is required to prevent flashing due to visible delay between the clear at the start of the cycle and then the overdraw later. References: https://bugs.freedesktop.org/show_bug.cgi?id=51718 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/kgem.c1
-rw-r--r--src/sna/sna_accel.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 921fdf8e..faeb70d2 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1968,6 +1968,7 @@ static void kgem_commit(struct kgem *kgem)
}
kgem->next_request = NULL;
+ kgem->busy = true;
}
static void kgem_close_list(struct kgem *kgem, struct list *head)
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index e996cdb2..43ed159e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -14181,6 +14181,8 @@ static bool sna_picture_init(ScreenPtr screen)
ps = GetPictureScreen(screen);
assert(ps != NULL);
+ assert(ps->CreatePicture != NULL);
+ assert(ps->DestroyPicture != NULL);
ps->Composite = sna_composite;
ps->CompositeRects = sna_composite_rectangles;
@@ -14377,7 +14379,8 @@ void sna_accel_block_handler(struct sna *sna, struct timeval **tv)
if (sna->timer_active)
UpdateCurrentTimeIf();
- if (sna->kgem.nbatch && kgem_ring_is_idle(&sna->kgem, sna->kgem.ring)) {
+ if (sna->kgem.nbatch &&
+ (sna->kgem.busy || kgem_ring_is_idle(&sna->kgem, sna->kgem.ring))) {
DBG(("%s: GPU idle, flushing\n", __FUNCTION__));
_kgem_submit(&sna->kgem);
}
@@ -14429,6 +14432,8 @@ set_tv:
(*tv)->tv_usec = timeout % 1000 * 1000;
}
}
+
+ sna->kgem.busy = false;
}
void sna_accel_wakeup_handler(struct sna *sna)