All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/exynos: correct dma_buf exporter permission as ReadWrite
@ 2012-07-10 13:32 Cooper Yuan
  2012-07-20 12:27 ` InKi Dae
  0 siblings, 1 reply; 4+ messages in thread
From: Cooper Yuan @ 2012-07-10 13:32 UTC (permalink / raw)
  To: dri-devel; +Cc: Inki Dae

Set dma_buf exporter permission as ReadWrite, otherwise mmap will get
errno 13: permission denied.

Signed-off-by: Cooper Yuan <cooperyuan@gmail.com>
---
 drivers/gpu/drm/exynos/exynos_drm_dmabuf.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
index 613bf8a..e4eeb0b 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
@@ -29,6 +29,7 @@
 #include "exynos_drm_drv.h"
 #include "exynos_drm_gem.h"

+#include <linux/fcntl.h>
 #include <linux/dma-buf.h>

 static struct sg_table *exynos_pages_to_sg(struct page **pages, int nr_pages,
@@ -179,7 +180,7 @@ struct dma_buf *exynos_dmabuf_prime_export(struct
drm_device *drm_dev,
 	struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj);

 	return dma_buf_export(exynos_gem_obj, &exynos_dmabuf_ops,
-				exynos_gem_obj->base.size, 0600);
+				exynos_gem_obj->base.size, O_RDWR);
 }

 struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev,
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] drm/exynos: correct dma_buf exporter permission as ReadWrite
  2012-07-10 13:32 [PATCH 1/3] drm/exynos: correct dma_buf exporter permission as ReadWrite Cooper Yuan
@ 2012-07-20 12:27 ` InKi Dae
  2012-07-20 12:46   ` InKi Dae
  0 siblings, 1 reply; 4+ messages in thread
From: InKi Dae @ 2012-07-20 12:27 UTC (permalink / raw)
  To: Cooper Yuan; +Cc: Inki Dae, dri-devel

2012/7/10, Cooper Yuan <cooperyuan@gmail.com>:
> Set dma_buf exporter permission as ReadWrite, otherwise mmap will get
> errno 13: permission denied.
>
> Signed-off-by: Cooper Yuan <cooperyuan@gmail.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_dmabuf.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
> b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
> index 613bf8a..e4eeb0b 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
> @@ -29,6 +29,7 @@
>  #include "exynos_drm_drv.h"
>  #include "exynos_drm_gem.h"
>
> +#include <linux/fcntl.h>
>  #include <linux/dma-buf.h>
>
>  static struct sg_table *exynos_pages_to_sg(struct page **pages, int
> nr_pages,
> @@ -179,7 +180,7 @@ struct dma_buf *exynos_dmabuf_prime_export(struct
> drm_device *drm_dev,
>  	struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj);
>
>  	return dma_buf_export(exynos_gem_obj, &exynos_dmabuf_ops,
> -				exynos_gem_obj->base.size, 0600);
> +				exynos_gem_obj->base.size, O_RDWR);

this way is not good. the permission should be set from user so use
flags variable.

>  }
>
>  struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device
> *drm_dev,
> --


> 1.7.0.4
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] drm/exynos: correct dma_buf exporter permission as ReadWrite
  2012-07-20 12:27 ` InKi Dae
@ 2012-07-20 12:46   ` InKi Dae
  2012-07-20 12:53     ` InKi Dae
  0 siblings, 1 reply; 4+ messages in thread
From: InKi Dae @ 2012-07-20 12:46 UTC (permalink / raw)
  To: Cooper Yuan; +Cc: Inki Dae, dri-devel

2012/7/20, InKi Dae <daeinki@gmail.com>:
> 2012/7/10, Cooper Yuan <cooperyuan@gmail.com>:
>> Set dma_buf exporter permission as ReadWrite, otherwise mmap will get
>> errno 13: permission denied.
>>
>> Signed-off-by: Cooper Yuan <cooperyuan@gmail.com>
>> ---
>>  drivers/gpu/drm/exynos/exynos_drm_dmabuf.c |    3 ++-
>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
>> b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
>> index 613bf8a..e4eeb0b 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
>> @@ -29,6 +29,7 @@
>>  #include "exynos_drm_drv.h"
>>  #include "exynos_drm_gem.h"
>>
>> +#include <linux/fcntl.h>
>>  #include <linux/dma-buf.h>
>>
>>  static struct sg_table *exynos_pages_to_sg(struct page **pages, int
>> nr_pages,
>> @@ -179,7 +180,7 @@ struct dma_buf *exynos_dmabuf_prime_export(struct
>> drm_device *drm_dev,
>>  	struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj);
>>
>>  	return dma_buf_export(exynos_gem_obj, &exynos_dmabuf_ops,
>> -				exynos_gem_obj->base.size, 0600);
>> +				exynos_gem_obj->base.size, O_RDWR);
>
> this way is not good. the permission should be set from user so use
> flags variable.
>

hm, it seems like that now drm prime has one issue. the flags has only
O_CLOEXEC by drm_prime_handle_to_fd_ioctl function but I think we need
some flag values from user. so could you please explain why having
only O_CLOEXEC?

Thanks,
Inki Dae

>>  }
>>
>>  struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device
>> *drm_dev,
>> --
>
>
>> 1.7.0.4
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] drm/exynos: correct dma_buf exporter permission as ReadWrite
  2012-07-20 12:46   ` InKi Dae
@ 2012-07-20 12:53     ` InKi Dae
  0 siblings, 0 replies; 4+ messages in thread
From: InKi Dae @ 2012-07-20 12:53 UTC (permalink / raw)
  To: Cooper Yuan; +Cc: Inki Dae, dri-devel

I'm so sorry, there was typo (you -> anyone)

2012/7/20, InKi Dae <daeinki@gmail.com>:
> 2012/7/20, InKi Dae <daeinki@gmail.com>:
>> 2012/7/10, Cooper Yuan <cooperyuan@gmail.com>:
>>> Set dma_buf exporter permission as ReadWrite, otherwise mmap will get
>>> errno 13: permission denied.
>>>
>>> Signed-off-by: Cooper Yuan <cooperyuan@gmail.com>
>>> ---
>>>  drivers/gpu/drm/exynos/exynos_drm_dmabuf.c |    3 ++-
>>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
>>> b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
>>> index 613bf8a..e4eeb0b 100644
>>> --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
>>> @@ -29,6 +29,7 @@
>>>  #include "exynos_drm_drv.h"
>>>  #include "exynos_drm_gem.h"
>>>
>>> +#include <linux/fcntl.h>
>>>  #include <linux/dma-buf.h>
>>>
>>>  static struct sg_table *exynos_pages_to_sg(struct page **pages, int
>>> nr_pages,
>>> @@ -179,7 +180,7 @@ struct dma_buf *exynos_dmabuf_prime_export(struct
>>> drm_device *drm_dev,
>>>  	struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj);
>>>
>>>  	return dma_buf_export(exynos_gem_obj, &exynos_dmabuf_ops,
>>> -				exynos_gem_obj->base.size, 0600);
>>> +				exynos_gem_obj->base.size, O_RDWR);
>>
>> this way is not good. the permission should be set from user so use
>> flags variable.
>>
>
> hm, it seems like that now drm prime has one issue. the flags has only
> O_CLOEXEC by drm_prime_handle_to_fd_ioctl function but I think we need
> some flag values from user. so could anyone please explain why having
> only O_CLOEXEC?
>
> Thanks,
> Inki Dae
>
>>>  }
>>>
>>>  struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device
>>> *drm_dev,
>>> --
>>
>>
>>> 1.7.0.4
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-20 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10 13:32 [PATCH 1/3] drm/exynos: correct dma_buf exporter permission as ReadWrite Cooper Yuan
2012-07-20 12:27 ` InKi Dae
2012-07-20 12:46   ` InKi Dae
2012-07-20 12:53     ` InKi Dae

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.