iris/bufmgr: Add iris_pat_index_for_bo_flags()

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>
This commit is contained in:
Jordan Justen
2023-05-10 09:50:54 -07:00
committed by Marge Bot
parent b602c14fc5
commit 5e697abc58
+16
View File
@@ -539,6 +539,22 @@ iris_bo_bump_seqno(struct iris_bo *bo, uint64_t seqno,
prev_seqno = tmp;
}
/**
* Return the pat index based on the bo allocation flags.
*/
static inline uint32_t
iris_pat_index_for_bo_flags(const struct intel_device_info *devinfo,
unsigned alloc_flags)
{
if (alloc_flags & BO_ALLOC_COHERENT)
return devinfo->pat.coherent;
if (alloc_flags & (BO_ALLOC_SHARED | BO_ALLOC_SCANOUT))
return devinfo->pat.scanout;
return devinfo->pat.writeback;
}
enum iris_memory_zone iris_memzone_for_address(uint64_t address);
int iris_bufmgr_create_screen_id(struct iris_bufmgr *bufmgr);