From: Jason Ekstrand Date: Fri, 25 Oct 2019 21:42:47 +0000 (-0500) Subject: anv: Use anv_block_pool_foreach_bo in get_bo_from_pool X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1be2e4c0ef25a667a2afc0ce6bad1c3c57761fa0;p=mesa.git anv: Use anv_block_pool_foreach_bo in get_bo_from_pool While we're at it, use gen_48b_address(). Reviewed-by: Lionel Landwerlin --- diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 65024de3ed9..3c740c84ea3 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -2334,14 +2334,13 @@ get_bo_from_pool(struct gen_batch_decode_bo *ret, struct anv_block_pool *pool, uint64_t address) { - for (uint32_t i = 0; i < pool->nbos; i++) { - uint64_t bo_address = pool->bos[i].offset & (~0ull >> 16); - uint32_t bo_size = pool->bos[i].size; - if (address >= bo_address && address < (bo_address + bo_size)) { + anv_block_pool_foreach_bo(bo, pool) { + uint64_t bo_address = gen_48b_address(bo->offset); + if (address >= bo_address && address < (bo_address + bo->size)) { *ret = (struct gen_batch_decode_bo) { .addr = bo_address, - .size = bo_size, - .map = pool->bos[i].map, + .size = bo->size, + .map = bo->map, }; return true; }