summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/virgl
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-04-09 15:00:48 +1000
committerDave Airlie <[email protected]>2019-04-25 06:05:43 +1000
commitce17e413de6cbb66a84d71caa445f44c3ddb1a2b (patch)
tree02a67eb3e676499bdbcf3fc3471b4dec2844ebb9 /src/gallium/winsys/virgl
parent8a39f83fb24295b9e2ad1d5a08e764624c927a19 (diff)
virgl/drm: insert correct handles into the table. (v3)
This inserts a handle for the flink name and a handle the correct gem handle for the bo. v2: fix handles/names confusion (Lepton Wu) v3: set flink name correctly (Lepton Wu) Reviewed-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/gallium/winsys/virgl')
-rw-r--r--src/gallium/winsys/virgl/drm/virgl_drm_winsys.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
index 4c8947bf679..c35d58b0552 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
@@ -438,6 +438,7 @@ virgl_drm_winsys_resource_create_handle(struct virgl_winsys *qws,
goto done;
}
res->bo_handle = open_arg.handle;
+ res->flink_name = whandle->handle;
}
memset(&info_arg, 0, sizeof(info_arg));
@@ -457,7 +458,9 @@ virgl_drm_winsys_resource_create_handle(struct virgl_winsys *qws,
pipe_reference_init(&res->reference, 1);
res->num_cs_references = 0;
- util_hash_table_set(qdws->bo_handles, (void *)(uintptr_t)handle, res);
+ if (res->flink_name)
+ util_hash_table_set(qdws->bo_names, (void *)(uintptr_t)res->flink_name, res);
+ util_hash_table_set(qdws->bo_handles, (void *)(uintptr_t)res->bo_handle, res);
done:
mtx_unlock(&qdws->bo_handles_mutex);