[PATCH libdrm 3/3] tests: util: Add support for YUV422 and YUV444

Hyun Kwon hyun.kwon at xilinx.com
Sun Jul 8 02:35:33 UTC 2018


Enable YUV422 and YUV444 formats by adding to the format table
and pattern generation calls.

Signed-off-by: Hyun Kwon <hyun.kwon at xilinx.com>
---
 tests/util/format.c  | 4 ++++
 tests/util/pattern.c | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/tests/util/format.c b/tests/util/format.c
index 15ac5e1..b48594c 100644
--- a/tests/util/format.c
+++ b/tests/util/format.c
@@ -52,6 +52,10 @@ static const struct util_format_info format_info[] = {
 	/* 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) },
+	{ DRM_FORMAT_YUV422, "YU16", MAKE_YUV_INFO(YUV_YCbCr, 2, 1, 1) },
+	{ DRM_FORMAT_YVU422, "YV16", MAKE_YUV_INFO(YUV_YCrCb, 2, 1, 1) },
+	{ DRM_FORMAT_YUV444, "YU24", MAKE_YUV_INFO(YUV_YCbCr, 1, 1, 1) },
+	{ DRM_FORMAT_YVU444, "YV24", MAKE_YUV_INFO(YUV_YCrCb, 1, 1, 1) },
 	/* RGB16 */
 	{ DRM_FORMAT_ARGB4444, "AR12", MAKE_RGB_INFO(4, 8, 4, 4, 4, 0, 4, 12) },
 	{ DRM_FORMAT_XRGB4444, "XR12", MAKE_RGB_INFO(4, 8, 4, 4, 4, 0, 0, 0) },
diff --git a/tests/util/pattern.c b/tests/util/pattern.c
index aa067c9..2805724 100644
--- a/tests/util/pattern.c
+++ b/tests/util/pattern.c
@@ -487,10 +487,14 @@ static void fill_smpte(const struct util_format_info *info, void *planes[3],
 					     width, height, stride);
 
 	case DRM_FORMAT_YUV420:
+	case DRM_FORMAT_YUV422:
+	case DRM_FORMAT_YUV444:
 		return fill_smpte_yuv_planar(&info->yuv, planes[0], planes[1],
 					     planes[2], width, height, stride);
 
 	case DRM_FORMAT_YVU420:
+	case DRM_FORMAT_YVU422:
+	case DRM_FORMAT_YVU444:
 		return fill_smpte_yuv_planar(&info->yuv, planes[0], planes[2],
 					     planes[1], width, height, stride);
 
@@ -772,10 +776,14 @@ static void fill_tiles(const struct util_format_info *info, void *planes[3],
 					     width, height, stride);
 
 	case DRM_FORMAT_YUV420:
+	case DRM_FORMAT_YUV422:
+	case DRM_FORMAT_YUV444:
 		return fill_tiles_yuv_planar(info, planes[0], planes[1],
 					     planes[2], width, height, stride);
 
 	case DRM_FORMAT_YVU420:
+	case DRM_FORMAT_YVU422:
+	case DRM_FORMAT_YVU444:
 		return fill_tiles_yuv_planar(info, planes[0], planes[2],
 					     planes[1], width, height, stride);
 
-- 
2.7.4



More information about the dri-devel mailing list