From 1588bfe24659644cdeba87fb3d3f40116a590d42 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 Ported from upstream: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30841?commit_id=1f9c40a8d1b2ec3702862371af3a934e9a0c9cda 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: Tracked-On: OAM-124615 Signed-off-by: Lin, Shenghua --- 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 da994697c7e..06e1abe024d 100644 --- a/src/intel/vulkan/genX_init_state.c +++ b/src/intel/vulkan/genX_init_state.c @@ -305,6 +305,18 @@ init_common_queue_state(struct anv_queue *queue, struct anv_batch *batch) sba.L1CacheControl = L1CC_WB; #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 #endif #if GFX_VERx10 >= 125