mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-26 23:00:34 +01:00
pan/afbc: Add helpers to query AFBC header alignment requirements
Will be used in pan_layout.c to validate the WSI info. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Tested-by: Eric R. Smith <eric.smith@collabora.com> Reviewed-by: Eric R. Smith <eric.smith@collabora.com> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35015>
This commit is contained in:
parent
ce197c8018
commit
5292fef80d
1 changed files with 22 additions and 0 deletions
|
|
@ -167,6 +167,28 @@ pan_afbc_subblock_size(uint64_t modifier)
|
|||
return (struct pan_image_block_size){4, 4};
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
pan_afbc_header_row_stride_align(unsigned arch, enum pipe_format format,
|
||||
uint64_t modifier)
|
||||
{
|
||||
if (arch <= 7 || !(modifier & AFBC_FORMAT_MOD_TILED))
|
||||
return 16;
|
||||
|
||||
if (util_format_get_blocksizebits(format) <= 32)
|
||||
return 1024;
|
||||
else
|
||||
return 256;
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
pan_afbc_header_align(unsigned arch, uint64_t modifier)
|
||||
{
|
||||
if (modifier & AFBC_FORMAT_MOD_TILED)
|
||||
return 4096;
|
||||
else
|
||||
return 128;
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine the required alignment for the body offset of an AFBC image. For
|
||||
* now, this depends only on whether tiling is in use. These minimum alignments
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue