Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / drm-shim / drm_shim.h
index 2cd053f6d652e2cdbef6cd914580c4eb87c2a3d9..cb3951afa82eed7be9ed74a1abc3187e6d708afc 100644 (file)
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <c11/threads.h>
+
 #include "util/macros.h"
 #include "util/hash_table.h"
+#include "util/vma.h"
+
+#include <xf86drm.h>
 
 #ifdef __linux__
 #define DRM_MAJOR 226
@@ -36,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;
 
@@ -44,18 +55,20 @@ struct shim_device {
    /* Returned by drmGetVersion(). */
    const char *driver_name;
    int version_major, version_minor, version_patchlevel;
+   int bus_type;
 };
 
 extern struct shim_device shim_device;
 
 struct shim_fd {
    int fd;
+   mtx_t handle_lock;
    /* mapping from int gem handle to struct shim_bo *. */
    struct hash_table *handles;
 };
 
 struct shim_bo {
-   int fd;
+   uint64_t mem_addr;
    void *map;
    int refcount;
    uint32_t size;
@@ -82,3 +95,4 @@ uint64_t drm_shim_bo_get_mmap_offset(struct shim_fd *shim_fd,
 
 /* driver-specific hooks. */
 void drm_shim_driver_init(void);
+extern bool drm_shim_driver_prefers_new_render_node;