Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
* [PATCH libdrm 0/3] Add support for DRM_FORMAT_NV{24,42}
@ 2023-07-05 15:26 Geert Uytterhoeven
  2023-07-05 15:26 ` [PATCH libdrm 1/3] util: Add NV24 and NV42 frame buffer formats Geert Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2023-07-05 15:26 UTC (permalink / raw)
  To: dri-devel; +Cc: Laurent Pinchart, linux-renesas-soc, Geert Uytterhoeven

	Hi all,

This patch series adds support for semi-planar YUV formats with
non-subsampled chroma planes.

It has been tested with the shmob_drm driver on the R-Mobile A1-based
Atmark Techno Armadillo-800-EVA development board.

Thanks for your comments!

Geert Uytterhoeven (3):
  util: Add NV24 and NV42 frame buffer formats
  util: Add pattern support for DRM_FORMAT_NV{24,42}
  modetest: Add support for DRM_FORMAT_NV{24,42}

 tests/modetest/buffers.c | 20 ++++++++++++++++++++
 tests/util/format.c      |  2 ++
 tests/util/pattern.c     |  4 ++++
 3 files changed, 26 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH libdrm 1/3] util: Add NV24 and NV42 frame buffer formats
  2023-07-05 15:26 [PATCH libdrm 0/3] Add support for DRM_FORMAT_NV{24,42} Geert Uytterhoeven
@ 2023-07-05 15:26 ` Geert Uytterhoeven
  2023-07-07 10:36   ` Laurent Pinchart
  2023-07-05 15:26 ` [PATCH libdrm 2/3] util: Add pattern support for DRM_FORMAT_NV{24,42} Geert Uytterhoeven
  2023-07-05 15:26 ` [PATCH libdrm 3/3] modetest: Add " Geert Uytterhoeven
  2 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2023-07-05 15:26 UTC (permalink / raw)
  To: dri-devel; +Cc: Laurent Pinchart, linux-renesas-soc, Geert Uytterhoeven

Add the missing entries for semi-planar YUV formats with
non-subsampled chroma planes.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 tests/util/format.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/util/format.c b/tests/util/format.c
index 1ca1b82ce947b2f4..f825027227ddba24 100644
--- a/tests/util/format.c
+++ b/tests/util/format.c
@@ -51,6 +51,8 @@ static const struct util_format_info format_info[] = {
 	{ DRM_FORMAT_NV21, "NV21", MAKE_YUV_INFO(YUV_YCrCb, 2, 2, 2) },
 	{ DRM_FORMAT_NV16, "NV16", MAKE_YUV_INFO(YUV_YCbCr, 2, 1, 2) },
 	{ DRM_FORMAT_NV61, "NV61", MAKE_YUV_INFO(YUV_YCrCb, 2, 1, 2) },
+	{ DRM_FORMAT_NV24, "NV24", MAKE_YUV_INFO(YUV_YCbCr, 1, 1, 2) },
+	{ DRM_FORMAT_NV42, "NV42", MAKE_YUV_INFO(YUV_YCrCb, 1, 1, 2) },
 	/* YUV planar */
 	{ DRM_FORMAT_YUV420, "YU12", MAKE_YUV_INFO(YUV_YCbCr, 2, 2, 1) },
 	{ DRM_FORMAT_YVU420, "YV12", MAKE_YUV_INFO(YUV_YCrCb, 2, 2, 1) },
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH libdrm 2/3] util: Add pattern support for DRM_FORMAT_NV{24,42}
  2023-07-05 15:26 [PATCH libdrm 0/3] Add support for DRM_FORMAT_NV{24,42} Geert Uytterhoeven
  2023-07-05 15:26 ` [PATCH libdrm 1/3] util: Add NV24 and NV42 frame buffer formats Geert Uytterhoeven
@ 2023-07-05 15:26 ` Geert Uytterhoeven
  2023-07-07 10:36   ` Laurent Pinchart
  2023-07-05 15:26 ` [PATCH libdrm 3/3] modetest: Add " Geert Uytterhoeven
  2 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2023-07-05 15:26 UTC (permalink / raw)
  To: dri-devel; +Cc: Laurent Pinchart, linux-renesas-soc, Geert Uytterhoeven

Add support for drawing the SMPTE and tiles patterns in buffers using
semi-planar YUV formats with non-subsampled chroma planes.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 tests/util/pattern.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/util/pattern.c b/tests/util/pattern.c
index 158c0b160a2ee870..f45a26ccec38f202 100644
--- a/tests/util/pattern.c
+++ b/tests/util/pattern.c
@@ -698,6 +698,8 @@ static void fill_smpte(const struct util_format_info *info, void *planes[3],
 	case DRM_FORMAT_NV21:
 	case DRM_FORMAT_NV16:
 	case DRM_FORMAT_NV61:
+	case DRM_FORMAT_NV24:
+	case DRM_FORMAT_NV42:
 		u = info->yuv.order & YUV_YCbCr ? planes[1] : planes[1] + 1;
 		v = info->yuv.order & YUV_YCrCb ? planes[1] : planes[1] + 1;
 		return fill_smpte_yuv_planar(&info->yuv, planes[0], u, v,
@@ -1023,6 +1025,8 @@ static void fill_tiles(const struct util_format_info *info, void *planes[3],
 	case DRM_FORMAT_NV21:
 	case DRM_FORMAT_NV16:
 	case DRM_FORMAT_NV61:
+	case DRM_FORMAT_NV24:
+	case DRM_FORMAT_NV42:
 		u = info->yuv.order & YUV_YCbCr ? planes[1] : planes[1] + 1;
 		v = info->yuv.order & YUV_YCrCb ? planes[1] : planes[1] + 1;
 		return fill_tiles_yuv_planar(info, planes[0], u, v,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH libdrm 3/3] modetest: Add support for DRM_FORMAT_NV{24,42}
  2023-07-05 15:26 [PATCH libdrm 0/3] Add support for DRM_FORMAT_NV{24,42} Geert Uytterhoeven
  2023-07-05 15:26 ` [PATCH libdrm 1/3] util: Add NV24 and NV42 frame buffer formats Geert Uytterhoeven
  2023-07-05 15:26 ` [PATCH libdrm 2/3] util: Add pattern support for DRM_FORMAT_NV{24,42} Geert Uytterhoeven
@ 2023-07-05 15:26 ` Geert Uytterhoeven
  2023-07-07 10:38   ` Laurent Pinchart
  2 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2023-07-05 15:26 UTC (permalink / raw)
  To: dri-devel; +Cc: Laurent Pinchart, linux-renesas-soc, Geert Uytterhoeven

Add support for creating buffers using semi-planar YUV formats with
non-subsampled chroma planes.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 tests/modetest/buffers.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tests/modetest/buffers.c b/tests/modetest/buffers.c
index 0b55aeddfef9a854..0605b12552bb8eec 100644
--- a/tests/modetest/buffers.c
+++ b/tests/modetest/buffers.c
@@ -129,6 +129,8 @@ bo_create(int fd, unsigned int format,
 	case DRM_FORMAT_NV21:
 	case DRM_FORMAT_NV16:
 	case DRM_FORMAT_NV61:
+	case DRM_FORMAT_NV24:
+	case DRM_FORMAT_NV42:
 	case DRM_FORMAT_YUV420:
 	case DRM_FORMAT_YVU420:
 		bpp = 8;
@@ -208,6 +210,11 @@ bo_create(int fd, unsigned int format,
 		virtual_height = height * 2;
 		break;
 
+	case DRM_FORMAT_NV24:
+	case DRM_FORMAT_NV42:
+		virtual_height = height * 3;
+		break;
+
 	default:
 		virtual_height = height;
 		break;
@@ -255,6 +262,19 @@ bo_create(int fd, unsigned int format,
 		planes[1] = virtual + offsets[1];
 		break;
 
+	case DRM_FORMAT_NV24:
+	case DRM_FORMAT_NV42:
+		offsets[0] = 0;
+		handles[0] = bo->handle;
+		pitches[0] = bo->pitch;
+		pitches[1] = pitches[0] * 2;
+		offsets[1] = pitches[0] * height;
+		handles[1] = bo->handle;
+
+		planes[0] = virtual;
+		planes[1] = virtual + offsets[1];
+		break;
+
 	case DRM_FORMAT_YUV420:
 	case DRM_FORMAT_YVU420:
 		offsets[0] = 0;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH libdrm 1/3] util: Add NV24 and NV42 frame buffer formats
  2023-07-05 15:26 ` [PATCH libdrm 1/3] util: Add NV24 and NV42 frame buffer formats Geert Uytterhoeven
@ 2023-07-07 10:36   ` Laurent Pinchart
  0 siblings, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2023-07-07 10:36 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: dri-devel, linux-renesas-soc

Hi Geert,

Thank you for the patch.

On Wed, Jul 05, 2023 at 05:26:15PM +0200, Geert Uytterhoeven wrote:
> Add the missing entries for semi-planar YUV formats with
> non-subsampled chroma planes.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

> ---
>  tests/util/format.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tests/util/format.c b/tests/util/format.c
> index 1ca1b82ce947b2f4..f825027227ddba24 100644
> --- a/tests/util/format.c
> +++ b/tests/util/format.c
> @@ -51,6 +51,8 @@ static const struct util_format_info format_info[] = {
>  	{ DRM_FORMAT_NV21, "NV21", MAKE_YUV_INFO(YUV_YCrCb, 2, 2, 2) },
>  	{ DRM_FORMAT_NV16, "NV16", MAKE_YUV_INFO(YUV_YCbCr, 2, 1, 2) },
>  	{ DRM_FORMAT_NV61, "NV61", MAKE_YUV_INFO(YUV_YCrCb, 2, 1, 2) },
> +	{ DRM_FORMAT_NV24, "NV24", MAKE_YUV_INFO(YUV_YCbCr, 1, 1, 2) },
> +	{ DRM_FORMAT_NV42, "NV42", MAKE_YUV_INFO(YUV_YCrCb, 1, 1, 2) },
>  	/* YUV planar */
>  	{ DRM_FORMAT_YUV420, "YU12", MAKE_YUV_INFO(YUV_YCbCr, 2, 2, 1) },
>  	{ DRM_FORMAT_YVU420, "YV12", MAKE_YUV_INFO(YUV_YCrCb, 2, 2, 1) },

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH libdrm 2/3] util: Add pattern support for DRM_FORMAT_NV{24,42}
  2023-07-05 15:26 ` [PATCH libdrm 2/3] util: Add pattern support for DRM_FORMAT_NV{24,42} Geert Uytterhoeven
@ 2023-07-07 10:36   ` Laurent Pinchart
  0 siblings, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2023-07-07 10:36 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: dri-devel, linux-renesas-soc

Hi Geert,

Thank you for the patch.

On Wed, Jul 05, 2023 at 05:26:16PM +0200, Geert Uytterhoeven wrote:
> Add support for drawing the SMPTE and tiles patterns in buffers using
> semi-planar YUV formats with non-subsampled chroma planes.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

> ---
>  tests/util/pattern.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tests/util/pattern.c b/tests/util/pattern.c
> index 158c0b160a2ee870..f45a26ccec38f202 100644
> --- a/tests/util/pattern.c
> +++ b/tests/util/pattern.c
> @@ -698,6 +698,8 @@ static void fill_smpte(const struct util_format_info *info, void *planes[3],
>  	case DRM_FORMAT_NV21:
>  	case DRM_FORMAT_NV16:
>  	case DRM_FORMAT_NV61:
> +	case DRM_FORMAT_NV24:
> +	case DRM_FORMAT_NV42:
>  		u = info->yuv.order & YUV_YCbCr ? planes[1] : planes[1] + 1;
>  		v = info->yuv.order & YUV_YCrCb ? planes[1] : planes[1] + 1;
>  		return fill_smpte_yuv_planar(&info->yuv, planes[0], u, v,
> @@ -1023,6 +1025,8 @@ static void fill_tiles(const struct util_format_info *info, void *planes[3],
>  	case DRM_FORMAT_NV21:
>  	case DRM_FORMAT_NV16:
>  	case DRM_FORMAT_NV61:
> +	case DRM_FORMAT_NV24:
> +	case DRM_FORMAT_NV42:
>  		u = info->yuv.order & YUV_YCbCr ? planes[1] : planes[1] + 1;
>  		v = info->yuv.order & YUV_YCrCb ? planes[1] : planes[1] + 1;
>  		return fill_tiles_yuv_planar(info, planes[0], u, v,

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH libdrm 3/3] modetest: Add support for DRM_FORMAT_NV{24,42}
  2023-07-05 15:26 ` [PATCH libdrm 3/3] modetest: Add " Geert Uytterhoeven
@ 2023-07-07 10:38   ` Laurent Pinchart
  0 siblings, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2023-07-07 10:38 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: dri-devel, linux-renesas-soc

Hi Geert,

Thank you for the patch.

On Wed, Jul 05, 2023 at 05:26:17PM +0200, Geert Uytterhoeven wrote:
> Add support for creating buffers using semi-planar YUV formats with
> non-subsampled chroma planes.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

> ---
>  tests/modetest/buffers.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/tests/modetest/buffers.c b/tests/modetest/buffers.c
> index 0b55aeddfef9a854..0605b12552bb8eec 100644
> --- a/tests/modetest/buffers.c
> +++ b/tests/modetest/buffers.c
> @@ -129,6 +129,8 @@ bo_create(int fd, unsigned int format,
>  	case DRM_FORMAT_NV21:
>  	case DRM_FORMAT_NV16:
>  	case DRM_FORMAT_NV61:
> +	case DRM_FORMAT_NV24:
> +	case DRM_FORMAT_NV42:
>  	case DRM_FORMAT_YUV420:
>  	case DRM_FORMAT_YVU420:
>  		bpp = 8;
> @@ -208,6 +210,11 @@ bo_create(int fd, unsigned int format,
>  		virtual_height = height * 2;
>  		break;
>  
> +	case DRM_FORMAT_NV24:
> +	case DRM_FORMAT_NV42:
> +		virtual_height = height * 3;
> +		break;
> +
>  	default:
>  		virtual_height = height;
>  		break;
> @@ -255,6 +262,19 @@ bo_create(int fd, unsigned int format,
>  		planes[1] = virtual + offsets[1];
>  		break;
>  
> +	case DRM_FORMAT_NV24:
> +	case DRM_FORMAT_NV42:
> +		offsets[0] = 0;
> +		handles[0] = bo->handle;
> +		pitches[0] = bo->pitch;
> +		pitches[1] = pitches[0] * 2;
> +		offsets[1] = pitches[0] * height;
> +		handles[1] = bo->handle;
> +
> +		planes[0] = virtual;
> +		planes[1] = virtual + offsets[1];
> +		break;
> +
>  	case DRM_FORMAT_YUV420:
>  	case DRM_FORMAT_YVU420:
>  		offsets[0] = 0;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-07 10:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-05 15:26 [PATCH libdrm 0/3] Add support for DRM_FORMAT_NV{24,42} Geert Uytterhoeven
2023-07-05 15:26 ` [PATCH libdrm 1/3] util: Add NV24 and NV42 frame buffer formats Geert Uytterhoeven
2023-07-07 10:36   ` Laurent Pinchart
2023-07-05 15:26 ` [PATCH libdrm 2/3] util: Add pattern support for DRM_FORMAT_NV{24,42} Geert Uytterhoeven
2023-07-07 10:36   ` Laurent Pinchart
2023-07-05 15:26 ` [PATCH libdrm 3/3] modetest: Add " Geert Uytterhoeven
2023-07-07 10:38   ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox