{
struct drm_gem_close args;
- if (res->flinked) {
- mtx_lock(&qdws->bo_handles_mutex);
+ mtx_lock(&qdws->bo_handles_mutex);
+ util_hash_table_remove(qdws->bo_handles,
+ (void *)(uintptr_t)res->bo_handle);
+ if (res->flink_name)
util_hash_table_remove(qdws->bo_names,
- (void *)(uintptr_t)res->flink);
- mtx_unlock(&qdws->bo_handles_mutex);
- }
-
- if (res->bo_handle) {
- mtx_lock(&qdws->bo_handles_mutex);
- util_hash_table_remove(qdws->bo_handles,
- (void *)(uintptr_t)res->bo_handle);
- mtx_unlock(&qdws->bo_handles_mutex);
- }
-
+ (void *)(uintptr_t)res->flink_name);
+ mtx_unlock(&qdws->bo_handles_mutex);
if (res->ptr)
os_munmap(res->ptr, res->size);
return FALSE;
if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
- if (!res->flinked) {
+ if (!res->flink_name) {
memset(&flink, 0, sizeof(flink));
flink.handle = res->bo_handle;
if (drmIoctl(qdws->fd, DRM_IOCTL_GEM_FLINK, &flink)) {
return FALSE;
}
- res->flinked = TRUE;
- res->flink = flink.name;
+ res->flink_name = flink.name;
mtx_lock(&qdws->bo_handles_mutex);
- util_hash_table_set(qdws->bo_names, (void *)(uintptr_t)res->flink, res);
+ util_hash_table_set(qdws->bo_names, (void *)(uintptr_t)res->flink_name, res);
mtx_unlock(&qdws->bo_handles_mutex);
}
- whandle->handle = res->flink;
+ whandle->handle = res->flink_name;
} else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
whandle->handle = res->bo_handle;
} else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {