freedreno: Add debug flag for forcing linear layouts
authorKristian H. Kristensen <hoegsberg@google.com>
Tue, 26 Nov 2019 05:14:31 +0000 (21:14 -0800)
committerKristian H. Kristensen <hoegsberg@google.com>
Thu, 19 Dec 2019 17:56:05 +0000 (09:56 -0800)
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2848>

src/gallium/drivers/freedreno/freedreno_resource.c
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/freedreno/freedreno_util.h

index 10e9196886f7082f268d17cf1bcba57548323efa..d1df32cab9adef06ecfe716c3bf4abfa2db8da45 100644 (file)
@@ -963,6 +963,9 @@ fd_resource_create_with_modifiers(struct pipe_screen *pscreen,
        if (tmpl->bind & LINEAR)
                linear = true;
 
+       if (fd_mesa_debug & FD_DBG_NOTILE)
+               linear = true;
+
        /* Normally, for non-shared buffers, allow buffer compression if
         * not shared, otherwise only allow if QCOM_COMPRESSED modifier
         * is requested:
index 9113b4ef6b30c14c681d93b720c3abc4ba1800bb..d467cae6b002ea281e86358bb12cb650f96593fb 100644 (file)
@@ -90,6 +90,7 @@ static const struct debug_named_value debug_options[] = {
                {"perfcntrs", FD_DBG_PERFC,  "Expose performance counters"},
                {"noubwc",    FD_DBG_NOUBWC, "Disable UBWC for all internal buffers"},
                {"nolrz",     FD_DBG_NOLRZ,  "Disable LRZ (a6xx)"},
+               {"notile",    FD_DBG_NOTILE, "Disable tiling for all internal buffers"},
                DEBUG_NAMED_VALUE_END
 };
 
index b0dc3e91baab7d9f2b3d6f4d20fa32c622a86b04..33b38472d69d51920febdf1601c6d7daedbc563a 100644 (file)
@@ -61,31 +61,35 @@ enum adreno_stencil_op fd_stencil_op(unsigned op);
 
 #define MAX_RENDER_TARGETS A6XX_MAX_RENDER_TARGETS
 
-#define FD_DBG_MSGS     0x0001
-#define FD_DBG_DISASM   0x0002
-#define FD_DBG_DCLEAR   0x0004
-#define FD_DBG_DDRAW    0x0008
-#define FD_DBG_NOSCIS   0x0010
-#define FD_DBG_DIRECT   0x0020
-#define FD_DBG_NOBYPASS 0x0040
-#define FD_DBG_FRAGHALF 0x0080
-#define FD_DBG_NOBIN    0x0100
-#define FD_DBG_NOGMEM   0x0200
-#define FD_DBG_GLSL120  0x0400
-#define FD_DBG_SHADERDB 0x0800
-#define FD_DBG_FLUSH    0x1000
-#define FD_DBG_DEQP     0x2000
-#define FD_DBG_INORDER  0x4000
-#define FD_DBG_BSTAT    0x8000
-#define FD_DBG_NOGROW  0x10000
-#define FD_DBG_LRZ     0x20000
-#define FD_DBG_NOINDR  0x40000
-#define FD_DBG_NOBLIT  0x80000
-#define FD_DBG_HIPRIO 0x100000
-#define FD_DBG_TTILE  0x200000
-#define FD_DBG_PERFC  0x400000
-#define FD_DBG_NOUBWC 0x800000
-#define FD_DBG_NOLRZ 0x1000000
+enum fd_debug_flag {
+       FD_DBG_MSGS         = BITFIELD_BIT(0),
+       FD_DBG_DISASM       = BITFIELD_BIT(1),
+       FD_DBG_DCLEAR       = BITFIELD_BIT(2),
+       FD_DBG_DDRAW        = BITFIELD_BIT(3),
+       FD_DBG_NOSCIS       = BITFIELD_BIT(4),
+       FD_DBG_DIRECT       = BITFIELD_BIT(5),
+       FD_DBG_NOBYPASS     = BITFIELD_BIT(6),
+       FD_DBG_FRAGHALF     = BITFIELD_BIT(7),
+       FD_DBG_NOBIN        = BITFIELD_BIT(8),
+       FD_DBG_NOGMEM       = BITFIELD_BIT(9),
+       FD_DBG_GLSL120      = BITFIELD_BIT(10),
+       FD_DBG_SHADERDB     = BITFIELD_BIT(11),
+       FD_DBG_FLUSH        = BITFIELD_BIT(12),
+       FD_DBG_DEQP         = BITFIELD_BIT(13),
+       FD_DBG_INORDER      = BITFIELD_BIT(14),
+       FD_DBG_BSTAT        = BITFIELD_BIT(15),
+       FD_DBG_NOGROW       = BITFIELD_BIT(16),
+       FD_DBG_LRZ          = BITFIELD_BIT(17),
+       FD_DBG_NOINDR       = BITFIELD_BIT(18),
+       FD_DBG_NOBLIT       = BITFIELD_BIT(19),
+       FD_DBG_HIPRIO       = BITFIELD_BIT(20),
+       FD_DBG_TTILE        = BITFIELD_BIT(21),
+       FD_DBG_PERFC        = BITFIELD_BIT(22),
+       FD_DBG_NOUBWC       = BITFIELD_BIT(23),
+       FD_DBG_NOLRZ        = BITFIELD_BIT(24),
+       FD_DBG_NOTILE       = BITFIELD_BIT(25),
+};
+
 extern int fd_mesa_debug;
 extern bool fd_binning_enabled;