[libcamera-devel,v2,1/2] pipeline: rkisp1: Add output support for YUV420 and YVU420
diff mbox series

Message ID 20220719074013.846726-1-paul.elder@ideasonboard.com
State New
Headers show
Series
  • [libcamera-devel,v2,1/2] pipeline: rkisp1: Add output support for YUV420 and YVU420
Related show

Commit Message

Paul Elder July 19, 2022, 7:40 a.m. UTC
YUV420 and YVU420 are already supported as output formats by the rkisp1
driver. Add them to the pipeline handler to support them in libcamera as
well.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

---
Changes in v2:
- move to after NV formats
- add to self path too
---
 src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Jacopo Mondi July 19, 2022, 10:01 a.m. UTC | #1
Hi Paul,

On Tue, Jul 19, 2022 at 04:40:12PM +0900, Paul Elder via libcamera-devel wrote:
> YUV420 and YVU420 are already supported as output formats by the rkisp1
> driver. Add them to the pipeline handler to support them in libcamera as
> well.
>
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
  j

>
> ---
> Changes in v2:
> - move to after NV formats
> - add to self path too
> ---
>  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
> index 6f175758..c070929d 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
> @@ -130,6 +130,8 @@ int RkISP1Path::configure(const StreamConfiguration &config,
>  	switch (config.pixelFormat) {
>  	case formats::NV12:
>  	case formats::NV21:
> +	case formats::YUV420:
> +	case formats::YVU420:
>  		ispFormat.mbus_code = MEDIA_BUS_FMT_YUYV8_1_5X8;
>  		break;
>  	default:
> @@ -207,24 +209,28 @@ void RkISP1Path::stop()
>  namespace {
>  constexpr Size RKISP1_RSZ_MP_SRC_MIN{ 32, 16 };
>  constexpr Size RKISP1_RSZ_MP_SRC_MAX{ 4416, 3312 };
> -constexpr std::array<PixelFormat, 6> RKISP1_RSZ_MP_FORMATS{
> +constexpr std::array<PixelFormat, 8> RKISP1_RSZ_MP_FORMATS{
>  	formats::YUYV,
>  	formats::NV16,
>  	formats::NV61,
>  	formats::NV21,
>  	formats::NV12,
> +	formats::YUV420,
> +	formats::YVU420,
>  	formats::R8,
>  	/* \todo Add support for RAW formats. */
>  };
>
>  constexpr Size RKISP1_RSZ_SP_SRC_MIN{ 32, 16 };
>  constexpr Size RKISP1_RSZ_SP_SRC_MAX{ 1920, 1920 };
> -constexpr std::array<PixelFormat, 8> RKISP1_RSZ_SP_FORMATS{
> +constexpr std::array<PixelFormat, 10> RKISP1_RSZ_SP_FORMATS{
>  	formats::YUYV,
>  	formats::NV16,
>  	formats::NV61,
>  	formats::NV21,
>  	formats::NV12,
> +	formats::YUV420,
> +	formats::YVU420,
>  	formats::R8,
>  	formats::RGB565,
>  	formats::XRGB8888,
> --
> 2.30.2
>
Laurent Pinchart July 19, 2022, 10:36 p.m. UTC | #2
Hi Paul,

Thank you for the patch.

On Tue, Jul 19, 2022 at 04:40:12PM +0900, Paul Elder via libcamera-devel wrote:
> YUV420 and YVU420 are already supported as output formats by the rkisp1
> driver. Add them to the pipeline handler to support them in libcamera as
> well.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

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

> ---
> Changes in v2:
> - move to after NV formats
> - add to self path too
> ---
>  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
> index 6f175758..c070929d 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
> @@ -130,6 +130,8 @@ int RkISP1Path::configure(const StreamConfiguration &config,
>  	switch (config.pixelFormat) {
>  	case formats::NV12:
>  	case formats::NV21:
> +	case formats::YUV420:
> +	case formats::YVU420:
>  		ispFormat.mbus_code = MEDIA_BUS_FMT_YUYV8_1_5X8;
>  		break;
>  	default:
> @@ -207,24 +209,28 @@ void RkISP1Path::stop()
>  namespace {
>  constexpr Size RKISP1_RSZ_MP_SRC_MIN{ 32, 16 };
>  constexpr Size RKISP1_RSZ_MP_SRC_MAX{ 4416, 3312 };
> -constexpr std::array<PixelFormat, 6> RKISP1_RSZ_MP_FORMATS{
> +constexpr std::array<PixelFormat, 8> RKISP1_RSZ_MP_FORMATS{
>  	formats::YUYV,
>  	formats::NV16,
>  	formats::NV61,
>  	formats::NV21,
>  	formats::NV12,
> +	formats::YUV420,
> +	formats::YVU420,
>  	formats::R8,
>  	/* \todo Add support for RAW formats. */
>  };
>  
>  constexpr Size RKISP1_RSZ_SP_SRC_MIN{ 32, 16 };
>  constexpr Size RKISP1_RSZ_SP_SRC_MAX{ 1920, 1920 };
> -constexpr std::array<PixelFormat, 8> RKISP1_RSZ_SP_FORMATS{
> +constexpr std::array<PixelFormat, 10> RKISP1_RSZ_SP_FORMATS{
>  	formats::YUYV,
>  	formats::NV16,
>  	formats::NV61,
>  	formats::NV21,
>  	formats::NV12,
> +	formats::YUV420,
> +	formats::YVU420,
>  	formats::R8,
>  	formats::RGB565,
>  	formats::XRGB8888,

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
index 6f175758..c070929d 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
@@ -130,6 +130,8 @@  int RkISP1Path::configure(const StreamConfiguration &config,
 	switch (config.pixelFormat) {
 	case formats::NV12:
 	case formats::NV21:
+	case formats::YUV420:
+	case formats::YVU420:
 		ispFormat.mbus_code = MEDIA_BUS_FMT_YUYV8_1_5X8;
 		break;
 	default:
@@ -207,24 +209,28 @@  void RkISP1Path::stop()
 namespace {
 constexpr Size RKISP1_RSZ_MP_SRC_MIN{ 32, 16 };
 constexpr Size RKISP1_RSZ_MP_SRC_MAX{ 4416, 3312 };
-constexpr std::array<PixelFormat, 6> RKISP1_RSZ_MP_FORMATS{
+constexpr std::array<PixelFormat, 8> RKISP1_RSZ_MP_FORMATS{
 	formats::YUYV,
 	formats::NV16,
 	formats::NV61,
 	formats::NV21,
 	formats::NV12,
+	formats::YUV420,
+	formats::YVU420,
 	formats::R8,
 	/* \todo Add support for RAW formats. */
 };
 
 constexpr Size RKISP1_RSZ_SP_SRC_MIN{ 32, 16 };
 constexpr Size RKISP1_RSZ_SP_SRC_MAX{ 1920, 1920 };
-constexpr std::array<PixelFormat, 8> RKISP1_RSZ_SP_FORMATS{
+constexpr std::array<PixelFormat, 10> RKISP1_RSZ_SP_FORMATS{
 	formats::YUYV,
 	formats::NV16,
 	formats::NV61,
 	formats::NV21,
 	formats::NV12,
+	formats::YUV420,
+	formats::YVU420,
 	formats::R8,
 	formats::RGB565,
 	formats::XRGB8888,