ACRN:DM: Avoid calling surface_set in course of virtio_gpu_reset

This is not needed as it is reconfigured in course of vga_thread_loop.
At the same time it is not thread-safe as the 3D api is involved
in vdpy_surface_set.

v2->v3: move the initialization of vga_surface width/height into
vga_thread.

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:
Zhao Yakui 2022-04-18 10:28:26 +08:00 committed by acrnsi-robot
parent c73773c130
commit 2e9773ed55
1 changed files with 2 additions and 3 deletions

View File

@ -463,9 +463,6 @@ virtio_gpu_reset(void *vdev)
}
LIST_INIT(&gpu->r2d_list);
gpu->vga.enable = true;
vdpy_surface_set(gpu->vdpy_handle, &gpu->vga.surf);
gpu->vga.surf.width = 0;
gpu->vga.surf.stride = 0;
pthread_mutex_lock(&gpu->vga_thread_mtx);
if (atomic_load(&gpu->vga_thread_status) == VGA_THREAD_EOL) {
atomic_store(&gpu->vga_thread_status, VGA_THREAD_RUNNING);
@ -1409,6 +1406,8 @@ virtio_gpu_vga_render(void *param)
struct virtio_gpu *gpu;
gpu = (struct virtio_gpu*)param;
gpu->vga.surf.width = 0;
gpu->vga.surf.stride = 0;
/* The below logic needs to be refined */
while(gpu->vga.enable) {
if(gpu->vga.gc->gc_image->vgamode) {