Lines Matching refs:shim_device
58 struct shim_device shim_device; variable
81 shim_device.fd_map = _mesa_hash_table_create(NULL, in drm_shim_device_init()
85 mtx_init(&shim_device.mem_lock, mtx_plain); in drm_shim_device_init()
87 shim_device.mem_fd = memfd_create("shim mem", MFD_CLOEXEC); in drm_shim_device_init()
88 assert(shim_device.mem_fd != -1); in drm_shim_device_init()
90 ASSERTED int ret = ftruncate(shim_device.mem_fd, SHIM_MEM_SIZE); in drm_shim_device_init()
106 util_vma_heap_init(&shim_device.mem_heap, shim_page_size, in drm_shim_device_init()
135 _mesa_hash_table_insert(shim_device.fd_map, (void *)(uintptr_t)(fd + 1), shim_fd); in drm_shim_fd_register()
145 _mesa_hash_table_search(shim_device.fd_map, (void *)(uintptr_t)(fd + 1)); in drm_shim_fd_lookup()
160 args->version_major = shim_device.version_major; in drm_shim_ioctl_version()
161 args->version_minor = shim_device.version_minor; in drm_shim_ioctl_version()
162 args->version_patchlevel = shim_device.version_patchlevel; in drm_shim_ioctl_version()
165 strncpy(args->name, shim_device.driver_name, args->name_len); in drm_shim_ioctl_version()
170 args->name_len = strlen(shim_device.driver_name); in drm_shim_ioctl_version()
261 if (driver_nr < shim_device.driver_ioctl_count && in drm_shim_ioctl()
262 shim_device.driver_ioctls[driver_nr]) { in drm_shim_ioctl()
263 return shim_device.driver_ioctls[driver_nr](fd, request, arg); in drm_shim_ioctl()
288 mtx_lock(&shim_device.mem_lock); in drm_shim_bo_init()
289 bo->mem_addr = util_vma_heap_alloc(&shim_device.mem_heap, size, shim_page_size); in drm_shim_bo_init()
290 mtx_unlock(&shim_device.mem_lock); in drm_shim_bo_init()
326 if (shim_device.driver_bo_free) in drm_shim_bo_put()
327 shim_device.driver_bo_free(bo); in drm_shim_bo_put()
329 mtx_lock(&shim_device.mem_lock); in drm_shim_bo_put()
330 util_vma_heap_free(&shim_device.mem_heap, bo->mem_addr, bo->size); in drm_shim_bo_put()
331 mtx_unlock(&shim_device.mem_lock); in drm_shim_bo_put()
383 return mmap(NULL, length, prot, flags, shim_device.mem_fd, bo->mem_addr); in drm_shim_mmap()