lima: enable multi submit optimization
authorQiang Yu <yuq825@gmail.com>
Fri, 7 Feb 2020 12:32:51 +0000 (20:32 +0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 17 Feb 2020 02:54:15 +0000 (02:54 +0000)
Also provide a debug option to disable it.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3755>

src/gallium/drivers/lima/lima_screen.c
src/gallium/drivers/lima/lima_screen.h
src/gallium/drivers/lima/lima_state.c

index 9f28329785714aee87513a2155e737f831ac7950..82d99a5e6790e1090c7b1aa023037d6efa4e46fc 100644 (file)
@@ -466,6 +466,8 @@ static const struct debug_named_value debug_options[] = {
           "don't use tiled buffers" },
         { "nogrowheap",   LIMA_DEBUG_NO_GROW_HEAP,
           "disable growable heap buffer" },
+        { "singlesubmit", LIMA_DEBUG_SINGLE_SUBMIT,
+          "disable multi submit optimization" },
         { NULL }
 };
 
index fd6ec4e368f412017e2a9f250a22b839180458cb..e3cd40112c4978faa8d5968272266812b83346f4 100644 (file)
@@ -41,6 +41,7 @@
 #define LIMA_DEBUG_BO_CACHE       (1 << 5)
 #define LIMA_DEBUG_NO_TILING      (1 << 6)
 #define LIMA_DEBUG_NO_GROW_HEAP   (1 << 7)
+#define LIMA_DEBUG_SINGLE_SUBMIT  (1 << 8)
 
 extern uint32_t lima_debug;
 extern int lima_ctx_num_plb;
index 45795249a395709deb5516364c0ff32bfcbdb2ef..2b48a3a124cc766d1a333a5e7c36b004291b7511 100644 (file)
@@ -41,8 +41,9 @@ lima_set_framebuffer_state(struct pipe_context *pctx,
 {
    struct lima_context *ctx = lima_context(pctx);
 
-   /* submit need framebuffer info, flush before change it */
-   lima_flush(ctx);
+   /* make sure there are always single submit in this context */
+   if (lima_debug & LIMA_DEBUG_SINGLE_SUBMIT)
+      lima_flush(ctx);
 
    struct lima_context_framebuffer *fb = &ctx->framebuffer;