diff options
author | Tomeu Vizoso <[email protected]> | 2019-07-31 16:29:25 +0200 |
---|---|---|
committer | Tomeu Vizoso <[email protected]> | 2019-08-08 07:42:52 +0200 |
commit | 7c8434889d8d08ae3c5d2287d1d6c5e03159e9f9 (patch) | |
tree | a3a946ed1b21fa1a8ed6fb0af3aa2c0a6736af8a /src/gallium | |
parent | 19afd41e6546fb6ca852b62fc5a63359f3b70693 (diff) |
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 <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_drm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_drm.c b/src/gallium/drivers/panfrost/pan_drm.c index 6d1e0c08d33..71eda2d1e32 100644 --- a/src/gallium/drivers/panfrost/pan_drm.c +++ b/src/gallium/drivers/panfrost/pan_drm.c @@ -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; } |