]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
media: rcar-vin: Use user provided buffers when starting
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Sat, 11 Sep 2021 19:19:58 +0000 (21:19 +0200)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:32:43 +0000 (07:32 +0100)
commit1e69f7695c350a678f96582abe438635271c1651
treee61b7e8a2ac6029fe716079a0b820b1ca7819616
parent60709550078a53cd81e359d771b93829f4e667fb
media: rcar-vin: Use user provided buffers when starting

BugLink: https://bugs.launchpad.net/bugs/1951822
[ Upstream commit a5991c4e947153418f71f4689614b87ca0551b81 ]

When adding an internal scratch buffer to improve buffer handling when
stopping it was also erroneously used when syncing at capture start.
This led to that the first three buffers captured were always dropped
as they were captured in the scratch buffer instead of in a buffer
provided by the user.

Allow the hardware to be given user provided buffers when preparing for
capture in the stopped state. This still allows the driver to sync with
the hardware and always completes the buffers to user-space in the
correct order as no buffers are completed before the sync is complete.
This change improves the driver as buffers are completed and given to
the user three frames earlier than before.

The change also fixes a warning produced by v4l2-compliance,

    warn: v4l2-test-buffers.cpp(448): got sequence number 3, expected 0

[hverkuil: fixed some typos in the Subject and the log message]

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/media/platform/rcar-vin/rcar-dma.c