[libcamera-devel,v3,1/4] libcamera: ipa: raspberrypi: ALSC: Camera mode does not need to be atomic

Message ID 20200801080151.4282-2-david.plowman@raspberrypi.com
State Accepted
Headers show
Series
  • Raspberry Pi ALSC improvements
Related show

Commit Message

David Plowman Aug. 1, 2020, 8:01 a.m. UTC
In the libcamera framework, SwitchMode (which overwrites the
camera_mode) cannot run concurrently with Prepare (which uses it).

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/ipa/raspberrypi/controller/rpi/alsc.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Naushir Patuck Aug. 4, 2020, 8:49 a.m. UTC | #1
Hi David,

Thank you for the patch.

On Sat, 1 Aug 2020 at 09:02, David Plowman
<david.plowman@raspberrypi.com> wrote:
>
> In the libcamera framework, SwitchMode (which overwrites the
> camera_mode) cannot run concurrently with Prepare (which uses it).
>
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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


> ---
>  src/ipa/raspberrypi/controller/rpi/alsc.hpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/ipa/raspberrypi/controller/rpi/alsc.hpp b/src/ipa/raspberrypi/controller/rpi/alsc.hpp
> index 3806257..e895913 100644
> --- a/src/ipa/raspberrypi/controller/rpi/alsc.hpp
> +++ b/src/ipa/raspberrypi/controller/rpi/alsc.hpp
> @@ -59,7 +59,7 @@ private:
>         // configuration is read-only, and available to both threads
>         AlscConfig config_;
>         bool first_time_;
> -       std::atomic<CameraMode> camera_mode_;
> +       CameraMode camera_mode_;
>         std::thread async_thread_;
>         void asyncFunc(); // asynchronous thread function
>         std::mutex mutex_;
> --
> 2.20.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/ipa/raspberrypi/controller/rpi/alsc.hpp b/src/ipa/raspberrypi/controller/rpi/alsc.hpp
index 3806257..e895913 100644
--- a/src/ipa/raspberrypi/controller/rpi/alsc.hpp
+++ b/src/ipa/raspberrypi/controller/rpi/alsc.hpp
@@ -59,7 +59,7 @@  private:
 	// configuration is read-only, and available to both threads
 	AlscConfig config_;
 	bool first_time_;
-	std::atomic<CameraMode> camera_mode_;
+	CameraMode camera_mode_;
 	std::thread async_thread_;
 	void asyncFunc(); // asynchronous thread function
 	std::mutex mutex_;