android_kernel_motorola_sm6375/drivers/media
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Chen-Yu Tsai 54e1abbe85 media: v4l2-mem2mem: Apply DST_QUEUE_OFF_BASE on MMAP buffers across ioctls
commit 8310ca94075e784bbb06593cd6c068ee6b6e4ca6 upstream.

DST_QUEUE_OFF_BASE is applied to offset/mem_offset on MMAP capture buffers
only for the VIDIOC_QUERYBUF ioctl, while the userspace fields (including
offset/mem_offset) are filled in for VIDIOC_{QUERY,PREPARE,Q,DQ}BUF
ioctls. This leads to differences in the values presented to userspace.
If userspace attempts to mmap the capture buffer directly using values
from DQBUF, it will fail.

Move the code that applies the magic offset into a helper, and call
that helper from all four ioctl entry points.

[hverkuil: drop unnecessary '= 0' in v4l2_m2m_querybuf() for ret]

Fixes: 7f98639def ("V4L/DVB: add memory-to-memory device helper framework for videobuf")
Fixes: 908a0d7c58 ("[media] v4l: mem2mem: port to videobuf2")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
[OP: backport to 5.4: adjusted return logic in v4l2_m2m_qbuf() to match the
logic in the original commit: call v4l2_m2m_adjust_mem_offset() only if !ret
and before the v4l2_m2m_try_schedule() call]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-11 12:57:52 +02:00
..
cec media: cec-adap.c: fix is_configuring state 2022-06-14 18:11:28 +02:00
common media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach() 2022-01-27 09:19:43 +01:00
dvb-core
dvb-frontends
firewire
i2c media: ov7670: remove ov7670_power_off from ov7670_remove 2022-06-14 18:11:37 +02:00
mc
mmc
pci media: cx25821: Fix the warning when removing the module 2022-06-14 18:11:26 +02:00
platform media: coda: Add more H264 levels for CODA960 2022-06-14 18:11:47 +02:00
radio
rc media: igorplugusb: receiver overflow should be reported 2022-01-27 09:19:43 +01:00
spi
tuners
usb media: pvrusb2: fix array-index-out-of-bounds in pvr2_i2c_core_init 2022-06-14 18:11:37 +02:00
v4l2-core media: v4l2-mem2mem: Apply DST_QUEUE_OFF_BASE on MMAP buffers across ioctls 2022-08-11 12:57:52 +02:00
Kconfig
Makefile