<div dir="ltr"><div dir="ltr">Hi all,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 22 Feb 2022 at 06:11, Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</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 Kieran,<br>
<br>
Thank you for the patch.<br>
<br>
On Sat, Feb 12, 2022 at 11:34:07PM +0000, Kieran Bingham wrote:<br>
> After the CameraSensor class has initialised properties, a default<br>
> setting is applied to ensure that test pattern modes are disabled unless<br>
> explicitly requested.<br>
> <br>
> This does not currently check to see if test patterns are supported on<br>
> the CameraSensor and the applyTestPatternMode call will report a failure<br>
> if it attempts to set a mode when not supported.<br>
> <br>
> Move the initialisation of the test pattern mode to the implementation<br>
> of the control mappings to ensure that it is correctly reset at start<br>
> up, while the code path will have already completed early if not<br>
> supported.<br>
> <br>
> Bug: <a href="https://github.com/raspberrypi/libcamera-apps/issues/249" rel="noreferrer" target="_blank">https://github.com/raspberrypi/libcamera-apps/issues/249</a><br>
> Signed-off-by: Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com" target="_blank">kieran.bingham@ideasonboard.com</a>><br>
> ---<br>
>  src/libcamera/camera_sensor.cpp | 5 ++++-<br>
>  1 file changed, 4 insertions(+), 1 deletion(-)<br>
> <br>
> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp<br>
> index 345b4a170d47..3a6a1a6bca77 100644<br>
> --- a/src/libcamera/camera_sensor.cpp<br>
> +++ b/src/libcamera/camera_sensor.cpp<br>
> @@ -172,7 +172,7 @@ int CameraSensor::init()<br>
>       if (ret)<br>
>               return ret;<br>
>  <br>
> -     return applyTestPatternMode(controls::draft::TestPatternModeEnum::TestPatternModeOff);<br>
> +     return 0;<br>
>  }<br>
>  <br>
>  int CameraSensor::validateSensorDriver()<br>
> @@ -372,6 +372,9 @@ void CameraSensor::initTestPatternModes()<br>
>  <br>
>               testPatternModes_.push_back(it->second);<br>
>       }<br>
> +<br>
> +     /* Initialise the sensor with test patterns disabled. */<br>
> +     applyTestPatternMode(controls::draft::TestPatternModeEnum::TestPatternModeOff);<br>
<br>
Errors when applyting the test pattern are not propagated up anymore.<br>
<br>
A different approach if you don't want to turn all void functions in the<br>
call stack to return an int is to move the error message when<br>
testPatternModes_.empty() from CameraSensor::applyTestPatternMode() to<br>
CameraSensor::setTestPatternMode(). You will need to keep the check in<br>
CameraSensor::applyTestPatternMode() in order to return 0, but<br>
CameraSensor::setTestPatternMode() could return a proper error code.<br></blockquote><div><br></div><div>Have we come to a resolution on this?  It's winding up some of our users,</div><div>and we could do with suppressing these warnings :-)</div><div><br></div><div>Regards,</div><div>Naush</div><div><br></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>
>  }<br>
>  <br>
>  int CameraSensor::initProperties()<br>
<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
</blockquote></div></div>