From 373dac68ef2a83d3d5e64f460b4952051175313b Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Wed, 27 Apr 2022 14:53:44 +0800 Subject: [PATCH] ACRN:VGPU: Virtio_gpu_init calls the vdpy_init before vdpy_get_display_info Now vdpy_get_display_info/get_edid is called before vdpy_init. This is incorrect. They should be called after setting up the connection with vdisplay. Tracked-On: #7376 Acked-by: Wang Yu Signed-off-by: Zhao Yakui --- devicemodel/hw/pci/virtio/virtio_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicemodel/hw/pci/virtio/virtio_gpu.c b/devicemodel/hw/pci/virtio/virtio_gpu.c index 9d2ed5601..4829cf2e4 100644 --- a/devicemodel/hw/pci/virtio/virtio_gpu.c +++ b/devicemodel/hw/pci/virtio/virtio_gpu.c @@ -1485,6 +1485,7 @@ virtio_gpu_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) gpu->vq, BACKEND_VBSU); + gpu->vdpy_handle = vdpy_init(); gpu->base.mtx = &gpu->mtx; gpu->base.device_caps = VIRTIO_GPU_S_HOSTCAPS; @@ -1623,7 +1624,6 @@ virtio_gpu_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) pr_err("%s, set modern io bar(BAR5) failed.\n", __func__); return rc; } - gpu->vdpy_handle = vdpy_init(); pthread_mutex_init(&gpu->vga_thread_mtx, NULL); /* VGA Compablility */