ACRN:VGPU: Fix the incorrect logic of fetching EDID

The virtio_gpu in guest_vm will try to fetch the EDID to query
the supported resolution. Guest vm will send the cmd of
VIRTIO_GPU_CMD_GET_EDID and receive the response of VIRTIO_GPU_RESP_OK_EDID.
Now acrn-dm has some issues in course of handlding EDID request: Incorrect
resp type, the incorrect response. This will cause that the guest_vm fails
to fetch the EDID.

Tracked-On: #7376
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
This commit is contained in:
Zhao Yakui 2022-04-27 14:53:44 +08:00 committed by acrnsi-robot
parent c544ac98bc
commit 402565f222

View File

@ -554,6 +554,7 @@ virtio_gpu_cmd_get_edid(struct virtio_gpu_command *cmd)
memset(&resp, 0, sizeof(resp));
/* Only one EDID block is enough */
resp.size = 128;
resp.hdr.type = VIRTIO_GPU_RESP_OK_EDID;
virtio_gpu_update_resp_fence(&cmd->hdr, &resp.hdr);
vdpy_get_edid(gpu->vdpy_handle, resp.edid, resp.size);
memcpy(cmd->iov[1].iov_base, &resp, sizeof(resp));
@ -1228,6 +1229,7 @@ virtio_gpu_ctrl_bh(void *data)
switch (cmd.hdr.type) {
case VIRTIO_GPU_CMD_GET_EDID:
virtio_gpu_cmd_get_edid(&cmd);
break;
case VIRTIO_GPU_CMD_GET_DISPLAY_INFO:
virtio_gpu_cmd_get_display_info(&cmd);
break;