From 1f9c40a8d1b2ec3702862371af3a934e9a0c9cda Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 26 Aug 2024 10:00:33 +0300 Subject: [PATCH] anv: explicitly disable BT pool allocations at device init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default state doesn't seem well defined (or kernel driver bug maybe?). Let's just set it to disabled on platforms where we're not using it. Signed-off-by: Lionel Landwerlin Cc: mesa-stable Found-by: Chuansheng Liu Reviewed-by: Tapani Pälli Part-of: --- src/intel/vulkan/genX_init_state.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/intel/vulkan/genX_init_state.c b/src/intel/vulkan/genX_init_state.c index 205a098d03d..b6a27b7b231 100644 --- a/src/intel/vulkan/genX_init_state.c +++ b/src/intel/vulkan/genX_init_state.c @@ -312,6 +312,18 @@ init_common_queue_state(struct anv_queue *queue, struct anv_batch *batch) #endif } + /* Disable the POOL_ALLOC mechanism in HW. We found that this state can get + * corrupted (likely due to leaking from another context), the default + * value should be disabled. It doesn't cost anything to set it once at + * device initialization. + */ +#if GFX_VER >= 11 && GFX_VERx10 < 125 + anv_batch_emit(batch, GENX(3DSTATE_BINDING_TABLE_POOL_ALLOC), btpa) { + btpa.MOCS = mocs; + btpa.BindingTablePoolEnable = false; + } +#endif + struct mi_builder b; mi_builder_init(&b, device->info, batch);