lkml.org 
[lkml]   [2014]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3.18-rc3] drm: msm: Allow exported dma-bufs to be mapped
From
On Mon, Nov 10, 2014 at 12:16 PM, Daniel Thompson
<daniel.thompson@linaro.org> wrote:
> diff --git a/drivers/gpu/drm/msm/msm_gem_prime.c b/drivers/gpu/drm/msm/msm_gem_prime.c
> index ad772fe36115..4e4fa5828d5d 100644
> --- a/drivers/gpu/drm/msm/msm_gem_prime.c
> +++ b/drivers/gpu/drm/msm/msm_gem_prime.c
> @@ -20,6 +20,14 @@
>
> #include <linux/dma-buf.h>
>
> +struct dma_buf *msm_gem_prime_export(struct drm_device *dev,
> + struct drm_gem_object *obj, int flags)
> +{
> + /* we want to be able to write in mmapped buffer */
> + flags |= O_RDWR;
> + return drm_gem_prime_export(dev, obj, flags);
> +}
> +

seems like this probably should be done more centrally.. and in fact,
might be better to have something like this in
drm_prime_handle_to_fd_ioctl:

/* check flags are valid */
- if (args->flags & ~DRM_CLOEXEC)
+ if (args->flags & ~(DRM_CLOEXEC | O_RDWR))
return -EINVAL;

so exporter can specify whether to allow mmap or not..

BR,
-R


\
 
 \ /
  Last update: 2014-11-10 19:01    [W:0.088 / U:17.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site