diff options
author | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2014-08-14 10:17:08 +0300 |
---|---|---|
committer | Topi Pohjolainen <topi.pohjolainen@intel.com> | 2014-08-14 19:45:42 +0300 |
commit | f51d966f0610721a0947619950f43ddd4d29d42d (patch) | |
tree | f1c1bc74e94fb6765efb3b539f41645bb6bb01e8 | |
parent | 1d39e66a79a2b2bafa0c565c1bf690c2c7930aa7 (diff) |
ext_image_dma_buf_import: update ownership_transfer test
The EGL_EXT_image_dma_buf_import specification was revised (according to
its revision history) on Dec 5th, 2013, for EGL to not take ownership of the
file descriptors.
Update the ownership_transfer test to have the correct quote from the
latest specification (version 6), and invert the final test on close().
Now the test verifies, that after a successful import into EGL, followed
by guaranteed destruction of the EGLImage and the buffer reference
inside EGL, the dma_buf file descriptor still stays valid in the caller.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
-rw-r--r-- | tests/spec/ext_image_dma_buf_import/ownership_transfer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/spec/ext_image_dma_buf_import/ownership_transfer.c b/tests/spec/ext_image_dma_buf_import/ownership_transfer.c index ff5181084..cfcf56fda 100644 --- a/tests/spec/ext_image_dma_buf_import/ownership_transfer.c +++ b/tests/spec/ext_image_dma_buf_import/ownership_transfer.c @@ -32,8 +32,9 @@ * * "3. Does ownership of the file descriptor pass to the EGL library? * - * ANSWER: If eglCreateImageKHR is successful, EGL assumes ownership of the - * file descriptors and is responsible for closing them." + * ANSWER: No, EGL does not take ownership of the file descriptors. It is the + * responsibility of the application to close the file descriptors on success + * and failure. * * * Here one checks that the creator of the buffer can drop its reference once @@ -99,8 +100,11 @@ test_create_and_destroy(unsigned w, unsigned h, void *buf, int fd, return PIGLIT_FAIL; } - /* EGL stack should have closed the importing file descriptor by now */ - return close(fd) && errno == EBADF ? PIGLIT_PASS : PIGLIT_FAIL; + /* + * Our own file descriptor must still be valid, and therefore + * closing it must succeed. + */ + return close(fd) == 0 ? PIGLIT_PASS : PIGLIT_FAIL; } enum piglit_result |