gallium/radeon: add a debug flag not to use write combining (v2)
authorMarek Olšák <marek.olsak@amd.com>
Sun, 2 Aug 2015 14:22:43 +0000 (16:22 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 10 Aug 2015 16:26:44 +0000 (18:26 +0200)
v2: just clear the flag before the allocation

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeon/r600_buffer_common.c
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_pipe_common.h

index 5b5c06362a72ae1d0a1bf10c4b66fc5e6af5de3c..0f788b7e23c912e6faa0706bc2ab8a801fdc589e 100644 (file)
@@ -161,6 +161,9 @@ bool r600_init_resource(struct r600_common_screen *rscreen,
                flags |= RADEON_FLAG_NO_CPU_ACCESS;
        }
 
+       if (rscreen->debug_flags & DBG_NO_WC)
+               flags &= ~RADEON_FLAG_GTT_WC;
+
        /* Allocate a new resource. */
        new_buf = rscreen->ws->buffer_create(rscreen->ws, size, alignment,
                                             use_reusable_pool,
index 3f1c0f0eae97061cf3dc1e51d81b6a7974fa974a..c9b89295e83b9a90bad572567ba0a3c56e6e30eb 100644 (file)
@@ -355,6 +355,7 @@ static const struct debug_named_value common_debug_options[] = {
        { "switch_on_eop", DBG_SWITCH_ON_EOP, "Program WD/IA to switch on end-of-packet." },
        { "forcedma", DBG_FORCE_DMA, "Use asynchronous DMA for all operations when possible." },
        { "precompile", DBG_PRECOMPILE, "Compile one shader variant at shader creation." },
+       { "nowc", DBG_NO_WC, "Disable GTT write combining" },
 
        DEBUG_NAMED_VALUE_END /* must be last */
 };
index ce3f396011f2fc69ee3505e5b2a49967a59fec96..85ac22f3c7eba3f3c6c82864b10a6464f25deb1a 100644 (file)
@@ -97,6 +97,7 @@
 #define DBG_FORCE_DMA          (1llu << 38)
 #define DBG_PRECOMPILE         (1llu << 39)
 #define DBG_INFO               (1llu << 40)
+#define DBG_NO_WC              (1llu << 41)
 
 #define R600_MAP_BUFFER_ALIGNMENT 64