[libcamera-devel,v2,1/4] raspberrypi: Add the correct integer const postfix for FrameDurations
diff mbox series

Message ID 20210124140506.786503-1-naush@raspberrypi.com
State Superseded
Headers show
Series
  • [libcamera-devel,v2,1/4] raspberrypi: Add the correct integer const postfix for FrameDurations
Related show

Commit Message

Naushir Patuck Jan. 24, 2021, 2:05 p.m. UTC
At startup, ControlInfoMap::generateIdmap() threw a log message warning
that the controls::FrameDurations had a type mismatch based on the
min/max values provided in libcamera::RPi::Controls initialiser.

Fix this warning by adding and explicit int64_t postfix to the const
values for min and max.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideaasonboard.com>
---
 include/libcamera/ipa/raspberrypi.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart Jan. 24, 2021, 5:21 p.m. UTC | #1
Hi Naush,

Thank you for the patch.

On Sun, Jan 24, 2021 at 02:05:03PM +0000, Naushir Patuck wrote:
> At startup, ControlInfoMap::generateIdmap() threw a log message warning
> that the controls::FrameDurations had a type mismatch based on the
> min/max values provided in libcamera::RPi::Controls initialiser.
> 
> Fix this warning by adding and explicit int64_t postfix to the const

s/and/an/

> values for min and max.

But that doesn't match the patch, you're using INT64_C(). If you can
give me an updated commit message I'll fix it when applying.

> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideaasonboard.com>
> ---
>  include/libcamera/ipa/raspberrypi.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h
> index 1de36039cee0..4038428bdba4 100644
> --- a/include/libcamera/ipa/raspberrypi.h
> +++ b/include/libcamera/ipa/raspberrypi.h
> @@ -7,6 +7,8 @@
>  #ifndef __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_H__
>  #define __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_H__
>  
> +#include <stdint.h>
> +
>  #include <libcamera/control_ids.h>
>  #include <libcamera/controls.h>
>  
> @@ -65,7 +67,7 @@ static const ControlInfoMap Controls = {
>  	{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },
>  	{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },
>  	{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },
> -	{ &controls::FrameDurations, ControlInfo(1000, 1000000000) },
> +	{ &controls::FrameDurations, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },
>  };
>  
>  } /* namespace RPi */
Kieran Bingham Jan. 25, 2021, 2:31 p.m. UTC | #2
Hi Laurent,

On 24/01/2021 17:21, Laurent Pinchart wrote:
> Hi Naush,
> 
> Thank you for the patch.
> 
> On Sun, Jan 24, 2021 at 02:05:03PM +0000, Naushir Patuck wrote:
>> At startup, ControlInfoMap::generateIdmap() threw a log message warning
>> that the controls::FrameDurations had a type mismatch based on the
>> min/max values provided in libcamera::RPi::Controls initialiser.
>>
>> Fix this warning by adding and explicit int64_t postfix to the const
> 
> s/and/an/
> 
>> values for min and max.
> 
> But that doesn't match the patch, you're using INT64_C(). If you can
> give me an updated commit message I'll fix it when applying.
> 
>> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> Reviewed-by: Kieran Bingham <kieran.bingham@ideaasonboard.com>

s/ideaasonboard/ideasonboard/ when applying too ;-)

--
Kieran


>> ---
>>  include/libcamera/ipa/raspberrypi.h | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h
>> index 1de36039cee0..4038428bdba4 100644
>> --- a/include/libcamera/ipa/raspberrypi.h
>> +++ b/include/libcamera/ipa/raspberrypi.h
>> @@ -7,6 +7,8 @@
>>  #ifndef __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_H__
>>  #define __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_H__
>>  
>> +#include <stdint.h>
>> +
>>  #include <libcamera/control_ids.h>
>>  #include <libcamera/controls.h>
>>  
>> @@ -65,7 +67,7 @@ static const ControlInfoMap Controls = {
>>  	{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },
>>  	{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },
>>  	{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },
>> -	{ &controls::FrameDurations, ControlInfo(1000, 1000000000) },
>> +	{ &controls::FrameDurations, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },
>>  };
>>  
>>  } /* namespace RPi */
>

Patch
diff mbox series

diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h
index 1de36039cee0..4038428bdba4 100644
--- a/include/libcamera/ipa/raspberrypi.h
+++ b/include/libcamera/ipa/raspberrypi.h
@@ -7,6 +7,8 @@ 
 #ifndef __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_H__
 #define __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_H__
 
+#include <stdint.h>
+
 #include <libcamera/control_ids.h>
 #include <libcamera/controls.h>
 
@@ -65,7 +67,7 @@  static const ControlInfoMap Controls = {
 	{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },
 	{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },
 	{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },
-	{ &controls::FrameDurations, ControlInfo(1000, 1000000000) },
+	{ &controls::FrameDurations, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },
 };
 
 } /* namespace RPi */