[Piglit] [v6 04/12] tests: spec: EXT_image_dma_buf_import invalid hints

Eric Anholt eric at anholt.net
Tue May 21 14:07:14 PDT 2013


Topi Pohjolainen <topi.pohjolainen at intel.com> writes:
> +static bool
> +test_invalid_hint(unsigned w, unsigned h, int fd, unsigned stride,
> +		unsigned offset, int hint, int val)
> +{
> +	EGLImageKHR img;
> +	EGLint attr[] = {
> +		EGL_WIDTH, w,
> +		EGL_HEIGHT, h,
> +		EGL_LINUX_DRM_FOURCC_EXT, DRM_FORMAT_ARGB8888,
> +		EGL_DMA_BUF_PLANE0_FD_EXT, fd,
> +		EGL_DMA_BUF_PLANE0_OFFSET_EXT, offset,
> +		EGL_DMA_BUF_PLANE0_PITCH_EXT, stride,
> +		hint, val,
> +		EGL_NONE
> +	};
> +
> +	img = eglCreateImageKHR(eglGetCurrentDisplay(), EGL_NO_CONTEXT,
> +			EGL_LINUX_DMA_BUF_EXT, (EGLClientBuffer)NULL, attr);

I noticed this problem while writing my own EGL image tests recently:

You're relying on a bug in Mesa that we're exposing this function to be
linked against.  You need to use eglGetProcAddress() and call through
the returned function pointer.

I've got a patch series (gles2 branch of my tree) that introduces piglit
dispatch for GLES2 so you don't need to do this for
glEGLImageTargetRenderbufferStorageOES and friends, but we don't have an
automated solution for EGL/GLX extensions yet.  I would *love* to see
someone extend piglit dispatch for EGL/GLX, but barring that you have to
get the function pointer.

> +
> +	if (!piglit_check_egl_error(EGL_BAD_ATTRIBUTE)) {
> +		if (img)
> +			eglDestroyImageKHR(eglGetCurrentDisplay(), img);
> +		return false;
> +	}
> +
> +	return true;
> +}
> +
> +/**
> + * One re-uses the buffer for all the tests. Each test is expected to fail
> + * meaning that the ownership is not transferred to the EGL in any point.
> + */

Weird use of "One" here.

Things are looking a lot better, though.  The extension linking problem
is all I'm really worried about.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130521/819312fa/attachment.pgp>


More information about the Piglit mailing list