[v2] libcamera: formats: Change bytesPerGroup of RGB565 and RGB565_BE from 3 to 2
diff mbox series

Message ID 20241028030428.1813579-1-qi.hou@nxp.com
State Accepted
Commit ff069d87e263cd41f9d5d74774609c8b0ecbcb2a
Headers show
Series
  • [v2] libcamera: formats: Change bytesPerGroup of RGB565 and RGB565_BE from 3 to 2
Related show

Commit Message

Qi Hou Oct. 28, 2024, 3:04 a.m. UTC
The RGB565 and RGB565_BE formats incorrectly specify a wrong value
of 3 bytes per group of pixels, when they actually use 2. Fix them.

Signed-off-by: Hou Qi <qi.hou@nxp.com>
---
 src/libcamera/formats.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jacopo Mondi Oct. 28, 2024, 7:28 a.m. UTC | #1
Hello Hou Qui
  thanks for the patch

On Mon, Oct 28, 2024 at 12:04:28PM +0900, Hou Qi wrote:
> The RGB565 and RGB565_BE formats incorrectly specify a wrong value
> of 3 bytes per group of pixels, when they actually use 2. Fix them.
>
> Signed-off-by: Hou Qi <qi.hou@nxp.com>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

> ---
>  src/libcamera/formats.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> index dbefb094..bfcdfc08 100644
> --- a/src/libcamera/formats.cpp
> +++ b/src/libcamera/formats.cpp
> @@ -157,7 +157,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
>  		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
>  		.packed = false,
>  		.pixelsPerGroup = 1,
> -		.planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
> +		.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},
>  	} },
>  	{ formats::RGB565_BE, {
>  		.name = "RGB565_BE",
> @@ -167,7 +167,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
>  		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
>  		.packed = false,
>  		.pixelsPerGroup = 1,
> -		.planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
> +		.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},
>  	} },
>  	{ formats::BGR888, {
>  		.name = "BGR888",
> --
> 2.34.1
>
Laurent Pinchart Oct. 28, 2024, 4:35 p.m. UTC | #2
Hi Hou,

Thank you for the patch.

On Mon, Oct 28, 2024 at 12:04:28PM +0900, Hou Qi wrote:
> The RGB565 and RGB565_BE formats incorrectly specify a wrong value
> of 3 bytes per group of pixels, when they actually use 2. Fix them.
> 
> Signed-off-by: Hou Qi <qi.hou@nxp.com>

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

> ---
>  src/libcamera/formats.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> index dbefb094..bfcdfc08 100644
> --- a/src/libcamera/formats.cpp
> +++ b/src/libcamera/formats.cpp
> @@ -157,7 +157,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
>  		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
>  		.packed = false,
>  		.pixelsPerGroup = 1,
> -		.planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
> +		.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},
>  	} },
>  	{ formats::RGB565_BE, {
>  		.name = "RGB565_BE",
> @@ -167,7 +167,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
>  		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
>  		.packed = false,
>  		.pixelsPerGroup = 1,
> -		.planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
> +		.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},
>  	} },
>  	{ formats::BGR888, {
>  		.name = "BGR888",

Patch
diff mbox series

diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index dbefb094..bfcdfc08 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -157,7 +157,7 @@  const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
 		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
 		.packed = false,
 		.pixelsPerGroup = 1,
-		.planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
+		.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},
 	} },
 	{ formats::RGB565_BE, {
 		.name = "RGB565_BE",
@@ -167,7 +167,7 @@  const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
 		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
 		.packed = false,
 		.pixelsPerGroup = 1,
-		.planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
+		.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},
 	} },
 	{ formats::BGR888, {
 		.name = "BGR888",