[Piglit] [v7 07/12] tests: spec: EXT_image_dma_buf_import fd ownership transfer

Pohjolainen, Topi topi.pohjolainen at intel.com
Thu May 30 00:12:54 PDT 2013


On Tue, May 28, 2013 at 12:17:37PM -0700, Eric Anholt wrote:
> Topi Pohjolainen <topi.pohjolainen at intel.com> writes:
> 
> > Simple test checking that EGL closes the export file handle and
> > the creator can in turn drop its reference.
> >
> > v2:
> >    - compile only on platforms that have drm (Eric)
> >    - use standard drm definitions for fourcc instead of duplicated
> >      local (Daniel, Eric)
> >    - use helper variables for width, height and cpp instead of
> >      repeating the magic numbers over and over again (Eric)
> >    - try to close the export file descriptor and check that it is
> >      already closed by the EGL stack (Eric, Chad)
> >    - fix typo in the description (and commit) (Chad)
> >    - renamed from "close_buffer" to "ownership_transfer"
> >    - removed irrelevant quote of the spec (Eric)
> >
> > v3:
> >    - use properly linked egl-extension calls (Eric)
> >    - check for EBADF and not just for close()-failure (Daniel)
> 
> I think for this one we want to actually do some rendering with the
> image after having destroyed the drm_intel_bo, to make sure the kernel
> and driver's refcounting is actually working as intended.

The sampling tests in the series in fact do that already. I suppose I could
extend those tests with this checking for the file descriptor closing and
simply drop this test case?

> 
> Also, by my reading, I don't think you get to assert that it's closed
> after the image is freed, only after the display is freed:
> 
>     If eglCreateImageKHR is successful for a EGL_LINUX_DMA_BUF_EXT target, the
>     EGL takes ownership of the file descriptor and is responsible for closing
>     it, which it may do at any time while the EGLDisplay is initialized."

I remember thinking about this but originally thought that the tests cannot
severe the connection themselves. And then I forgot that among other things.

Now after checking the piglit infra I realize that nothing really prevents this.
Tests could call 'eglTerminate()' and check for the file descriptor after. I'll
fix that.

-Topi


More information about the Piglit mailing list