Lines Matching refs:shim_device

58 struct shim_device shim_device;  variable
79 shim_device.fd_map = _mesa_hash_table_create(NULL, in drm_shim_device_init()
83 mtx_init(&shim_device.mem_lock, mtx_plain); in drm_shim_device_init()
85 shim_device.mem_fd = memfd_create("shim mem", MFD_CLOEXEC); in drm_shim_device_init()
86 assert(shim_device.mem_fd != -1); in drm_shim_device_init()
88 ASSERTED int ret = ftruncate(shim_device.mem_fd, SHIM_MEM_SIZE); in drm_shim_device_init()
91 util_vma_heap_init(&shim_device.mem_heap, 4096, SHIM_MEM_SIZE - 4096); in drm_shim_device_init()
119 _mesa_hash_table_insert(shim_device.fd_map, (void *)(uintptr_t)(fd + 1), shim_fd); in drm_shim_fd_register()
129 _mesa_hash_table_search(shim_device.fd_map, (void *)(uintptr_t)(fd + 1)); in drm_shim_fd_lookup()
144 args->version_major = shim_device.version_major; in drm_shim_ioctl_version()
145 args->version_minor = shim_device.version_minor; in drm_shim_ioctl_version()
146 args->version_patchlevel = shim_device.version_patchlevel; in drm_shim_ioctl_version()
149 strncpy(args->name, shim_device.driver_name, args->name_len); in drm_shim_ioctl_version()
154 args->name_len = strlen(shim_device.driver_name); in drm_shim_ioctl_version()
244 if (driver_nr < shim_device.driver_ioctl_count && in drm_shim_ioctl()
245 shim_device.driver_ioctls[driver_nr]) { in drm_shim_ioctl()
246 return shim_device.driver_ioctls[driver_nr](fd, request, arg); in drm_shim_ioctl()
271 mtx_lock(&shim_device.mem_lock); in drm_shim_bo_init()
272 bo->mem_addr = util_vma_heap_alloc(&shim_device.mem_heap, size, 4096); in drm_shim_bo_init()
273 mtx_unlock(&shim_device.mem_lock); in drm_shim_bo_init()
309 if (shim_device.driver_bo_free) in drm_shim_bo_put()
310 shim_device.driver_bo_free(bo); in drm_shim_bo_put()
312 mtx_lock(&shim_device.mem_lock); in drm_shim_bo_put()
313 util_vma_heap_free(&shim_device.mem_heap, bo->mem_addr, bo->size); in drm_shim_bo_put()
314 mtx_unlock(&shim_device.mem_lock); in drm_shim_bo_put()
363 return mmap(NULL, length, prot, flags, shim_device.mem_fd, bo->mem_addr); in drm_shim_mmap()