<div dir="ltr"><div dir="ltr">Hi Kieran,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 28 May 2022 at 23:52, 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">Quoting Naushir Patuck (2022-05-25 12:05:49)<br>
> Hi all,<br>
> <br>
> On Tue, 22 Feb 2022 at 06:11, Laurent Pinchart <<br>
> <a href="mailto:laurent.pinchart@ideasonboard.com" target="_blank">laurent.pinchart@ideasonboard.com</a>> wrote:<br>
> <br>
> > 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<br>
> > 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<br>
> > 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>
> > > +<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>
> ><br>
> <br>
> Have we come to a resolution on this?  It's winding up some of our users,<br>
> and we could do with suppressing these warnings :-)<br>
<br>
I have pretty low availabilty for the next couple of weeks with<br>
holiday.<br>
<br>
Would you be able to send a patch with Laurents suggestion above?<br>
Hopefully that could be merged quicker.<br></blockquote><div><br></div><div>Sure, I can give it a go.  It will probably have to wait for next week as I am</div><div>off for the week after today.  I'll post a patch when it's done.</div><div><br></div><div>Regards,</div><div>Naush</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>
Of course adding the test pattern controls to the IMX477 is another<br>
option too?<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">--<br>
Regards<br>
<br>
Kieran<br>
<br>
<br>
> <br>
> Regards,<br>
> Naush<br>
> <br>
> <br>
> <br>
> ><br>
> > >  }<br>
> > ><br>
> > >  int CameraSensor::initProperties()<br>
> ><br>
> > --<br>
> > Regards,<br>
> ><br>
> > Laurent Pinchart<br>
> ><br>
</blockquote></div></div>