@@ -3030,6 +3030,8 @@ with profile.test_list.group_manager(
'ext_image_dma_buf_import-sample_yvu420', run_concurrent=False)
g(['ext_image_dma_buf_import-sample_yuv', '-fmt=AYUV'],
'ext_image_dma_buf_import-sample_ayuv', run_concurrent=False)
+ g(['ext_image_dma_buf_import-sample_yuv', '-fmt=P010'],
+ 'ext_image_dma_buf_import-sample_p010', run_concurrent=False)
g(['ext_image_dma_buf_import-transcode-nv12-as-r8-gr88'],
'ext_image_dma_buf_import-transcode-nv12-as-r8-gr88',
run_concurrent=False)
@@ -153,6 +153,7 @@ egl_image_for_dma_buf_fd(struct piglit_dma_buf *buf, int fd, int fourcc, EGLImag
EGLint *attr;
switch (fourcc) {
case DRM_FORMAT_NV12:
+ case DRM_FORMAT_P010:
attr = attr_nv12;
break;
case DRM_FORMAT_YUV420:
@@ -25,6 +25,7 @@
#include "piglit-util-egl.h"
#include "piglit-util-gl.h"
+#include "piglit-framework-gl/piglit_drm_dma_buf.h"
/**
* Create a dma buffer with format 'fourcc' setting the given pixels as its
@@ -45,6 +45,17 @@ static int fourcc = -1;
enum piglit_result
piglit_display(void)
{
+ static const uint16_t p010[] = {
+ /* Y */
+ 12850, 17990, 23130, 28270,
+ 12850, 17990, 23130, 28270,
+ 12850, 17990, 23130, 28270,
+ 12850, 17990, 23130, 28270,
+ /* UV */
+ 30840, 33410, 35980, 33410,
+ 30840, 41120, 35980, 41120,
+ };
+
static const unsigned char nv12[] = {
/* Y */
50, 70, 90, 110,
@@ -127,6 +138,9 @@ piglit_display(void)
enum piglit_result res;
switch (fourcc) {
+ case DRM_FORMAT_P010:
+ t = (unsigned char *) p010;
+ break;
case DRM_FORMAT_NV12:
t = nv12;
break;
@@ -163,6 +163,10 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned fourcc,
cpp = 1;
buf_h = h * 3 / 2;
break;
+ case DRM_FORMAT_P010:
+ cpp = 2;
+ buf_h = h * 3 / 2;
+ break;
default:
fprintf(stderr, "invalid fourcc: %.4s\n", (char *)&fourcc);
return false;
@@ -192,6 +196,7 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned fourcc,
switch (fourcc) {
case DRM_FORMAT_NV12:
+ case DRM_FORMAT_P010:
buf->offset[1] = stride * h;
buf->stride[1] = stride;
break;
@@ -40,6 +40,10 @@
#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8')
#endif
+#ifndef DRM_FORMAT_P010
+#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
+#endif
+
/* added in libdrm 2.4.95 */
#ifndef DRM_FORMAT_INVALID
#define DRM_FORMAT_INVALID 0