virtio-gpu: allocate shareable 2d resources on !win32

Similar to what was done in commit 9462ff46 ("virtio-gpu/win32: allocate
shareable 2d resources/images") for win32, allocate resource memory with
memfd, so the associated display surface memory can be shared with a
different process.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-ID: <20241008125028.1177932-18-marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2024-10-08 16:50:26 +04:00
parent 48b7ef0f0f
commit 5f899c34af
2 changed files with 29 additions and 12 deletions

View file

@ -53,6 +53,8 @@ struct virtio_gpu_simple_resource {
pixman_image_t *image;
#ifdef WIN32
HANDLE handle;
#else
int shmfd;
#endif
uint64_t hostmem;