mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
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 <lionel.g.landwerlin@intel.com>
This commit is contained in:
parent
3178e583c8
commit
1be2e4c0ef
1 changed files with 5 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue