summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2015-09-01 15:42:54 -0400
committerRob Clark <robdclark@gmail.com>2015-09-01 15:51:22 -0400
commit3aa8ec295d6e8846977bed3bf268467a28e3afef (patch)
treeea01fb80be44e1fe5ac1e39cf4341d3f43620f31
parentdec3d8c6e2a2ca869a6a8ee025cf02a8f0767a4f (diff)
downloaddrm_gralloc-3aa8ec295d6e8846977bed3bf268467a28e3afef.tar.gz
WIP: dup returned fd
This will be passed in to driver, who expects to take ownership of the fd.. so don't hand out our internal fd without dup()'ing it. TODO: double check this.. EGL_EXT_image_dma_buf_import says driver does not take ownership of the fd, and I think platform_android is using almost the same code-paths.. so possibly the dup() should be in the driver. (but dri3 doesn't appear to explode.. root question is whether screen->resource_from_handle() takes ownership of the fd or not, so not sure if there is already a dup() somewhere in the dma_buf_import path.)
-rw-r--r--gralloc_drm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gralloc_drm.c b/gralloc_drm.c
index 0b2d20d..3f3f529 100644
--- a/gralloc_drm.c
+++ b/gralloc_drm.c
@@ -385,7 +385,7 @@ int gralloc_drm_get_prime_fd(buffer_handle_t _handle)
{
struct gralloc_drm_handle_t *handle = gralloc_drm_handle(_handle);
LOGHDL(handle);
- return (handle) ? handle->prime_fd : -1;
+ return (handle) ? dup(handle->prime_fd) : -1;
}
int gralloc_drm_get_gem_handle(buffer_handle_t _handle)