Re: [PATCH 1/3] drm: add mmap function to prime helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/15/2013 02:16 AM, Aaron Plattner wrote:
On 06/12/2013 06:16 AM, Joonyoung Shim wrote:
This adds to call low-level mmap() from prime helpers.

Signed-off-by: Joonyoung Shim <jy0922.shim@xxxxxxxxxxx>
---
  drivers/gpu/drm/drm_prime.c | 5 ++++-
  include/drm/drmP.h          | 2 ++
  2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index d92853e..3a008b2 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -165,7 +165,10 @@ static void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf,
  static int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf,
          struct vm_area_struct *vma)
  {
-    return -EINVAL;
+    struct drm_gem_object *obj = dma_buf->priv;
+    struct drm_device *dev = obj->dev;
+
+    return dev->driver->gem_prime_mmap(obj, vma);

Won't this crash if the driver doesn't fill in the new field and userspace tries to map it?


Right, if gem_prime_mmap field is NULL, should return error.

Thanks for comments.
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux