OSDN Git Service

virtio-gpu: Add udmabuf helpers
authorVivek Kasireddy <vivek.kasireddy@intel.com>
Wed, 26 May 2021 23:14:18 +0000 (16:14 -0700)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 27 May 2021 10:06:37 +0000 (12:06 +0200)
commit9b60cdf98723b52d32fdd131f709923e05c0000f
tree9ae8590f80a311df9f74a04049ad16da150a1ddf
parent4d010861611641c225a889d777e2670e3b8e4b3c
virtio-gpu: Add udmabuf helpers

Add helper functions to create a dmabuf for a resource and mmap it.
Also, introduce the fields blob and blob_size so that these helpers
can start to use them but the full picture will emerge only after
adding create_blob API in patch 8 of this series.

To be able to create a dmabuf using the udmabuf driver, Qemu needs
to be lauched with the memfd memory backend like this:

qemu-system-x86_64 -m 8192m -object memory-backend-memfd,id=mem1,size=8192M
-machine memory-backend=mem1

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-4-vivek.kasireddy@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/meson.build
hw/display/virtio-gpu-udmabuf.c [new file with mode: 0644]
include/hw/virtio/virtio-gpu.h