<div dir="ltr"><div dir="ltr">Hi Kieran,<div><br></div><div>Thank you for your patch.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 12 Feb 2022 at 23:34, Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com">kieran.bingham@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">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></blockquote><div><br></div><div>This does reduce panic caused by the error message on startup for our imx477 users :-)</div><div><br></div><div>Reviewed-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</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>
 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>
<br>
 int CameraSensor::initProperties()<br>
-- <br>
2.32.0<br>
<br>
</blockquote></div></div>