[1/7] libcamera: mali-c55: Limit max size to sensor resolution
diff mbox series

Message ID 20240613155949.1041061-2-dan.scally@ideasonboard.com
State Superseded
Headers show
Series
  • Miscellaneous Mali-C55 Pipeline Fixes
Related show

Commit Message

Dan Scally June 13, 2024, 3:59 p.m. UTC
From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

The Mali C55 ISP cannot upscale. The maximum allowed output size
is the sensor's resolution.

For RAW streams this is already handled in adjustRawSizes(), while
for processed streams the maximum allowed resolution was wrongly
set to the ISP maximum output size (8192x8192).

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/libcamera/pipeline/mali-c55/mali-c55.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kieran Bingham June 13, 2024, 7:22 p.m. UTC | #1
Quoting Daniel Scally (2024-06-13 16:59:43)
> From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> 
> The Mali C55 ISP cannot upscale. The maximum allowed output size
> is the sensor's resolution.
> 
> For RAW streams this is already handled in adjustRawSizes(), while
> for processed streams the maximum allowed resolution was wrongly
> set to the ISP maximum output size (8192x8192).
> 
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

When posting a patch authored by someone else, you still need to add a
Signed-off-by: tag.

git-send-email -s does this for you I think.



> ---
>  src/libcamera/pipeline/mali-c55/mali-c55.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> index 45c71c1d..9442d17c 100644
> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> @@ -342,7 +342,7 @@ CameraConfiguration::Status MaliC55CameraConfiguration::validate()
>                 rawConfig = &config;
>         }
>  

given the commit message, this looks like a good place to say:

	/*
	 * The C55 can not upscale. Limit the configuration to the ISP
	 * capabilities and the sensor resolution.
	 */

But either way:

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

> -       Size maxSize = kMaliC55MaxSize;
> +       Size maxSize = std::min(kMaliC55MaxSize, data_->resolution());
>         if (rawConfig) {
>                 /*
>                  * \todo Take into account the Bayer components ordering once
> -- 
> 2.30.2
>
Laurent Pinchart June 17, 2024, 4:56 a.m. UTC | #2
On Thu, Jun 13, 2024 at 08:22:55PM +0100, Kieran Bingham wrote:
> Quoting Daniel Scally (2024-06-13 16:59:43)
> > From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > 
> > The Mali C55 ISP cannot upscale. The maximum allowed output size
> > is the sensor's resolution.
> > 
> > For RAW streams this is already handled in adjustRawSizes(), while
> > for processed streams the maximum allowed resolution was wrongly
> > set to the ISP maximum output size (8192x8192).
> > 
> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> 
> When posting a patch authored by someone else, you still need to add a
> Signed-off-by: tag.
> 
> git-send-email -s does this for you I think.
> 
> > ---
> >  src/libcamera/pipeline/mali-c55/mali-c55.cpp | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> > index 45c71c1d..9442d17c 100644
> > --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> > +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> > @@ -342,7 +342,7 @@ CameraConfiguration::Status MaliC55CameraConfiguration::validate()
> >                 rawConfig = &config;
> >         }
> >  
> 
> given the commit message, this looks like a good place to say:
> 
> 	/*
> 	 * The C55 can not upscale. Limit the configuration to the ISP
> 	 * capabilities and the sensor resolution.
> 	 */
> 
> But either way:
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> > -       Size maxSize = kMaliC55MaxSize;
> > +       Size maxSize = std::min(kMaliC55MaxSize, data_->resolution());

If the two sizes are not ordered the same way by width and height, this
will likely not give you what you expect. One option is to use
Size::boundedTo(). You may need to consider the aspect ratio though.

> >         if (rawConfig) {
> >                 /*
> >                  * \todo Take into account the Bayer components ordering once

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
index 45c71c1d..9442d17c 100644
--- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp
+++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
@@ -342,7 +342,7 @@  CameraConfiguration::Status MaliC55CameraConfiguration::validate()
 		rawConfig = &config;
 	}
 
-	Size maxSize = kMaliC55MaxSize;
+	Size maxSize = std::min(kMaliC55MaxSize, data_->resolution());
 	if (rawConfig) {
 		/*
 		 * \todo Take into account the Bayer components ordering once