4bd802b209
Clean up includes so that osdep.h is included first and headers
which it implies are not included manually.
This commit was created with scripts/clean-includes, with the changes
to the following files manually reverted:
contrib/libvhost-user/libvhost-user-glib.h
contrib/libvhost-user/libvhost-user.c
contrib/libvhost-user/libvhost-user.h
contrib/plugins/hotblocks.c
contrib/plugins/hotpages.c
contrib/plugins/howvec.c
contrib/plugins/lockstep.c
linux-user/mips64/cpu_loop.c
linux-user/mips64/signal.c
linux-user/sparc64/cpu_loop.c
linux-user/sparc64/signal.c
linux-user/x86_64/cpu_loop.c
linux-user/x86_64/signal.c
target/s390x/gen-features.c
tests/fp/platform.h
tests/migration/s390x/a-b-bios.c
tests/plugin/bb.c
tests/plugin/empty.c
tests/plugin/insn.c
tests/plugin/mem.c
tests/test-rcu-simpleq.c
tests/test-rcu-slist.c
tests/test-rcu-tailq.c
tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not
to include osdep.h intentionally. The remaining reverts are the same
as in commit bbfff19688
.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201113061216.2483385-1-armbru@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Alexander Bulekov <alxndr@bu.edu>
67 lines
1.5 KiB
C
67 lines
1.5 KiB
C
/*
|
|
* Virtio vhost-user GPU Device
|
|
*
|
|
* GBM helpers
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#ifndef VHOST_USER_GPU_VUGBM_H
|
|
#define VHOST_USER_GPU_VUGBM_H
|
|
|
|
|
|
#ifdef CONFIG_MEMFD
|
|
#include <sys/ioctl.h>
|
|
#endif
|
|
|
|
#ifdef CONFIG_GBM
|
|
#include <gbm.h>
|
|
#endif
|
|
|
|
struct vugbm_buffer;
|
|
|
|
struct vugbm_device {
|
|
bool inited;
|
|
int fd;
|
|
#ifdef CONFIG_GBM
|
|
struct gbm_device *dev;
|
|
#endif
|
|
|
|
bool (*alloc_bo)(struct vugbm_buffer *buf);
|
|
void (*free_bo)(struct vugbm_buffer *buf);
|
|
bool (*get_fd)(struct vugbm_buffer *buf, int *fd);
|
|
bool (*map_bo)(struct vugbm_buffer *buf);
|
|
void (*unmap_bo)(struct vugbm_buffer *buf);
|
|
void (*device_destroy)(struct vugbm_device *dev);
|
|
};
|
|
|
|
struct vugbm_buffer {
|
|
struct vugbm_device *dev;
|
|
|
|
#ifdef CONFIG_MEMFD
|
|
int memfd;
|
|
#endif
|
|
#ifdef CONFIG_GBM
|
|
struct gbm_bo *bo;
|
|
void *mmap_data;
|
|
#endif
|
|
|
|
uint8_t *mmap;
|
|
uint32_t width;
|
|
uint32_t height;
|
|
uint32_t stride;
|
|
uint32_t format;
|
|
};
|
|
|
|
bool vugbm_device_init(struct vugbm_device *dev, int fd);
|
|
void vugbm_device_destroy(struct vugbm_device *dev);
|
|
|
|
bool vugbm_buffer_create(struct vugbm_buffer *buffer, struct vugbm_device *dev,
|
|
uint32_t width, uint32_t height);
|
|
bool vugbm_buffer_can_get_dmabuf_fd(struct vugbm_buffer *buffer);
|
|
bool vugbm_buffer_get_dmabuf_fd(struct vugbm_buffer *buffer, int *fd);
|
|
void vugbm_buffer_destroy(struct vugbm_buffer *buffer);
|
|
|
|
#endif
|