aboutsummaryrefslogtreecommitdiffstats
path: root/src/drm-shim/drm_shim.h
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2020-04-25 12:47:04 +0300
committerLionel Landwerlin <[email protected]>2020-04-30 11:32:54 +0300
commit764ef4bf1a6fe0c256859d275c5f922d46217dbc (patch)
tree423dfd716c7acfb74e47fafc9ef4f32b5643e7f3 /src/drm-shim/drm_shim.h
parent6b34c8d35f5c8cf8febc1310012de67e6f41b09f (diff)
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 <[email protected]> Acked-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4594>
Diffstat (limited to 'src/drm-shim/drm_shim.h')
-rw-r--r--src/drm-shim/drm_shim.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/drm-shim/drm_shim.h b/src/drm-shim/drm_shim.h
index 4d359dd7f1a..cb3951afa82 100644
--- a/src/drm-shim/drm_shim.h
+++ b/src/drm-shim/drm_shim.h
@@ -25,6 +25,7 @@
#include "util/macros.h"
#include "util/hash_table.h"
+#include "util/vma.h"
#include <xf86drm.h>
@@ -40,6 +41,12 @@ struct shim_device {
/* Mapping from int fd to struct shim_fd *. */
struct hash_table *fd_map;
+ mtx_t mem_lock;
+ /* Heap from which shim_bo are allocated */
+ struct util_vma_heap mem_heap;
+
+ int mem_fd;
+
int (**driver_ioctls)(int fd, unsigned long request, void *arg);
int driver_ioctl_count;
@@ -61,7 +68,7 @@ struct shim_fd {
};
struct shim_bo {
- int fd;
+ uint64_t mem_addr;
void *map;
int refcount;
uint32_t size;