dma-buf: pass flags into dma_buf_fd.
Subsystems (2)
PATCH 1/1 dma-buf: pass flags into dma_buf_fd.
From: Dave Airlie <[email protected]>
We need to pass the flags into dma_buf_fd at this point, so the flags end up doing the right thing for O_CLOEXEC.
--- drivers/base/dma-buf.c | 5 +++-- include/linux/dma-buf.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/base/dma-buf.c +3 -2
@@ -107,17 +107,18 @@ EXPORT_SYMBOL_GPL(dma_buf_export);/** * dma_buf_fd - returns a file descriptor for the given dma_buf * @dmabuf: [in] pointer to dma_buf for which fd is required. +* @flags: [in] flags to give to fd * * On success, returns an associated 'fd'. Else, returns error. */ -int dma_buf_fd (struct dma_buf *dmabuf) +int dma_buf_fd (struct dma_buf *dmabuf,int flags) {int error, fd;if (!dmabuf || !dmabuf->file)return -EINVAL ; - error =get_unused_fd (); + error =get_unused_fd_flags (flags);if (error <0 )return error; fd = error;
include/linux/dma-buf.h +1 -1
@@ -117,7 +117,7 @@ void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *dmabuf_attach);struct dma_buf *dma_buf_export (void *priv,const struct dma_buf_ops *ops,size_t size,int flags); -int dma_buf_fd (struct dma_buf *dmabuf); +int dma_buf_fd (struct dma_buf *dmabuf,int flags);struct dma_buf *dma_buf_get (int fd);void dma_buf_put (struct dma_buf *dmabuf);
Signature · 1 line
1.7.6
Quoted 6 lines · Dave Airlie
From: Dave Airlie <[email protected]>
We need to pass the flags into
dma_buf_fdat this point, so the flags end up doing the right thing forO_CLOEXEC.Signed-off-by Dave Airlie <[email protected]>
Quoted 50 lines
---
drivers/base/dma-buf.c | 5 +++--
include/linux/dma-buf.h | 2 +-2 files changed, 4 insertions(+), 3 deletions(-)drivers/base/dma-buf.c +3
-2@@ -107,17 +107,18 @@ EXPORT_SYMBOL_GPL(dma_buf_export); /*** dma_buf_fd - returns a file descriptor for the given dma_buf * @dmabuf: [in] pointer to dma_buf for which fd is required. +* @flags: [in] flags to give to fd * * On success, returns an associated 'fd'. Else, returns error. */ -int dma_buf_fd (struct dma_buf *dmabuf) +int dma_buf_fd (struct dma_buf *dmabuf,int flags) { int error, fd; if (!dmabuf || !dmabuf->file) return -EINVAL; - error = get_unused_fd(); + error = get_unused_fd_flags(flags); if (error < 0) return error; fd = error;include/linux/dma-buf.h +1
-2@@ -117,7 +117,7 @@ void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *dmabuf_attach); struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops, size_t size, int flags); -int dma_buf_fd (struct dma_buf *dmabuf); +int dma_buf_fd (struct dma_buf *dmabuf,int flags); struct dma_buf *dma_buf_get(int fd); void dma_buf_put(struct dma_buf *dmabuf); --1.7.6
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Sumit Semwal
maintainerQuoted 9 lines · Rob Clark
Quoted 6 lines · Dave Airlie
From: Dave Airlie <[email protected]>
We need to pass the flags into
dma_buf_fdat this point, so the flags end up doing the right thing forO_CLOEXEC.Signed-off-by Dave Airlie <[email protected]>Signed-off-by Rob Clark <[email protected]>
Thanks; applied to for-next tree.
Quoted 1 line
<snip>
BR,
~me.