Mesa (master): virgl: Add debug flag to bypass driconf to enable the BGRA tweaks

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 20 07:18:48 UTC 2019


Module: Mesa
Branch: master
Commit: a478e56fbd33fa23503b63d41265a1c2f3253ed2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a478e56fbd33fa23503b63d41265a1c2f3253ed2

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Mon May 27 16:38:38 2019 +0200

virgl: Add debug flag to bypass driconf to enable the BGRA tweaks

This useful for testing, also because with vtest the dri configuration
is not read.

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh at chromium.org>

---

 src/gallium/drivers/virgl/virgl_screen.c | 5 +++++
 src/gallium/drivers/virgl/virgl_screen.h | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index be684dbf3c1..b2e3117c383 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -43,6 +43,8 @@ int virgl_debug = 0;
 static const struct debug_named_value debug_options[] = {
    { "verbose", VIRGL_DEBUG_VERBOSE, NULL },
    { "tgsi", VIRGL_DEBUG_TGSI, NULL },
+   { "emubgra", VIRGL_DEBUG_EMULATE_BGRA, "Enable tweak to emulate BGRA as RGBA on GLES hosts"},
+   { "bgraswz", VIRGL_DEBUG_BGRA_DEST_SWIZZLE, "Enable tweak to swizzle emulated BGRA on GLES hosts" },
    DEBUG_NAMED_VALUE_END
 };
 DEBUG_GET_ONCE_FLAGS_OPTION(virgl_debug, "VIRGL_DEBUG", debug_options, 0)
@@ -872,6 +874,9 @@ virgl_create_screen(struct virgl_winsys *vws, const struct pipe_screen_config *c
             driQueryOptioni(config->options, VIRGL_GLES_SAMPLES_PASSED_VALUE);
    }
 
+   screen->tweak_gles_emulate_bgra |= !!(virgl_debug & VIRGL_DEBUG_EMULATE_BGRA);
+   screen->tweak_gles_apply_bgra_dest_swizzle |= !!(virgl_debug & VIRGL_DEBUG_BGRA_DEST_SWIZZLE);
+
    screen->vws = vws;
    screen->base.get_name = virgl_get_name;
    screen->base.get_vendor = virgl_get_vendor;
diff --git a/src/gallium/drivers/virgl/virgl_screen.h b/src/gallium/drivers/virgl/virgl_screen.h
index 089402d576d..b7535527b9e 100644
--- a/src/gallium/drivers/virgl/virgl_screen.h
+++ b/src/gallium/drivers/virgl/virgl_screen.h
@@ -29,6 +29,9 @@
 
 #define VIRGL_DEBUG_VERBOSE 1
 #define VIRGL_DEBUG_TGSI    2
+#define VIRGL_DEBUG_EMULATE_BGRA 4
+#define VIRGL_DEBUG_BGRA_DEST_SWIZZLE 4
+
 extern int virgl_debug;
 
 struct virgl_screen {




More information about the mesa-commit mailing list