[Piglit] [PATCH] EGL_EXT_image_dma_buf_import: add P12, P16 format support
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Wed Feb 13 12:29:45 UTC 2019
On 13/02/2019 12:20, Tapani Pälli wrote:
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Thanks for adding these.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
> tests/opengl.py | 4 +++
> .../ext_image_dma_buf_import/sample_common.c | 2 ++
> .../ext_image_dma_buf_import/sample_yuv.c | 27 +++++++++++++++++++
> .../piglit-framework-gl/piglit_drm_dma_buf.c | 4 +++
> .../piglit-framework-gl/piglit_drm_dma_buf.h | 8 ++++++
> 5 files changed, 45 insertions(+)
>
> diff --git a/tests/opengl.py b/tests/opengl.py
> index 59e05f127..83f980177 100644
> --- a/tests/opengl.py
> +++ b/tests/opengl.py
> @@ -3037,6 +3037,10 @@ with profile.test_list.group_manager(
> '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-sample_yuv', '-fmt=P012'],
> + 'ext_image_dma_buf_import-sample_p012', run_concurrent=False)
> + g(['ext_image_dma_buf_import-sample_yuv', '-fmt=P016'],
> + 'ext_image_dma_buf_import-sample_p016', 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)
> diff --git a/tests/spec/ext_image_dma_buf_import/sample_common.c b/tests/spec/ext_image_dma_buf_import/sample_common.c
> index 426f4cc52..249840f01 100644
> --- a/tests/spec/ext_image_dma_buf_import/sample_common.c
> +++ b/tests/spec/ext_image_dma_buf_import/sample_common.c
> @@ -154,6 +154,8 @@ egl_image_for_dma_buf_fd(struct piglit_dma_buf *buf, int fd, int fourcc, EGLImag
> switch (fourcc) {
> case DRM_FORMAT_NV12:
> case DRM_FORMAT_P010:
> + case DRM_FORMAT_P012:
> + case DRM_FORMAT_P016:
> attr = attr_nv12;
> break;
> case DRM_FORMAT_YUV420:
> diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
> index 78a0f25f3..b4c0b63d1 100644
> --- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
> +++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
> @@ -56,6 +56,27 @@ piglit_display(void)
> 481, 642, 562, 642,
> };
>
> + static const uint16_t p012[] = {
> + /* Y */
> + 803, 1124, 1445, 1766,
> + 803, 1124, 1445, 1766,
> + 803, 1124, 1445, 1766,
> + 803, 1124, 1445, 1766,
> + /* UV */
> + 1927, 2088, 2248, 2088,
> + 1927, 2569, 2248, 2569,
> + };
> +
> + static const uint16_t p016[] = {
> + 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,
> @@ -141,6 +162,12 @@ piglit_display(void)
> case DRM_FORMAT_P010:
> t = (unsigned char *) p010;
> break;
> + case DRM_FORMAT_P012:
> + t = (unsigned char *) p012;
> + break;
> + case DRM_FORMAT_P016:
> + t = (unsigned char *) p016;
> + break;
> case DRM_FORMAT_NV12:
> t = nv12;
> break;
> diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
> index 7f7420b23..8beafad77 100644
> --- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
> +++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
> @@ -164,6 +164,8 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned fourcc,
> buf_h = h * 3 / 2;
> break;
> case DRM_FORMAT_P010:
> + case DRM_FORMAT_P012:
> + case DRM_FORMAT_P016:
> cpp = 2;
> buf_h = h * 3 / 2;
> break;
> @@ -197,6 +199,8 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned fourcc,
> switch (fourcc) {
> case DRM_FORMAT_NV12:
> case DRM_FORMAT_P010:
> + case DRM_FORMAT_P012:
> + case DRM_FORMAT_P016:
> buf->offset[1] = stride * h;
> buf->stride[1] = stride;
> break;
> diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
> index b57ffa484..9f59bf7da 100644
> --- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
> +++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
> @@ -44,6 +44,14 @@
> #define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
> #endif
>
> +#ifndef DRM_FORMAT_P012
> +#define DRM_FORMAT_P012 fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cb:Cr plane 12 bits per channel */
> +#endif
> +
> +#ifndef DRM_FORMAT_P016
> +#define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cb:Cr plane 16 bits per channel */
> +#endif
> +
> /* added in libdrm 2.4.95 */
> #ifndef DRM_FORMAT_INVALID
> #define DRM_FORMAT_INVALID 0
More information about the Piglit
mailing list