[Piglit] [PATCH] EGL_EXT_image_dma_buf_import: add YUYV format support

Lionel Landwerlin lionel.g.landwerlin at intel.com
Wed Feb 27 10:58:26 UTC 2019


On 22/02/2019 12:42, Christian Gmeiner wrote:
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
>   tests/opengl.py                                     |  2 ++
>   tests/spec/ext_image_dma_buf_import/sample_yuv.c    | 13 +++++++++++++
>   tests/util/piglit-framework-gl/piglit_drm_dma_buf.c |  2 ++
>   3 files changed, 17 insertions(+)
>
> diff --git a/tests/opengl.py b/tests/opengl.py
> index d6cfa0986..685ffae62 100644
> --- a/tests/opengl.py
> +++ b/tests/opengl.py
> @@ -3043,6 +3043,8 @@ with profile.test_list.group_manager(
>         '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-sample_yuv', '-fmt=YUYV'],
> +      'ext_image_dma_buf_import-sample_yuyv', 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_yuv.c b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
> index faa4c300c..f33317af0 100644
> --- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
> +++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
> @@ -143,6 +143,16 @@ piglit_display(void)
>   		160, 127,  70, 64,
>   		160, 133,  90, 128,
>   		160, 140, 110, 192,
> +	}, yuyv[] = {
> +		/* YUYV */
> +		0x32, 0x78, 0x46, 0x82,
> +		0x59, 0x8C, 0x6E, 0x82,
> +		0x32, 0x78, 0x46, 0x82,
> +		0x59, 0x8C, 0x6E, 0x82,
> +		0x32, 0x79, 0x46, 0xA1,
> +		0x5A, 0x8C, 0x6E, 0xA0,
> +		0x32, 0x79, 0x46, 0xA1,
> +		0x5A, 0x8C, 0x6E, 0xA0,


In the interest of consistency, could we keep using base 10 values?


>   	};
>   
>   	static unsigned char expected[4 * 4 * 4] = {
> @@ -193,6 +203,9 @@ piglit_display(void)
>   	case DRM_FORMAT_XYUV8888:
>   		t = ayuv;
>   		break;
> +	case DRM_FORMAT_YUYV:
> +		t = yuyv;
> +		break;
>   	default:
>   		return PIGLIT_SKIP;
>   	}
> 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 07e6cc219..15cba375c 100644
> --- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
> +++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
> @@ -144,6 +144,7 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned fourcc,
>   		break;
>   	case DRM_FORMAT_GR88:
>   	case DRM_FORMAT_RG88:
> +	case DRM_FORMAT_YUYV:
>   		cpp = 2;
>   		break;
>   	case DRM_FORMAT_XRGB8888:
> @@ -279,6 +280,7 @@ piglit_gbm_buf_create(unsigned w, unsigned h, unsigned fourcc,
>   		break;
>   	case DRM_FORMAT_GR88:
>   	case DRM_FORMAT_RG88:
> +	case DRM_FORMAT_YUYV:
>   		format = GBM_FORMAT_GR88;
>   		cpp = 2;
>   		src_stride = cpp * w;

I just realized that although this test passes on our HW, it's probably 
because the image is small enough.

We have a HW limitation that makes it impossible to have 2 different 
views at the same time on a give buffer.


I suppose this only starts showing up at higher resolutions (I recall 
having issues on 32x32 images).


With the value changed, this is : Reviewed-by: Lionel Landwerlin 
<lionel.g.landwerlin at intel.com>


-Lionel



More information about the Piglit mailing list