summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sna/kgem.c6
-rw-r--r--src/sna/kgem.h6
-rw-r--r--src/sna/sna_accel.c6
3 files changed, 14 insertions, 4 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 568d1200..7495fb94 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3438,6 +3438,8 @@ bool kgem_check_bo(struct kgem *kgem, ...)
int num_exec = 0;
int num_pages = 0;
+ kgem_flush(kgem);
+
va_start(ap, kgem);
while ((bo = va_arg(ap, struct kgem_bo *))) {
if (bo->exec)
@@ -3472,6 +3474,8 @@ bool kgem_check_bo_fenced(struct kgem *kgem, struct kgem_bo *bo)
{
uint32_t size;
+ kgem_flush(kgem);
+
while (bo->proxy)
bo = bo->proxy;
if (bo->exec) {
@@ -3515,6 +3519,8 @@ bool kgem_check_many_bo_fenced(struct kgem *kgem, ...)
int num_pages = 0;
int fenced_size = 0;
+ kgem_flush(kgem);
+
va_start(ap, kgem);
while ((bo = va_arg(ap, struct kgem_bo *))) {
while (bo->proxy)
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index d8018b80..3bf01525 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -277,6 +277,12 @@ static inline void kgem_submit(struct kgem *kgem)
_kgem_submit(kgem);
}
+static inline void kgem_flush(struct kgem *kgem)
+{
+ if (kgem->flush && kgem_is_idle(kgem))
+ _kgem_submit(kgem);
+}
+
static inline void kgem_bo_submit(struct kgem *kgem, struct kgem_bo *bo)
{
if (bo->exec)
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index fd9728c9..02d4b13c 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1025,10 +1025,8 @@ void sna_add_flush_pixmap(struct sna *sna,
assert(bo);
list_move(&priv->list, &sna->flush_pixmaps);
- if (bo->exec == NULL && sna->kgem.need_retire)
- kgem_retire(&sna->kgem);
- if (bo->exec == NULL || !sna->kgem.need_retire) {
- DBG(("%s: flush bo idle, flushing\n", __FUNCTION__));
+ if (bo->exec == NULL) {
+ DBG(("%s: new flush bo, flushin before\n", __FUNCTION__));
kgem_submit(&sna->kgem);
}
}