summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2021-03-04 08:17:22 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-03-12 14:12:32 +0000
commit96c0eb338e5e9168147538736b688601c00b87f9 (patch)
treec14b4bbb4865f6c77e36c77195fad5d54f92d750 /test
parent6795ffe67f3318e474ee14141e5b394b0e5d2d85 (diff)
libcamera: delayed_controls: Add notion of priority write
If an exposure time change adjusts the vblanking limits, and we set both VBLANK and EXPOSURE controls through the VIDIOC_S_EXT_CTRLS ioctl, the latter may fail if the value is outside of the limits calculated by the old VBLANK value. This is a limitation in V4L2 and cannot be fixed by setting VBLANK before EXPOSURE in a single VIDIOC_S_EXT_CTRLS ioctl. The workaround here is to have the DelayedControls object mark the VBLANK control as "priority write", which then write VBLANK separately from (and ahead of) any other controls. This way, the sensor driver will update the EXPOSURE control with new limits before the new values is presented, and will thus be seen as valid. To support this, a new struct DelayedControls::ControlParams is used in the constructor to provide the control delay value as well as the priority write flag. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> [Kieran: Fix up trivial comments, merge conflicts] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'test')
-rw-r--r--test/delayed_contols.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/delayed_contols.cpp b/test/delayed_contols.cpp
index 50169b12..3855eb18 100644
--- a/test/delayed_contols.cpp
+++ b/test/delayed_contols.cpp
@@ -72,8 +72,8 @@ protected:
int singleControlNoDelay()
{
- std::unordered_map<uint32_t, unsigned int> delays = {
- { V4L2_CID_BRIGHTNESS, 0 },
+ std::unordered_map<uint32_t, DelayedControls::ControlParams> delays = {
+ { V4L2_CID_BRIGHTNESS, { 0, false } },
};
std::unique_ptr<DelayedControls> delayed =
std::make_unique<DelayedControls>(dev_.get(), delays);
@@ -109,8 +109,8 @@ protected:
int singleControlWithDelay()
{
- std::unordered_map<uint32_t, unsigned int> delays = {
- { V4L2_CID_BRIGHTNESS, 1 },
+ std::unordered_map<uint32_t, DelayedControls::ControlParams> delays = {
+ { V4L2_CID_BRIGHTNESS, { 1, false } },
};
std::unique_ptr<DelayedControls> delayed =
std::make_unique<DelayedControls>(dev_.get(), delays);
@@ -150,9 +150,9 @@ protected:
int dualControlsWithDelay(uint32_t startOffset)
{
- std::unordered_map<uint32_t, unsigned int> delays = {
- { V4L2_CID_BRIGHTNESS, 1 },
- { V4L2_CID_CONTRAST, 2 },
+ std::unordered_map<uint32_t, DelayedControls::ControlParams> delays = {
+ { V4L2_CID_BRIGHTNESS, { 1, false } },
+ { V4L2_CID_CONTRAST, { 2, false } },
};
std::unique_ptr<DelayedControls> delayed =
std::make_unique<DelayedControls>(dev_.get(), delays);
@@ -197,9 +197,9 @@ protected:
int dualControlsMultiQueue()
{
- std::unordered_map<uint32_t, unsigned int> delays = {
- { V4L2_CID_BRIGHTNESS, 1 },
- { V4L2_CID_CONTRAST, 2 },
+ std::unordered_map<uint32_t, DelayedControls::ControlParams> delays = {
+ { V4L2_CID_BRIGHTNESS, { 1, false } },
+ { V4L2_CID_CONTRAST, { 2, false } }
};
std::unique_ptr<DelayedControls> delayed =
std::make_unique<DelayedControls>(dev_.get(), delays);