From ce49340a1348dd36fabffcf9afb4039e513659f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Tue, 1 Jul 2025 12:53:55 -0700 Subject: [PATCH] anv: Use anv_device_get_scratch_surface_state_pool() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Jordan Justen Signed-off-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_allocator.c | 6 +++--- src/intel/vulkan/anv_device.c | 10 +++++----- src/intel/vulkan/i915/anv_batch_chain.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index 503e9d94e64..51e36e44c40 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -1369,7 +1369,7 @@ anv_scratch_pool_finish(struct anv_device *device, struct anv_scratch_pool *pool for (unsigned i = 0; i < 16; i++) { if (pool->surf_states[i].map != NULL) { - anv_state_pool_free(&device->scratch_surface_state_pool, + anv_state_pool_free(anv_device_get_scratch_surface_state_pool(device), pool->surf_states[i]); } } @@ -1465,7 +1465,7 @@ anv_scratch_pool_get_surf(struct anv_device *device, struct anv_address addr = { .bo = bo }; struct anv_state state = - anv_state_pool_alloc(&device->scratch_surface_state_pool, + anv_state_pool_alloc(anv_device_get_scratch_surface_state_pool(device), device->isl_dev.ss.size, 64); isl_surf_usage_flags_t usage = @@ -1484,7 +1484,7 @@ anv_scratch_pool_get_surf(struct anv_device *device, uint32_t current = p_atomic_cmpxchg(&pool->surfs[bucket], 0, state.offset); if (current) { - anv_state_pool_free(&device->scratch_surface_state_pool, state); + anv_state_pool_free(anv_device_get_scratch_surface_state_pool(device), state); return current; } else { pool->surf_states[bucket] = state; diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index a9fb50068f4..9c0f0189a8a 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -154,7 +154,7 @@ decode_get_bo(void *v_batch, bool ppgtt, uint64_t address) return ret_bo; if (get_bo_from_pool(&ret_bo, &anv_device_get_binding_table_pool(device)->block_pool, address)) return ret_bo; - if (get_bo_from_pool(&ret_bo, &device->scratch_surface_state_pool.block_pool, address)) + if (get_bo_from_pool(&ret_bo, &anv_device_get_scratch_surface_state_pool(device)->block_pool, address)) return ret_bo; if (device->physical->indirect_descriptors && get_bo_from_pool(&ret_bo, &device->bindless_surface_state_pool.block_pool, address)) @@ -347,7 +347,7 @@ anv_device_init_descriptors_view(struct anv_device *device) /* For descriptor buffers */ { device->descriptor_buffer_view_state = - anv_state_pool_alloc(&device->scratch_surface_state_pool, + anv_state_pool_alloc(anv_device_get_scratch_surface_state_pool(device), device->isl_dev.ss.size, 64); const uint64_t size = pdevice->va.dynamic_visible_pool.size + @@ -369,7 +369,7 @@ anv_device_init_descriptors_view(struct anv_device *device) /* For descriptors */ { device->descriptor_view_state = - anv_state_pool_alloc(&device->scratch_surface_state_pool, + anv_state_pool_alloc(anv_device_get_scratch_surface_state_pool(device), device->isl_dev.ss.size, 64); const uint64_t size = @@ -395,9 +395,9 @@ anv_device_finish_descriptors_view(struct anv_device *device) if (!device->info->has_lsc) return; - anv_state_pool_free(&device->scratch_surface_state_pool, + anv_state_pool_free(anv_device_get_scratch_surface_state_pool(device), device->descriptor_buffer_view_state); - anv_state_pool_free(&device->scratch_surface_state_pool, + anv_state_pool_free(anv_device_get_scratch_surface_state_pool(device), device->descriptor_view_state); } diff --git a/src/intel/vulkan/i915/anv_batch_chain.c b/src/intel/vulkan/i915/anv_batch_chain.c index 1a43759a52f..69aa064cb4b 100644 --- a/src/intel/vulkan/i915/anv_batch_chain.c +++ b/src/intel/vulkan/i915/anv_batch_chain.c @@ -407,7 +407,7 @@ setup_execbuf_for_cmd_buffers(struct anv_execbuf *execbuf, } /* Add all the global BOs to the object list for softpin case. */ - result = pin_state_pool(device, execbuf, &device->scratch_surface_state_pool); + result = pin_state_pool(device, execbuf, anv_device_get_scratch_surface_state_pool(device)); if (result != VK_SUCCESS) return result;