virtio-gpu: Refactor virtio_gpu_set_scanout

Store the meta-data associated with a FB in a new object
(struct virtio_gpu_framebuffer) and pass the object to set_scanout.
Also move code in set_scanout into a do_set_scanout function.
This will be helpful when adding set_scanout_blob API.

Based-on-patch-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Message-Id: <20210526231429.1045476-7-vivek.kasireddy@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Vivek Kasireddy 2021-05-26 16:14:21 -07:00 committed by Gerd Hoffmann
parent 25c001a403
commit e64d4b6a9b
2 changed files with 98 additions and 67 deletions

View file

@ -59,6 +59,14 @@ struct virtio_gpu_simple_resource {
QTAILQ_ENTRY(virtio_gpu_simple_resource) next;
};
struct virtio_gpu_framebuffer {
pixman_format_code_t format;
uint32_t bytes_pp;
uint32_t width, height;
uint32_t stride;
uint32_t offset;
};
struct virtio_gpu_scanout {
QemuConsole *con;
DisplaySurface *ds;