media: bttv: add back vbi hack
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 30 Nov 2023 12:58:11 +0000 (13:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:35 +0000 (15:35 -0800)
commit54ce93d7e66ee3e0451103ff2ff9a9b227f9f40a
tree9d5465ad8fbb644b293b269968d5a1179a39c91d
parente8fa30fa7157f0b97a6aff84518c00558624a618
media: bttv: add back vbi hack

[ Upstream commit 3f1faa154a4316b1b585a25394697504b3c24e98 ]

The old (now removed) videobuf framework had an optional vbi hack where
the sequence number of the frame counter was copied in the last 4 bytes
of the buffer. This hack was active only for the read() interface
(so not for streaming I/O), and it was enabled by bttv. This allowed
applications that used read() for the VBI data to match it with the
corresponding video frame.

When bttv was converted to vb2 this hack was forgotten, but some old
applications rely on this.

So add this back, but this time in the bttv driver rather than in the
vb2 framework.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: b7ec3212a73a ("media: bttv: convert to vb2")
Tested-by: Dr. David Alan Gilbert <dave@treblig.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/pci/bt8xx/bttv-driver.c