[1/2] pipeline: rpi: Default to BayerFormat::Packing::None for RAW streams
diff mbox series

Message ID 20260624082705.272795-2-naush@raspberrypi.com
State New
Headers show
Series
  • RPi pipeline handler fixes
Related show

Commit Message

Naushir Patuck June 24, 2026, 8:24 a.m. UTC
In generateConfiguration(), set the default packing on RAW streams to
BayerFormat::Packing::None. This default is easier to handle over
CSI2 packed or PiSP Bayer compressed packaing options.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Plowman June 24, 2026, 8:41 a.m. UTC | #1
Hi Naush

Thanks for this!

On Wed, 24 Jun 2026 at 09:35, Naushir Patuck <naush@raspberrypi.com> wrote:
>
> In generateConfiguration(), set the default packing on RAW streams to
> BayerFormat::Packing::None. This default is easier to handle over
> CSI2 packed or PiSP Bayer compressed packaing options.
>
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> ---
>  src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> index 5a5acf6a164b..e0f364272746 100644
> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> @@ -410,7 +410,7 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole
>                         size = sensorSize;
>                         sensorFormat = data->findBestFormat(size, defaultRawBitDepth);
>                         pixelFormat = mbusCodeToPixelFormat(sensorFormat.code,
> -                                                           BayerFormat::Packing::CSI2);
> +                                                           BayerFormat::Packing::None);
>                         ASSERT(pixelFormat.isValid());
>                         colorSpace = ColorSpace::Raw;
>                         bufferCount = 2;
> --
> 2.53.0
>

I think we probably just want to check first whether all our
application-level code explicitly sets the packing after a
generateConfiguration() or not, as otherwise it would be a bit of a
behaviour change. Will get back to you on this...!

Thanks!

David
Laurent Pinchart June 24, 2026, 8:14 p.m. UTC | #2
On Wed, Jun 24, 2026 at 09:41:52AM +0100, David Plowman wrote:
> On Wed, 24 Jun 2026 at 09:35, Naushir Patuck <naush@raspberrypi.com> wrote:
> >
> > In generateConfiguration(), set the default packing on RAW streams to
> > BayerFormat::Packing::None. This default is easier to handle over
> > CSI2 packed or PiSP Bayer compressed packaing options.

s/packaing/packing/

> >
> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> > ---
> >  src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> > index 5a5acf6a164b..e0f364272746 100644
> > --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> > +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> > @@ -410,7 +410,7 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole
> >                         size = sensorSize;
> >                         sensorFormat = data->findBestFormat(size, defaultRawBitDepth);
> >                         pixelFormat = mbusCodeToPixelFormat(sensorFormat.code,
> > -                                                           BayerFormat::Packing::CSI2);
> > +                                                           BayerFormat::Packing::None);
> >                         ASSERT(pixelFormat.isValid());
> >                         colorSpace = ColorSpace::Raw;
> >                         bufferCount = 2;
> 
> I think we probably just want to check first whether all our
> application-level code explicitly sets the packing after a
> generateConfiguration() or not, as otherwise it would be a bit of a
> behaviour change. Will get back to you on this...!

Good idea.

I'd be fine defaulting to CSI-2 packing as that's standard, but on Pi 5
that's not a valid option. We could make this conditional and default to
CSI-2 for Pi 4 and None for Pi 5 if desired.

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
index 5a5acf6a164b..e0f364272746 100644
--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
@@ -410,7 +410,7 @@  PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole
 			size = sensorSize;
 			sensorFormat = data->findBestFormat(size, defaultRawBitDepth);
 			pixelFormat = mbusCodeToPixelFormat(sensorFormat.code,
-							    BayerFormat::Packing::CSI2);
+							    BayerFormat::Packing::None);
 			ASSERT(pixelFormat.isValid());
 			colorSpace = ColorSpace::Raw;
 			bufferCount = 2;