<div dir="ltr"><div dir="ltr">Hi Laurent, thank you for the patch.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 25, 2021 at 7:40 PM Jacopo Mondi <<a href="mailto:jacopo@jmondi.org" target="_blank">jacopo@jmondi.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Laurent,<br>
<br>
On Tue, May 25, 2021 at 12:46:21PM +0300, Laurent Pinchart wrote:<br>
> The recent merge (and revert) of commit 34bee5e84ecb ("libcamera:<br>
> V4L2Device: Remove the controls order assumption in updateControls()")<br>
> showed that 64-bit controls were missing from unit tests.<br>
><br>
> Fix this by testing the VIVID_CID_INTEGER64 control in the V4L2 video<br>
> device controls test.<br>
><br>
> Signed-off-by: Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com" target="_blank">laurent.pinchart@ideasonboard.com</a>><br></blockquote><div><br></div><div>Reviewed-by: Hirokazu Honda <<a href="mailto:hiroh@chromium.org">hiroh@chromium.org</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> ---<br>
> test/v4l2_videodevice/controls.cpp | 11 +++++++++++<br>
> 1 file changed, 11 insertions(+)<br>
><br>
> diff --git a/test/v4l2_videodevice/controls.cpp b/test/v4l2_videodevice/controls.cpp<br>
> index 8d42508192d8..0f603b85930d 100644<br>
> --- a/test/v4l2_videodevice/controls.cpp<br>
> +++ b/test/v4l2_videodevice/controls.cpp<br>
> @@ -16,6 +16,7 @@<br>
><br>
> /* These come from the vivid driver. */<br>
> #define VIVID_CID_CUSTOM_BASE (V4L2_CID_USER_BASE | 0xf000)<br>
> +#define VIVID_CID_INTEGER64 (VIVID_CID_CUSTOM_BASE + 3)<br>
<br>
I still wonder why these identifiers are not exported to uspace...<br>
<br>
Anyway, this looks good!<br>
<br>
Reviewed-by: Jacopo Mondi <<a href="mailto:jacopo@jmondi.org" target="_blank">jacopo@jmondi.org</a>> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks<br>
j<br>
<br>
> #define VIVID_CID_U8_4D_ARRAY (VIVID_CID_CUSTOM_BASE + 10)<br>
><br>
> /* Helper for VIVID_CID_U8_4D_ARRAY control array size: not from kernel. */<br>
> @@ -46,6 +47,7 @@ protected:<br>
> if (infoMap.find(V4L2_CID_BRIGHTNESS) == infoMap.end() ||<br>
> infoMap.find(V4L2_CID_CONTRAST) == infoMap.end() ||<br>
> infoMap.find(V4L2_CID_SATURATION) == infoMap.end() ||<br>
> + infoMap.find(VIVID_CID_INTEGER64) == infoMap.end() ||<br>
> infoMap.find(VIVID_CID_U8_4D_ARRAY) == infoMap.end()) {<br>
> cerr << "Missing controls" << endl;<br>
> return TestFail;<br>
> @@ -54,12 +56,14 @@ protected:<br>
> const ControlInfo &brightness = infoMap.find(V4L2_CID_BRIGHTNESS)->second;<br>
> const ControlInfo &contrast = infoMap.find(V4L2_CID_CONTRAST)->second;<br>
> const ControlInfo &saturation = infoMap.find(V4L2_CID_SATURATION)->second;<br>
> + const ControlInfo &int64 = infoMap.find(VIVID_CID_INTEGER64)->second;<br>
> const ControlInfo &u8 = infoMap.find(VIVID_CID_U8_4D_ARRAY)->second;<br>
><br>
> /* Test getting controls. */<br>
> ControlList ctrls = capture_->getControls({ V4L2_CID_BRIGHTNESS,<br>
> V4L2_CID_CONTRAST,<br>
> V4L2_CID_SATURATION,<br>
> + VIVID_CID_INTEGER64,<br>
> VIVID_CID_U8_4D_ARRAY });<br>
> if (ctrls.empty()) {<br>
> cerr << "Failed to get controls" << endl;<br>
> @@ -78,6 +82,12 @@ protected:<br>
> return TestFail;<br>
> }<br>
><br>
> + /*<br>
> + * The VIVID_CID_INTEGER64 control can take any value, just test<br>
> + * that its value can be retrieved and has the right type.<br>
> + */<br>
> + ctrls.get(VIVID_CID_INTEGER64).get<int64_t>();<br>
> +<br>
> uint8_t u8Min = u8.min().get<uint8_t>();<br>
> uint8_t u8Max = u8.max().get<uint8_t>();<br>
><br>
> @@ -94,6 +104,7 @@ protected:<br>
> ctrls.set(V4L2_CID_BRIGHTNESS, brightness.min());<br>
> ctrls.set(V4L2_CID_CONTRAST, contrast.max());<br>
> ctrls.set(V4L2_CID_SATURATION, saturation.min());<br>
> + ctrls.set(VIVID_CID_INTEGER64, int64.min());<br>
><br>
> std::array<uint8_t, VIVID_CID_U8_ARRAY_SIZE> u8Values;<br>
> std::fill(u8Values.begin(), u8Values.end(), u8.min().get<uint8_t>());<br>
> --<br>
> Regards,<br>
><br>
> Laurent Pinchart<br>
><br>
</blockquote></div></div>