[Piglit] [PATCH v2] dmabuf: fix YUV tests for drivers other than intel
Eric Anholt
eric at anholt.net
Fri Sep 9 18:56:02 UTC 2016
Rob Clark <robdclark at gmail.com> writes:
> Ok, so the basic problem with the YUV tests is that they currently
> completely ignore driver/hw pitch requirements, since the code that
> allocates the buffer doesn't know the pixel format, only the 'cpp'.
>
> The yuv test creates a small 4x4 yuv eglimage. If, say, the hardware
> requires the pitch to be aligned to, say, 32pixels, everything is fine
> for the Y plane, but the subsampled U/V or U+V plane has half as many
> pixels. (This did help me catch a bug in driver, not rejecting the
> dmabuf import with invalid pitch, but that doesn't help to get the
> piglit tests running.)
>
> The best approach I could come up with to fix this is to pass the
> fourcc all the way down to the code that creates the dmabuf (and copies
> src data into the dmabuf). Unfortunately this makes the patch a bit
> bigger than I was hoping, and not really sure a good way to split it
> up.
>
> This is tested on i965 (with the intel dma-buf backend) and freedreno
> (with the gbm dma-buf backend). In the gbm case, it requires new
> gbm format values for R8 and GR88, which is on mesa master as of
> this morning. (So I bumped the gbm version dependency to 12.1.)
>
> Signed-off-by: Rob Clark <robdclark at gmail.com>
> 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 3d1dc24..8e87b25 100644
> --- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
> +++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
> @@ -290,7 +407,7 @@ piglit_drm_get_driver(void)
> if (drv.fd == -1) {
> drv.fd = open("/dev/dri/card0", O_RDWR);
> if (drv.fd == -1) {
> - fprintf(stderr, "error: failed to open /dev/dri/renderD128 and "
> + fprintf(stderr, "error: failed to open /dev/dri/renderD128 or "
> "/dev/dri/card0\n");
> goto fail;
>
Unrelated fix, pull it into a little fixup commit beforehand?
With that done, this is:
Reviewed-by: Eric Anholt <eric at anholt.net>
(though I'll admit that my eyes totally glazed over on some of the
nearly-mechanical test changes)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160909/5a18c6bb/attachment.sig>
More information about the Piglit
mailing list