mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-21 21:19:35 +00:00
ACRN:DM:VGPU: Add some checks to ignore multi-thread op
Now all the 3D ops are handled in one dedicated thread. As 3D ops are not safe in multi-thread env, some checks are added so that it can indicate that it is not in the expected code path. Tracked-On: #7296 Acked-by: Wang Yu1 <yu1.wang@intel.com> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
This commit is contained in:
parent
a555658484
commit
de3e0946bc
@ -596,6 +596,12 @@ vdpy_surface_set(int handle, struct surface *surf)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vdpy.tid != pthread_self()) {
|
||||||
|
pr_err("%s: unexpected code path as unsafe 3D ops in multi-threads env.\n",
|
||||||
|
__func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (surf == NULL ) {
|
if (surf == NULL ) {
|
||||||
vdpy.surf.width = 0;
|
vdpy.surf.width = 0;
|
||||||
vdpy.surf.height = 0;
|
vdpy.surf.height = 0;
|
||||||
@ -755,6 +761,12 @@ vdpy_surface_update(int handle, struct surface *surf)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vdpy.tid != pthread_self()) {
|
||||||
|
pr_err("%s: unexpected code path as unsafe 3D ops in multi-threads env.\n",
|
||||||
|
__func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!surf) {
|
if (!surf) {
|
||||||
pr_err("Incorrect order of submitting Virtio-GPU cmd.\n");
|
pr_err("Incorrect order of submitting Virtio-GPU cmd.\n");
|
||||||
return;
|
return;
|
||||||
@ -790,6 +802,12 @@ vdpy_cursor_define(int handle, struct cursor *cur)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vdpy.tid != pthread_self()) {
|
||||||
|
pr_err("%s: unexpected code path as unsafe 3D ops in multi-threads env.\n",
|
||||||
|
__func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (cur->data == NULL)
|
if (cur->data == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user