From f733215c12438c8902fdc819376072b4cc9fb48d Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 13 Feb 2024 10:39:05 +0000 Subject: [PATCH] anv: enable query clear/copy using shaders on MTL/ARL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems like an L3 setting is different between DG2 & MTL, breaking the L3 coherency with CS. We can apply the same tile cache flush as we do on TGL for now until we figure out how to configure L3 properly to avoid this. Tested with : $ query_clear_with_blorp_threshold=0 query_copy_with_shader_threshold=0 ./deqp-vk -n dEQP-VK.query_pool.* to force the shader optimizations. Signed-off-by: Lionel Landwerlin Reviewed-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_private.h | 9 +++++---- src/intel/vulkan/genX_query.c | 8 ++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 441a1ecefeb..625e39002ba 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -3092,10 +3092,11 @@ enum anv_query_bits { * vkCopyQueryPoolResults(). */ #define ANV_QUERY_RENDER_TARGET_WRITES_PENDING_BITS(devinfo) \ - (((devinfo->verx10 >= 120 && \ - devinfo->verx10 < 125) ? ANV_QUERY_WRITES_TILE_FLUSH : 0) | \ - ANV_QUERY_WRITES_RT_FLUSH | \ - ANV_QUERY_WRITES_CS_STALL) + (((!ANV_DEVINFO_HAS_COHERENT_L3_CS(devinfo) && \ + devinfo->ver >= 12) ? \ + ANV_QUERY_WRITES_TILE_FLUSH : 0) | \ + ANV_QUERY_WRITES_RT_FLUSH | \ + ANV_QUERY_WRITES_CS_STALL) #define ANV_QUERY_COMPUTE_WRITES_PENDING_BITS \ (ANV_QUERY_WRITES_DATA_FLUSH | \ ANV_QUERY_WRITES_CS_STALL) diff --git a/src/intel/vulkan/genX_query.c b/src/intel/vulkan/genX_query.c index 1e11ed90f71..d034ebfbbe7 100644 --- a/src/intel/vulkan/genX_query.c +++ b/src/intel/vulkan/genX_query.c @@ -782,10 +782,7 @@ void genX(CmdResetQueryPool)( ANV_FROM_HANDLE(anv_query_pool, pool, queryPool); struct anv_physical_device *pdevice = cmd_buffer->device->physical; - /* Temporarily disable on MTL until we understand why some tests hang. - */ - if (queryCount >= pdevice->instance->query_clear_with_blorp_threshold && - !intel_device_info_is_mtl_or_arl(cmd_buffer->device->info)) { + if (queryCount >= pdevice->instance->query_clear_with_blorp_threshold) { trace_intel_begin_query_clear_blorp(&cmd_buffer->trace); anv_cmd_buffer_fill_area(cmd_buffer, @@ -1840,8 +1837,7 @@ void genX(CmdCopyQueryPoolResults)( struct anv_device *device = cmd_buffer->device; struct anv_physical_device *pdevice = device->physical; - if (queryCount > pdevice->instance->query_copy_with_shader_threshold && - !intel_device_info_is_mtl_or_arl(device->info)) { + if (queryCount > pdevice->instance->query_copy_with_shader_threshold) { copy_query_results_with_shader(cmd_buffer, pool, anv_address_add(buffer->address, destOffset),