mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-02 09:31:55 +00:00
bfe7bf8590
This commit was created with scripts/clean-includes. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20230202133830.2152150-19-armbru@redhat.com>
28 lines
569 B
C
28 lines
569 B
C
/*
|
|
* udmabuf helper functions.
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
#include "qemu/osdep.h"
|
|
#include "qapi/error.h"
|
|
#include "ui/console.h"
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
int udmabuf_fd(void)
|
|
{
|
|
static bool first = true;
|
|
static int udmabuf;
|
|
|
|
if (!first) {
|
|
return udmabuf;
|
|
}
|
|
first = false;
|
|
|
|
udmabuf = open("/dev/udmabuf", O_RDWR);
|
|
if (udmabuf < 0) {
|
|
warn_report("open /dev/udmabuf: %s", strerror(errno));
|
|
}
|
|
return udmabuf;
|
|
}
|