mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
anv: Add an anv_address_map helper
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16970>
This commit is contained in:
parent
191fab68b0
commit
4388b8b253
1 changed files with 12 additions and 0 deletions
|
|
@ -586,6 +586,18 @@ anv_address_add(struct anv_address addr, uint64_t offset)
|
|||
return addr;
|
||||
}
|
||||
|
||||
static inline void *
|
||||
anv_address_map(struct anv_address addr)
|
||||
{
|
||||
if (addr.bo == NULL)
|
||||
return NULL;
|
||||
|
||||
if (addr.bo->map == NULL)
|
||||
return NULL;
|
||||
|
||||
return addr.bo->map + addr.offset;
|
||||
}
|
||||
|
||||
/* Represents a lock-free linked list of "free" things. This is used by
|
||||
* both the block pool and the state pools. Unfortunately, in order to
|
||||
* solve the ABA problem, we can't use a single uint32_t head.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue