From d6a569620c72b29c2eaf67b52278042a6f15f765 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 28 Jun 2021 14:55:05 +0200 Subject: [PATCH] v4l2: DmaBuf and MemFd are mostly the same If the caller asks for MemFd, pass a DmaBuf because it is mostly the same for v4l2. Not very correct but it's not yet trivial to fall back to memfd. And this way we have something to give to the clients that will work when the client asks for MemFd or MemPtr. --- spa/plugins/v4l2/v4l2-utils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index f31049dd6..f151652b3 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -1462,7 +1462,7 @@ mmap_init(struct impl *this, if (port->have_expbuf && d[0].type != SPA_ID_INVALID && - (d[0].type & (1u << SPA_DATA_DmaBuf))) { + (d[0].type & ((1u << SPA_DATA_DmaBuf)|(1u<log, "v4l2: '%s' VIDIOC_EXPBUF: %m", this->props.device); return -errno; } - d[0].type = SPA_DATA_DmaBuf; + if (d[0].type & (1u<