[libcamera-devel] ipa: raspberrypi: Do not require SDN (spatial denoise) algorithm
diff mbox series

Message ID 20210217152400.1996-1-david.plowman@raspberrypi.com
State Accepted
Commit 9fe81a51abd2ad875e4343df5f0c2007242b8bcf
Headers show
Series
  • [libcamera-devel] ipa: raspberrypi: Do not require SDN (spatial denoise) algorithm
Related show

Commit Message

David Plowman Feb. 17, 2021, 3:24 p.m. UTC
A camera tuning is not required to load an SDN algorithm. In keeping
with other controls, do not fail when a particular control was
expecting this algorithm, just warn that it is not present.

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

Comments

Kieran Bingham Feb. 18, 2021, 11:40 a.m. UTC | #1
Hi David,

On 17/02/2021 15:24, David Plowman wrote:
> A camera tuning is not required to load an SDN algorithm. In keeping
> with other controls, do not fail when a particular control was
> expecting this algorithm, just warn that it is not present.
> 
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

We're in src/ipa here so perhaps a tag from Naush is useful, and we can
add it to the merge queue.
--
Kieran


> ---
>  src/ipa/raspberrypi/raspberrypi.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp
> index 81a3195c..4608dfd4 100644
> --- a/src/ipa/raspberrypi/raspberrypi.cpp
> +++ b/src/ipa/raspberrypi/raspberrypi.cpp
> @@ -875,7 +875,11 @@ void IPARPi::queueRequest(const ControlList &controls)
>  		case controls::NOISE_REDUCTION_MODE: {
>  			RPiController::DenoiseAlgorithm *sdn = dynamic_cast<RPiController::DenoiseAlgorithm *>(
>  				controller_.GetAlgorithm("SDN"));
> -			ASSERT(sdn);
> +			if (!sdn) {
> +				LOG(IPARPI, Warning)
> +					<< "Could not set NOISE_REDUCTION_MODE - no SDN algorithm";
> +				break;
> +			}
>  
>  			int32_t idx = ctrl.second.get<int32_t>();
>  			auto mode = DenoiseModeTable.find(idx);
>
Naushir Patuck Feb. 18, 2021, 12:39 p.m. UTC | #2
Hi David,

Thank you for your patch.

On Wed, 17 Feb 2021 at 15:24, David Plowman <david.plowman@raspberrypi.com>
wrote:

> A camera tuning is not required to load an SDN algorithm. In keeping
> with other controls, do not fail when a particular control was
> expecting this algorithm, just warn that it is not present.
>
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
>

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


> ---
>  src/ipa/raspberrypi/raspberrypi.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp
> b/src/ipa/raspberrypi/raspberrypi.cpp
> index 81a3195c..4608dfd4 100644
> --- a/src/ipa/raspberrypi/raspberrypi.cpp
> +++ b/src/ipa/raspberrypi/raspberrypi.cpp
> @@ -875,7 +875,11 @@ void IPARPi::queueRequest(const ControlList &controls)
>                 case controls::NOISE_REDUCTION_MODE: {
>                         RPiController::DenoiseAlgorithm *sdn =
> dynamic_cast<RPiController::DenoiseAlgorithm *>(
>                                 controller_.GetAlgorithm("SDN"));
> -                       ASSERT(sdn);
> +                       if (!sdn) {
> +                               LOG(IPARPI, Warning)
> +                                       << "Could not set
> NOISE_REDUCTION_MODE - no SDN algorithm";
> +                               break;
> +                       }
>
>                         int32_t idx = ctrl.second.get<int32_t>();
>                         auto mode = DenoiseModeTable.find(idx);
> --
> 2.20.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
>

Patch
diff mbox series

diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp
index 81a3195c..4608dfd4 100644
--- a/src/ipa/raspberrypi/raspberrypi.cpp
+++ b/src/ipa/raspberrypi/raspberrypi.cpp
@@ -875,7 +875,11 @@  void IPARPi::queueRequest(const ControlList &controls)
 		case controls::NOISE_REDUCTION_MODE: {
 			RPiController::DenoiseAlgorithm *sdn = dynamic_cast<RPiController::DenoiseAlgorithm *>(
 				controller_.GetAlgorithm("SDN"));
-			ASSERT(sdn);
+			if (!sdn) {
+				LOG(IPARPI, Warning)
+					<< "Could not set NOISE_REDUCTION_MODE - no SDN algorithm";
+				break;
+			}
 
 			int32_t idx = ctrl.second.get<int32_t>();
 			auto mode = DenoiseModeTable.find(idx);