aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVivek Kasireddy <vivek.kasireddy@intel.com>2021-05-26 16:14:28 -0700
committerGerd Hoffmann <kraxel@redhat.com>2021-05-27 12:07:37 +0200
commit32db3c63ae113da6ac06d65d1ffb764e0c357a6c (patch)
tree37177344fe1bb58b0f1defc94537a5296c7cc7c6 /include
parent81cd9f71087b31d0fb231d3736a31262d232375e (diff)
downloadqemu-32db3c63ae113da6ac06d65d1ffb764e0c357a6c.zip
qemu-32db3c63ae113da6ac06d65d1ffb764e0c357a6c.tar.gz
qemu-32db3c63ae113da6ac06d65d1ffb764e0c357a6c.tar.bz2
virtio-gpu: Add virtio_gpu_set_scanout_blob
This API allows Qemu to set the blob allocated by the Guest as the scanout buffer. If Opengl support is available, then the scanout buffer would be submitted as a dmabuf to the UI; if not, a pixman image is created from the scanout buffer and is submitted to the UI via the display surface. 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-14-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/virtio/virtio-gpu-bswap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-gpu-bswap.h b/include/hw/virtio/virtio-gpu-bswap.h
index d23ac5c..e2bee8f 100644
--- a/include/hw/virtio/virtio-gpu-bswap.h
+++ b/include/hw/virtio/virtio-gpu-bswap.h
@@ -68,4 +68,11 @@ virtio_gpu_create_blob_bswap(struct virtio_gpu_resource_create_blob *cblob)
le64_to_cpus(&cblob->size);
}
+static inline void
+virtio_gpu_scanout_blob_bswap(struct virtio_gpu_set_scanout_blob *ssb)
+{
+ virtio_gpu_bswap_32(ssb, sizeof(*ssb) - sizeof(ssb->offsets[3]));
+ le32_to_cpus(&ssb->offsets[3]);
+}
+
#endif