[v2,6/6] libcamera: mali-c55: Add stride and size to rawConfig
diff mbox series

Message ID 20240625190423.291429-7-jacopo.mondi@ideasonboard.com
State New
Headers show
Series
  • Miscellaneous Mali-C55 Pipeline Fixes
Related show

Commit Message

Jacopo Mondi June 25, 2024, 7:04 p.m. UTC
From: Daniel Scally <dan.scally@ideasonboard.com>

Complete the RAW StreamConfiguration by populating the frame stride and
the frame size.

Set the minimum required alignment to 4 bytes as the Mali C55 ISP output
RAW formats expanded to 16 bits and a RAW Bayer macro-pixel requires
two sample to be complete.

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/libcamera/pipeline/mali-c55/mali-c55.cpp | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Kieran Bingham June 25, 2024, 8:26 p.m. UTC | #1
Quoting Jacopo Mondi (2024-06-25 20:04:19)
> From: Daniel Scally <dan.scally@ideasonboard.com>
> 
> Complete the RAW StreamConfiguration by populating the frame stride and
> the frame size.
> 
> Set the minimum required alignment to 4 bytes as the Mali C55 ISP output
> RAW formats expanded to 16 bits and a RAW Bayer macro-pixel requires

s/expanded/expands/ ?

> two sample to be complete.

s/sample/samples/

> 
> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---
>  src/libcamera/pipeline/mali-c55/mali-c55.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> index f1c057c1aeb4..f52fc1e95a20 100644
> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> @@ -367,6 +367,10 @@ CameraConfiguration::Status MaliC55CameraConfiguration::validate()
>  
>                 maxSize = rawSize;
>  
> +               const PixelFormatInfo &info = PixelFormatInfo::info(rawConfig->pixelFormat);
> +               rawConfig->stride = info.stride(rawConfig->size.width, 0, 4);
> +               rawConfig->frameSize = info.frameSize(rawConfig->size, 4);
> +

Looks good. We should really have a validation in lc-compliance that
checks both stride and frameSize are set I think.

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

>                 rawConfig->setStream(const_cast<Stream *>(&data_->frStream_));
>                 frPipeAvailable = false;
>         }
> -- 
> 2.45.2
>

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 f1c057c1aeb4..f52fc1e95a20 100644
--- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp
+++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
@@ -367,6 +367,10 @@  CameraConfiguration::Status MaliC55CameraConfiguration::validate()
 
 		maxSize = rawSize;
 
+		const PixelFormatInfo &info = PixelFormatInfo::info(rawConfig->pixelFormat);
+		rawConfig->stride = info.stride(rawConfig->size.width, 0, 4);
+		rawConfig->frameSize = info.frameSize(rawConfig->size, 4);
+
 		rawConfig->setStream(const_cast<Stream *>(&data_->frStream_));
 		frPipeAvailable = false;
 	}