Mainly for testing, FD_MESA_DEBUG=hiprio will force high priority
contexts.

Signed-off-by: Rob Clark <robdcl...@gmail.com>
---
 src/gallium/drivers/freedreno/freedreno_context.c | 4 +++-
 src/gallium/drivers/freedreno/freedreno_screen.c  | 1 +
 src/gallium/drivers/freedreno/freedreno_util.h    | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_context.c 
b/src/gallium/drivers/freedreno/freedreno_context.c
index 7fdb848f380..fe46f710b87 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -253,7 +253,9 @@ fd_context_init(struct fd_context *ctx, struct pipe_screen 
*pscreen,
        int i;
 
        /* lower numerical value == higher priority: */
-       if (flags & PIPE_CONTEXT_HIGH_PRIORITY)
+       if (fd_mesa_debug & FD_DBG_HIPRIO)
+               prio = 0;
+       else if (flags & PIPE_CONTEXT_HIGH_PRIORITY)
                prio = 0;
        else if (flags & PIPE_CONTEXT_LOW_PRIORITY)
                prio = 2;
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
b/src/gallium/drivers/freedreno/freedreno_screen.c
index aa451f501ff..8807fe86189 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -79,6 +79,7 @@ static const struct debug_named_value debug_options[] = {
                {"bstat",     FD_DBG_BSTAT,  "Print batch stats at context 
destroy"},
                {"nogrow",    FD_DBG_NOGROW, "Disable \"growable\" cmdstream 
buffers, even if kernel supports it"},
                {"lrz",       FD_DBG_LRZ,    "Enable experimental LRZ support 
(a5xx+)"},
+               {"hiprio",    FD_DBG_HIPRIO, "Force high-priority context"},
                DEBUG_NAMED_VALUE_END
 };
 
diff --git a/src/gallium/drivers/freedreno/freedreno_util.h 
b/src/gallium/drivers/freedreno/freedreno_util.h
index 14fcf1d6725..3ef669ca861 100644
--- a/src/gallium/drivers/freedreno/freedreno_util.h
+++ b/src/gallium/drivers/freedreno/freedreno_util.h
@@ -80,6 +80,7 @@ enum adreno_stencil_op fd_stencil_op(unsigned op);
 #define FD_DBG_BSTAT    0x8000
 #define FD_DBG_NOGROW  0x10000
 #define FD_DBG_LRZ     0x20000
+#define FD_DBG_HIPRIO  0x40000
 
 extern int fd_mesa_debug;
 extern bool fd_binning_enabled;
-- 
2.13.5

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to