mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-08 08:08:25 +02:00
ail: add ail_bytes_to_pages helper
this happens a bunch with sparse Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33682>
This commit is contained in:
parent
56cd20ddea
commit
78ca483940
1 changed files with 7 additions and 0 deletions
|
|
@ -520,6 +520,13 @@ ail_drm_modifier_to_tiling(uint64_t modifier)
|
|||
#define AIL_FOLIO_SIZE_EL (AIL_PAGES_PER_FOLIO * 2)
|
||||
#define AIL_FOLIO_SIZE_B (AIL_FOLIO_SIZE_EL * AIL_SPARSE_ELSIZE_B)
|
||||
|
||||
static inline unsigned
|
||||
ail_bytes_to_pages(unsigned x_B)
|
||||
{
|
||||
assert((x_B % AIL_PAGESIZE) == 0);
|
||||
return x_B / AIL_PAGESIZE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Map a logical page of the image (i.e. page = logical address / page_size) to
|
||||
* a word-index into the sparse table.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue