Lines Matching refs:shim_fd

96 static struct shim_fd *
99 struct shim_fd *shim_fd = calloc(1, sizeof(*shim_fd)); in drm_shim_file_create() local
101 shim_fd->fd = fd; in drm_shim_file_create()
102 mtx_init(&shim_fd->handle_lock, mtx_plain); in drm_shim_file_create()
103 shim_fd->handles = _mesa_hash_table_create(NULL, in drm_shim_file_create()
107 return shim_fd; in drm_shim_file_create()
114 void drm_shim_fd_register(int fd, struct shim_fd *shim_fd) in drm_shim_fd_register() argument
116 if (!shim_fd) in drm_shim_fd_register()
117 shim_fd = drm_shim_file_create(fd); in drm_shim_fd_register()
119 _mesa_hash_table_insert(shim_device.fd_map, (void *)(uintptr_t)(fd + 1), shim_fd); in drm_shim_fd_register()
122 struct shim_fd *
182 struct shim_fd *shim_fd = drm_shim_fd_lookup(fd); in drm_shim_ioctl_gem_close() local
188 mtx_lock(&shim_fd->handle_lock); in drm_shim_ioctl_gem_close()
190 _mesa_hash_table_search(shim_fd->handles, (void *)(uintptr_t)c->handle); in drm_shim_ioctl_gem_close()
192 mtx_unlock(&shim_fd->handle_lock); in drm_shim_ioctl_gem_close()
197 _mesa_hash_table_remove(shim_fd->handles, entry); in drm_shim_ioctl_gem_close()
199 mtx_unlock(&shim_fd->handle_lock); in drm_shim_ioctl_gem_close()
280 drm_shim_bo_lookup(struct shim_fd *shim_fd, int handle) in drm_shim_bo_lookup() argument
285 mtx_lock(&shim_fd->handle_lock); in drm_shim_bo_lookup()
287 _mesa_hash_table_search(shim_fd->handles, (void *)(uintptr_t)handle); in drm_shim_bo_lookup()
289 mtx_unlock(&shim_fd->handle_lock); in drm_shim_bo_lookup()
319 drm_shim_bo_get_handle(struct shim_fd *shim_fd, struct shim_bo *bo) in drm_shim_bo_get_handle() argument
324 mtx_lock(&shim_fd->handle_lock); in drm_shim_bo_get_handle()
327 if (!_mesa_hash_table_search(shim_fd->handles, key)) { in drm_shim_bo_get_handle()
329 _mesa_hash_table_insert(shim_fd->handles, key, bo); in drm_shim_bo_get_handle()
330 mtx_unlock(&shim_fd->handle_lock); in drm_shim_bo_get_handle()
334 mtx_unlock(&shim_fd->handle_lock); in drm_shim_bo_get_handle()
349 drm_shim_bo_get_mmap_offset(struct shim_fd *shim_fd, struct shim_bo *bo) in drm_shim_bo_get_mmap_offset() argument
358 drm_shim_mmap(struct shim_fd *shim_fd, size_t length, int prot, int flags, in drm_shim_mmap() argument