<div dir="ltr"><div dir="ltr">Hi Kieran,<div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 19 Oct 2020 at 15:01, 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">Hi Naush,<br>
<br>
On 19/10/2020 11:02, Naushir Patuck wrote:<br>
> Hi all,<br>
> <br>
> Gentle ping to get some comments on this one. If you prefer, I could<br>
> submit as an official patch to review?<br>
> <br>
> Thanks,<br>
> Naush<br>
> <br>
> On Fri, 2 Oct 2020 at 10:33, Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>> wrote:<br>
>><br>
>> Hi all,<br>
>><br>
>> I would like to resurrect the topic of passing controls to the pipeline handlers and ipas on startup. We talked about this some time back, and unfortunately it drifted off my radar.<br>
>><br>
>> Attached is some work I've done to resurrect this discussion. I have added the ability for an application to pass in controls through the camera::start() public API. This is similar to how controls are passed in though Requests, the only difference being that if we do pass it in the latter, we could incur multiple frames of delay before they are applied. This would be unsuitable for a lot of users I feel. This change gives us a huge jump in getting to feature parity with the existing Raspberry Pi camera stack.<br>
<br>
Passing this in through start sounds a bit odd to me.<br>
<br>
Should this be part of the camera->configure() phase?<br>
<br>
It's setting the initial configuration right?<br>
<br>
And we can add a ControlList to the CameraConfiguration without needing<br>
to update any function signatures.<br>
<br>
Then when a pipeline is called with configure(), it needs to apply any<br>
controls in the list at that point. And it looks like the<br>
CameraConfiguration is already passed through to:<br>
<br>
int RPiCameraData::configureIPA(const CameraConfiguration *config)<br>
<br>
So, then there is the information required at that phase too?<br>
<br>
I'm wondering if I've missed something obvious that would have prevented<br>
you from already using this approach?<br></blockquote><div><br></div><div>Indeed, this was one of the approaches we discussed some time back. However, as you mentioned, CameraConfiguration gets set in the camera->configure() phase, and this may not necessarily be what we want. An application may want to set startup parameters without doing a camera->configure() in a run. With this change, we would do a sequence like start(), stop() start(new config parameters). If we were to do start(), stop() configure(new config parameters), start(), it may incur additional overheads in calling configure() only to setup some new startup params, where the configure() might be going to the kernel and calling the sensors to set itself up again, even though it is not needed. Hope that makes sense?</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>
Kieran<br>
<br>
<br>
>><br>
>> There are a couple of things to address in these changes:<br>
>> - I have modified the camera::start() public API with the following signature: int start(ControlList *controls = nullptr). I know the convention is to use a reference here, but I wanted to keep API backward compatible, and a pointer can have a default value nullptr. I could also overload start and keep the old and new signature perhaps, but not sure on the policy for public methods having multiple signatures.<br>
>><br>
>> - the IPA context wrapper code needs the ability to serialise IPAOperationData structures. This is needed for this code, as well as for configure() as part of an earlier set of changes.>> Please note, this patch set is for discussion to start with and not<br>
ready to submit as-is. Happy to hear your thoughts.<br>
>><br>
>> Regards,<br>
>> Naush<br>
>><br>
>> Naushir Patuck (5):<br>
>> pipeline: raspberrypi: Sensor flips should be applied unconditionally<br>
>> libcamera: pipeline: Pass libcamera controls into<br>
>> pipeline_handler::start()<br>
>> libcamera: ipa: Pass a set of controls and return results from<br>
>> ipa::start()<br>
>> pipeline: ipa: raspberrypi: Pass controls to IPA on start<br>
>> DNI: qcam: Simple test to pass controls on camera::start()<br>
>><br>
>> Documentation/guides/pipeline-handler.rst | 4 +-<br>
>> include/libcamera/camera.h | 2 +-<br>
>> .../libcamera/internal/ipa_context_wrapper.h | 3 +-<br>
>> include/libcamera/internal/pipeline_handler.h | 2 +-<br>
>> include/libcamera/ipa/ipa_interface.h | 3 +-<br>
>> include/libcamera/ipa/raspberrypi.h | 1 +<br>
>> src/ipa/libipa/ipa_interface_wrapper.cpp | 4 +-<br>
>> src/ipa/raspberrypi/raspberrypi.cpp | 50 ++++++++++++-------<br>
>> src/ipa/rkisp1/rkisp1.cpp | 3 +-<br>
>> src/ipa/vimc/vimc.cpp | 6 ++-<br>
>> src/libcamera/camera.cpp | 11 ++--<br>
>> src/libcamera/ipa_context_wrapper.cpp | 6 ++-<br>
>> src/libcamera/ipa_interface.cpp | 7 +++<br>
>> src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +-<br>
>> .../pipeline/raspberrypi/raspberrypi.cpp | 46 ++++++++++-------<br>
>> src/libcamera/pipeline/rkisp1/rkisp1.cpp | 9 ++--<br>
>> src/libcamera/pipeline/simple/simple.cpp | 4 +-<br>
>> src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 4 +-<br>
>> src/libcamera/pipeline/vimc/vimc.cpp | 7 +--<br>
>> src/libcamera/pipeline_handler.cpp | 1 +<br>
>> src/libcamera/proxy/ipa_proxy_linux.cpp | 3 +-<br>
>> src/libcamera/proxy/ipa_proxy_thread.cpp | 13 +++--<br>
>> src/qcam/main_window.cpp | 7 ++-<br>
>> test/ipa/ipa_interface_test.cpp | 3 +-<br>
>> test/ipa/ipa_wrappers_test.cpp | 5 +-<br>
>> 25 files changed, 134 insertions(+), 74 deletions(-)<br>
>><br>
>> --<br>
>> 2.25.1<br>
>><br>
> _______________________________________________<br>
> libcamera-devel mailing list<br>
> <a href="mailto:libcamera-devel@lists.libcamera.org" target="_blank">libcamera-devel@lists.libcamera.org</a><br>
> <a href="https://lists.libcamera.org/listinfo/libcamera-devel" rel="noreferrer" target="_blank">https://lists.libcamera.org/listinfo/libcamera-devel</a><br>
> <br>
<br>
-- <br>
Regards<br>
--<br>
Kieran<br>
</blockquote></div></div>