[Linaro-mm-sig] [PATCH] dma-buf: pass flags into dma_buf_fd.

2012-03-18 Thread Sumit Semwal
On 16 March 2012 20:21, Rob Clark  wrote:
> On Fri, Mar 16, 2012 at 5:34 AM, Dave Airlie  wrote:
>> From: Dave Airlie 
>>
>> 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.
>>
>> Signed-off-by: Dave Airlie 
>
> Signed-off-by: Rob Clark 
Thanks; applied to for-next tree.
>

BR,
~me.


Re: [Linaro-mm-sig] [PATCH] dma-buf: pass flags into dma_buf_fd.

2012-03-18 Thread Sumit Semwal
On 16 March 2012 20:21, Rob Clark rob.cl...@linaro.org wrote:
 On Fri, Mar 16, 2012 at 5:34 AM, Dave Airlie airl...@gmail.com wrote:
 From: Dave Airlie airl...@redhat.com

 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.

 Signed-off-by: Dave Airlie airl...@redhat.com

 Signed-off-by: Rob Clark r...@ti.com
Thanks; applied to for-next tree.

snip
BR,
~me.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] dma-buf: pass flags into dma_buf_fd.

2012-03-16 Thread Dave Airlie
From: Dave Airlie 

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.

Signed-off-by: Dave Airlie 
---
 drivers/base/dma-buf.c  |5 +++--
 include/linux/dma-buf.h |2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index c9a945f..3c8c023 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -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;
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index a885b26..891457a 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -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



[PATCH] dma-buf: pass flags into dma_buf_fd.

2012-03-16 Thread Rob Clark
On Fri, Mar 16, 2012 at 5:34 AM, Dave Airlie  wrote:
> From: Dave Airlie 
>
> 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.
>
> Signed-off-by: Dave Airlie 

Signed-off-by: Rob Clark 

> ---
> ?drivers/base/dma-buf.c ?| ? ?5 +++--
> ?include/linux/dma-buf.h | ? ?2 +-
> ?2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
> index c9a945f..3c8c023 100644
> --- a/drivers/base/dma-buf.c
> +++ b/drivers/base/dma-buf.c
> @@ -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;
> diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
> index a885b26..891457a 100644
> --- a/include/linux/dma-buf.h
> +++ b/include/linux/dma-buf.h
> @@ -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
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] dma-buf: pass flags into dma_buf_fd.

2012-03-16 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

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.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 drivers/base/dma-buf.c  |5 +++--
 include/linux/dma-buf.h |2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index c9a945f..3c8c023 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -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;
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index a885b26..891457a 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -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
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] dma-buf: pass flags into dma_buf_fd.

2012-03-16 Thread Rob Clark
On Fri, Mar 16, 2012 at 5:34 AM, Dave Airlie airl...@gmail.com wrote:
 From: Dave Airlie airl...@redhat.com

 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.

 Signed-off-by: Dave Airlie airl...@redhat.com

Signed-off-by: Rob Clark r...@ti.com

 ---
  drivers/base/dma-buf.c  |    5 +++--
  include/linux/dma-buf.h |    2 +-
  2 files changed, 4 insertions(+), 3 deletions(-)

 diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
 index c9a945f..3c8c023 100644
 --- a/drivers/base/dma-buf.c
 +++ b/drivers/base/dma-buf.c
 @@ -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;
 diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
 index a885b26..891457a 100644
 --- a/include/linux/dma-buf.h
 +++ b/include/linux/dma-buf.h
 @@ -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
 dri-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel