mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-23 09:42:19 +03:00
v4l2loopback: Allow unmapped buffers
Allow dequeuing buffers that are not mapped. It is not uncommon for clients to map the buffer only when they are ready to read it. JIRA SHLD2-370 Change-Id: I6d815c6bbfd0a640a2e575d6da26d5019dd7f756 Signed-off-by: Illia Ragozin <iragozin@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3267279 GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: svcacv <svcacv@nvidia.com>
This commit is contained in:
committed by
Jon Hunter
parent
ff7cf02ef2
commit
2e69020353
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0+
|
// SPDX-License-Identifier: GPL-2.0+
|
||||||
// SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
// SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
|
||||||
/* -*- c-file-style: "linux" -*- */
|
/* -*- c-file-style: "linux" -*- */
|
||||||
/*
|
/*
|
||||||
@@ -62,6 +62,7 @@ MODULE_AUTHOR("Vasily Levin, "
|
|||||||
"Stefan Diewald,"
|
"Stefan Diewald,"
|
||||||
"Anton Novikov"
|
"Anton Novikov"
|
||||||
"et al.");
|
"et al.");
|
||||||
|
MODULE_AUTHOR("NVIDIA Corporation");
|
||||||
#ifdef SNAPSHOT_VERSION
|
#ifdef SNAPSHOT_VERSION
|
||||||
MODULE_VERSION(__stringify(SNAPSHOT_VERSION));
|
MODULE_VERSION(__stringify(SNAPSHOT_VERSION));
|
||||||
#else
|
#else
|
||||||
@@ -1868,8 +1869,7 @@ static int vidioc_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
|
|||||||
(long long)(opener->read_position - 1), index);
|
(long long)(opener->read_position - 1), index);
|
||||||
if (!(dev->buffers[index].buffer.flags &
|
if (!(dev->buffers[index].buffer.flags &
|
||||||
V4L2_BUF_FLAG_MAPPED)) {
|
V4L2_BUF_FLAG_MAPPED)) {
|
||||||
dprintk("trying to return not mapped buf[%d]\n", index);
|
dprintk("returning not mapped buf[%d]\n", index);
|
||||||
return -EINVAL;
|
|
||||||
}
|
}
|
||||||
unset_flags(&dev->buffers[index]);
|
unset_flags(&dev->buffers[index]);
|
||||||
*buf = dev->buffers[index].buffer;
|
*buf = dev->buffers[index].buffer;
|
||||||
|
|||||||
Reference in New Issue
Block a user