summaryrefslogtreecommitdiff
path: root/tests/modetest
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-04-18 15:26:59 +0000
committerJerome Glisse <jglisse@redhat.com>2013-04-18 14:53:14 -0400
commit83e77461249d535a77c3ed055d198e26f0c1b390 (patch)
treea79ca50b893c8128631276038bce0b27fe6b8511 /tests/modetest
parent3f024f85d816a648473373bccc8ccc915951886a (diff)
modetest: Add YUV420 support and fix YVU420 Cb/Cr ordering
YUV420 support is trivial to add since the code already supports YVU420. But it looks like the YVU420 support is a bit broken. The chroma planes are passed in the wrong order to the fill functions, so fix that while were at it. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/modetest')
-rw-r--r--tests/modetest/buffers.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/modetest/buffers.c b/tests/modetest/buffers.c
index 2f3adf87..9b2bf726 100644
--- a/tests/modetest/buffers.c
+++ b/tests/modetest/buffers.c
@@ -100,6 +100,7 @@ static const struct format_info format_info[] = {
{ DRM_FORMAT_NV16, "NV16", MAKE_YUV_INFO(YUV_YCbCr, 2, 1, 2) },
{ DRM_FORMAT_NV61, "NV61", MAKE_YUV_INFO(YUV_YCrCb, 2, 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) },
/* RGB16 */
{ DRM_FORMAT_ARGB4444, "AR12", MAKE_RGB_INFO(4, 8, 4, 4, 4, 0, 4, 12) },
@@ -600,10 +601,14 @@ fill_smpte(const struct format_info *info, void *planes[3], unsigned int width,
return fill_smpte_yuv_planar(&info->yuv, planes[0], u, v,
width, height, stride);
- case DRM_FORMAT_YVU420:
+ case DRM_FORMAT_YUV420:
return fill_smpte_yuv_planar(&info->yuv, planes[0], planes[1],
planes[2], width, height, stride);
+ case DRM_FORMAT_YVU420:
+ return fill_smpte_yuv_planar(&info->yuv, planes[0], planes[2],
+ planes[1], width, height, stride);
+
case DRM_FORMAT_ARGB4444:
case DRM_FORMAT_XRGB4444:
case DRM_FORMAT_ABGR4444:
@@ -863,10 +868,14 @@ fill_tiles(const struct format_info *info, void *planes[3], unsigned int width,
return fill_tiles_yuv_planar(info, planes[0], u, v,
width, height, stride);
- case DRM_FORMAT_YVU420:
+ case DRM_FORMAT_YUV420:
return fill_tiles_yuv_planar(info, planes[0], planes[1],
planes[2], width, height, stride);
+ case DRM_FORMAT_YVU420:
+ return fill_tiles_yuv_planar(info, planes[0], planes[2],
+ planes[1], width, height, stride);
+
case DRM_FORMAT_ARGB4444:
case DRM_FORMAT_XRGB4444:
case DRM_FORMAT_ABGR4444:
@@ -1055,6 +1064,7 @@ create_test_buffer(struct kms_driver *kms, unsigned int format,
planes[1] = virtual + offsets[1];
break;
+ case DRM_FORMAT_YUV420:
case DRM_FORMAT_YVU420:
offsets[0] = 0;
kms_bo_get_prop(bo, KMS_HANDLE, &handles[0]);