summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-11-02 19:19:20 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-11-02 21:10:39 +0000
commitb5ac286c9bb0e13c5c23b2f76c7b9445587371df (patch)
treeb7a7bc30d54ee5b71002d06acc5e1ba68a1373fe
parentbff5eca49b27cb47673123222a714d2a6f56287f (diff)
sna: Close each client op with an arbitrartion check
Minimise preemption latency by frequently checking for pending preemption events in between X11 client requests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c2
-rw-r--r--src/sna/sna_reg.h1
-rw-r--r--src/sna/sna_render.c3
3 files changed, 6 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index fa386ff6..a464f4b4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -5302,6 +5302,8 @@ inline static void blt_done(struct sna *sna)
DBG(("%s: flushing BLT operation on empty ring\n",
__FUNCTION__));
_kgem_submit(&sna->kgem);
+ } else {
+ sna->kgem.batch[sna->kgem.nbatch++] = MI_ARB_CHECK;
}
}
diff --git a/src/sna/sna_reg.h b/src/sna/sna_reg.h
index 92a1ae57..0531fabf 100644
--- a/src/sna/sna_reg.h
+++ b/src/sna/sna_reg.h
@@ -14,6 +14,7 @@
/* broadwater flush bits */
#define BRW_MI_GLOBAL_SNAPSHOT_RESET (1 << 3)
+#define MI_ARB_CHECK (0x5 << 23)
#define MI_BATCH_BUFFER_END (0xA << 23)
/* Noop */
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 904d4400..7145da90 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -32,6 +32,7 @@
#include "sna.h"
#include "sna_render.h"
#include "sna_render_inline.h"
+#include "sna_reg.h"
#include "fb/fbpict.h"
#define NO_REDIRECT 0
@@ -2129,6 +2130,8 @@ sna_render_composite_redirect_done(struct sna *sna,
kgem_bo_destroy(&sna->kgem, op->dst.bo);
}
+
+ batch_emit(sna, MI_ARB_CHECK);
}
static bool