drm-shim: don't create a memfd per BO
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sat, 25 Apr 2020 09:47:04 +0000 (12:47 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 30 Apr 2020 08:32:54 +0000 (11:32 +0300)
commit764ef4bf1a6fe0c256859d275c5f922d46217dbc
tree423dfd716c7acfb74e47fafc9ef4f32b5643e7f3
parent6b34c8d35f5c8cf8febc1310012de67e6f41b09f
drm-shim: don't create a memfd per BO

Running shader-db on big servers with many cores, we're running out of
file descriptors.

Use a single 4Gb memfd instead and allocate from it using a VMA.

v2: Align VMA allocation to 4096 (Eric)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4594>
src/drm-shim/device.c
src/drm-shim/drm_shim.h