libdrm: omap: Add DRM_RDWR flag to dmabuf export
authorHemant Hariyani <hemanthariyani@ti.com>
Wed, 24 Apr 2019 17:08:41 +0000 (10:08 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 25 Apr 2019 09:58:27 +0000 (10:58 +0100)
Allows mmap on dmabuf fd with MAP_SHARED and PROT_WRITE.

This fixes boot failures with Android (likely w/ closed source
user-space drivers) that were caused due to mmap() returning
error.

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
[picked and updated commitmsg from http://git.ti.com/cgit/cgit.cgi/android/external-libdrm.git/]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Signed-off-by: Alistair Strachan <astrachan@google.com>
[jstultz: Tweaked commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org>
omap/omap_drm.c

index 3aed4e0..ffacea6 100644 (file)
@@ -414,7 +414,7 @@ drm_public int omap_bo_dmabuf(struct omap_bo *bo)
        if (bo->fd < 0) {
                struct drm_prime_handle req = {
                                .handle = bo->handle,
-                               .flags = DRM_CLOEXEC,
+                               .flags = DRM_CLOEXEC | DRM_RDWR,
                };
                int ret;