[PATCH 2/8] ACRN:DM:VDisplay: vdpy_init connection returns the supported number of window


Zhao, Yakui
 

Vdisplay module will create the gui_window based on the virtio-gpu parameter. When it tries
to establish the connection with vdisplay module, it will return the supported number of window.
Then the virtio-gpu device can initialize the correct info for the guest_vm.

BTW: The number is fixed to 1.

Signed-off-by: Zhao Yakui <yakui.zhao@...>
---
devicemodel/hw/pci/virtio/virtio_gpu.c | 2 +-
devicemodel/hw/vdisplay_sdl.c | 4 +++-
devicemodel/include/vdisplay.h | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/devicemodel/hw/pci/virtio/virtio_gpu.c b/devicemodel/hw/pci/virtio/virtio_gpu.c
index 2f8c4362e..cf3d20823 100644
--- a/devicemodel/hw/pci/virtio/virtio_gpu.c
+++ b/devicemodel/hw/pci/virtio/virtio_gpu.c
@@ -1485,7 +1485,7 @@ virtio_gpu_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
gpu->vq,
BACKEND_VBSU);

- gpu->vdpy_handle = vdpy_init();
+ gpu->vdpy_handle = vdpy_init(NULL);
gpu->base.mtx = &gpu->mtx;
gpu->base.device_caps = VIRTIO_GPU_S_HOSTCAPS;

diff --git a/devicemodel/hw/vdisplay_sdl.c b/devicemodel/hw/vdisplay_sdl.c
index 567a2de6f..65fd78d93 100644
--- a/devicemodel/hw/vdisplay_sdl.c
+++ b/devicemodel/hw/vdisplay_sdl.c
@@ -1069,7 +1069,7 @@ bool vdpy_submit_bh(int handle, struct vdpy_display_bh *bh_task)
}

int
-vdpy_init()
+vdpy_init(int *supported_wins)
{
int err, count;

@@ -1100,6 +1100,8 @@ vdpy_init()
}

vdpy.s.n_connect++;
+ if (supported_wins)
+ *supported_wins = 1;
return vdpy.s.n_connect;
}

diff --git a/devicemodel/include/vdisplay.h b/devicemodel/include/vdisplay.h
index fc0e91b46..c1214a461 100644
--- a/devicemodel/include/vdisplay.h
+++ b/devicemodel/include/vdisplay.h
@@ -85,7 +85,7 @@ struct cursor {

int vdpy_parse_cmd_option(const char *opts);
int gfx_ui_init();
-int vdpy_init();
+int vdpy_init(int *supported_wins);
void vdpy_get_display_info(int handle, int scanout_id, struct display_info *info);
void vdpy_surface_set(int handle, int scanout_id, struct surface *surf);
void vdpy_surface_update(int handle, int scanout_id, struct surface *surf);
--
2.25.1

Join acrn-dev@lists.projectacrn.org to automatically receive all group messages.