aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-11-11 12:46:33 -0600
committerJason Ekstrand <[email protected]>2019-12-03 17:10:51 -0600
commit178a2946c0b998c1f1c8a70b135b3b1507b4b11a (patch)
tree8f4e17f1a3681e303b425e385b22281c807486d5 /src/intel
parent07adc4746041cd39e4cbfe1ca1bab078931b6c4b (diff)
anv: Respect the always_flush_cache driconf option
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_device.c7
-rw-r--r--src/intel/vulkan/anv_private.h2
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c3
3 files changed, 12 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 250f75e9936..0993a505075 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -54,6 +54,10 @@ DRI_CONF_BEGIN
DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT("false")
DRI_CONF_SECTION_END
+
+ DRI_CONF_SECTION_DEBUG
+ DRI_CONF_ALWAYS_FLUSH_CACHE("false")
+ DRI_CONF_SECTION_END
DRI_CONF_END;
/* This is probably far to big but it reflects the max size used for messages
@@ -509,6 +513,9 @@ anv_physical_device_init(struct anv_physical_device *device,
device->has_mem_available = get_available_system_memory() != 0;
+ device->always_flush_cache =
+ driQueryOptionb(&instance->dri_options, "always_flush_cache");
+
/* Starting with Gen10, the timestamp frequency of the command streamer may
* vary from one part to another. We can query the value from the kernel.
*/
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 8fa0d74f5aa..d42a3ccfdbf 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -1002,6 +1002,8 @@ struct anv_physical_device {
/** True if we can use bindless access for samplers */
bool has_bindless_samplers;
+ bool always_flush_cache;
+
struct anv_device_extension_table supported_extensions;
struct anv_physical_device_dispatch_table dispatch;
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 42d5b452699..67500f91cdf 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -1800,6 +1800,9 @@ genX(cmd_buffer_apply_pipe_flushes)(struct anv_cmd_buffer *cmd_buffer)
{
enum anv_pipe_bits bits = cmd_buffer->state.pending_pipe_bits;
+ if (cmd_buffer->device->instance->physicalDevice.always_flush_cache)
+ bits |= ANV_PIPE_FLUSH_BITS | ANV_PIPE_INVALIDATE_BITS;
+
/* Flushes are pipelined while invalidations are handled immediately.
* Therefore, if we're flushing anything then we need to schedule a stall
* before any invalidations can happen.