[libcamera-devel] ipa: raspberrypi: Reset embedded data parser on configure
diff mbox series

Message ID 20220802084526.4786-1-david.plowman@raspberrypi.com
State Accepted
Commit 91cf84fd4e6d2b416b4545686fa06661e7b945d5
Headers show
Series
  • [libcamera-devel] ipa: raspberrypi: Reset embedded data parser on configure
Related show

Commit Message

David Plowman Aug. 2, 2022, 8:45 a.m. UTC
When we switch camera mode following a pipeline reconfiguration, the
embedded data parser should be "reset" to discard any data that it may
have cached and that might now be invalid.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
---
 src/ipa/raspberrypi/cam_helper.cpp | 1 +
 1 file changed, 1 insertion(+)

Comments

Naushir Patuck Aug. 2, 2022, 9:45 a.m. UTC | #1
Hi David,


On Tue, 2 Aug 2022 at 09:45, David Plowman via libcamera-devel <
libcamera-devel@lists.libcamera.org> wrote:

> When we switch camera mode following a pipeline reconfiguration, the
> embedded data parser should be "reset" to discard any data that it may
> have cached and that might now be invalid.
>
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
>

Reviewed-by: Naushir Patuck <naush@raspberrypi.com>


> ---
>  src/ipa/raspberrypi/cam_helper.cpp | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/ipa/raspberrypi/cam_helper.cpp
> b/src/ipa/raspberrypi/cam_helper.cpp
> index 37b66198..cac8f39e 100644
> --- a/src/ipa/raspberrypi/cam_helper.cpp
> +++ b/src/ipa/raspberrypi/cam_helper.cpp
> @@ -106,6 +106,7 @@ void CamHelper::setCameraMode(const CameraMode &mode)
>  {
>         mode_ = mode;
>         if (parser_) {
> +               parser_->reset();
>                 parser_->setBitsPerPixel(mode.bitdepth);
>                 parser_->setLineLengthBytes(0); /* We use SetBufferSize. */
>         }
> --
> 2.30.2
>
>
Laurent Pinchart Aug. 2, 2022, 10:47 a.m. UTC | #2
Hi David,

Thank you for the patch.

On Tue, Aug 02, 2022 at 09:45:26AM +0100, David Plowman via libcamera-devel wrote:
> When we switch camera mode following a pipeline reconfiguration, the
> embedded data parser should be "reset" to discard any data that it may
> have cached and that might now be invalid.
> 
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/ipa/raspberrypi/cam_helper.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp
> index 37b66198..cac8f39e 100644
> --- a/src/ipa/raspberrypi/cam_helper.cpp
> +++ b/src/ipa/raspberrypi/cam_helper.cpp
> @@ -106,6 +106,7 @@ void CamHelper::setCameraMode(const CameraMode &mode)
>  {
>  	mode_ = mode;
>  	if (parser_) {
> +		parser_->reset();
>  		parser_->setBitsPerPixel(mode.bitdepth);
>  		parser_->setLineLengthBytes(0); /* We use SetBufferSize. */
>  	}

Patch
diff mbox series

diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp
index 37b66198..cac8f39e 100644
--- a/src/ipa/raspberrypi/cam_helper.cpp
+++ b/src/ipa/raspberrypi/cam_helper.cpp
@@ -106,6 +106,7 @@  void CamHelper::setCameraMode(const CameraMode &mode)
 {
 	mode_ = mode;
 	if (parser_) {
+		parser_->reset();
 		parser_->setBitsPerPixel(mode.bitdepth);
 		parser_->setLineLengthBytes(0); /* We use SetBufferSize. */
 	}