mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
panfrost: Mark buffers as PANFROST_BO_HEAP
What we call GROWABLE in Mesa corresponds to the HEAP BO flag in the kernel. These buffers cannot be memory mapped in the CPU side at the moment, so make sure they are also marked INVISIBLE. This allows us to allocate a big heap upfront (16MB) without actually reserving space unless it's needed. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
parent
19afd41e65
commit
7c8434889d
1 changed files with 6 additions and 0 deletions
|
|
@ -91,10 +91,16 @@ panfrost_drm_create_bo(struct panfrost_screen *screen, size_t size,
|
|||
/* To maximize BO cache usage, don't allocate tiny BOs */
|
||||
size = MAX2(size, 4096);
|
||||
|
||||
/* GROWABLE BOs cannot be mmapped */
|
||||
if (flags & PAN_ALLOCATE_GROWABLE)
|
||||
assert(flags & PAN_ALLOCATE_INVISIBLE);
|
||||
|
||||
unsigned translated_flags = 0;
|
||||
|
||||
if (screen->kernel_version->version_major > 1 ||
|
||||
screen->kernel_version->version_minor >= 1) {
|
||||
if (flags & PAN_ALLOCATE_GROWABLE)
|
||||
translated_flags |= PANFROST_BO_HEAP;
|
||||
if (!(flags & PAN_ALLOCATE_EXECUTE))
|
||||
translated_flags |= PANFROST_BO_NOEXEC;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue