mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
asahi: add sparse emu helpers
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34486>
This commit is contained in:
parent
c2d00c94b1
commit
546bc893f1
1 changed files with 21 additions and 0 deletions
|
|
@ -177,6 +177,27 @@ struct agx_device {
|
|||
struct u_printf_ctx printf;
|
||||
};
|
||||
|
||||
/*
|
||||
* Determine if an address is in the read-only section. See the documentation
|
||||
* for sparse_ro_offset.
|
||||
*/
|
||||
static inline bool
|
||||
agx_addr_is_ro(struct agx_device *dev, uint64_t addr)
|
||||
{
|
||||
return (addr & dev->sparse_ro_offset);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a read-write address to its read-only shadow address. See the
|
||||
* documentation for sparse_ro_offset.
|
||||
*/
|
||||
static inline uint64_t
|
||||
agx_rw_addr_to_ro(struct agx_device *dev, uint64_t addr)
|
||||
{
|
||||
assert(!agx_addr_is_ro(dev, addr));
|
||||
return addr + dev->sparse_ro_offset;
|
||||
}
|
||||
|
||||
static inline void *
|
||||
agx_bo_map(struct agx_bo *bo)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue