freedreno/drm: Add sub-allocator
authorRob Clark <robdclark@chromium.org>
Sat, 3 Dec 2022 02:42:42 +0000 (18:42 -0800)
committerMarge Bot <emma+marge@anholt.net>
Sat, 17 Dec 2022 19:14:12 +0000 (19:14 +0000)
commit48610676897d989ff8ce604022e7d611cec9c131
tree83adfa63b37ecde0a98508c68b661302e8a1d338
parent7d0d82f25ffa88b817ecfbd974cd1eff26ac1e0d
freedreno/drm: Add sub-allocator

Add a heap that we can use for allocations of small mappable buffers.
This avoids the churn of mmap/unmap, which is especially expensive in
a VM.  It also allows packing more smaller allocations together in a
page, which is useful for PIPE_BUFFERs (which are also mappable).

This avoid jank caused by the overhead of setting up or tearing down
guest mappings when running in a VM.  And also significantly reduces
the # of BOs referenced on a submit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
12 files changed:
src/freedreno/drm/freedreno_bo.c
src/freedreno/drm/freedreno_bo_heap.c [new file with mode: 0644]
src/freedreno/drm/freedreno_device.c
src/freedreno/drm/freedreno_drmif.h
src/freedreno/drm/freedreno_pipe.c
src/freedreno/drm/freedreno_priv.h
src/freedreno/drm/freedreno_ringbuffer_sp.c
src/freedreno/drm/freedreno_ringbuffer_sp.h
src/freedreno/drm/meson.build
src/freedreno/drm/msm/msm_ringbuffer.c
src/freedreno/drm/msm/msm_ringbuffer_sp.c
src/freedreno/drm/virtio/virtio_ringbuffer.c