anv: Respect the always_flush_cache driconf option

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
Jason Ekstrand 2019-11-11 12:46:33 -06:00
parent 07adc47460
commit 178a2946c0
3 changed files with 12 additions and 0 deletions

View file

@ -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.
*/

View file

@ -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;

View file

@ -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.