diff mbox series

[RFC,5/5] libdrm: omap: Add DRM_RDWR flag to dmabuf export

Message ID 1555734295-31015-6-git-send-email-john.stultz@linaro.org
State Superseded
Headers show
Series libdrm: Patches from AOSP | expand

Commit Message

John Stultz April 20, 2019, 4:24 a.m. UTC
From: Hemant Hariyani <hemanthariyani@ti.com>


Allows mmap on dmabuf fd with MAP_SHARED and PROT_WRITE.

This fixes boot failures caused due to mmap() returning error

Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.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>

Signed-off-by: John Stultz <john.stultz@linaro.org>

---
 omap/omap_drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.4

Comments

Emil Velikov April 23, 2019, 10:26 a.m. UTC | #1
On Sat, 20 Apr 2019 at 05:25, John Stultz <john.stultz@linaro.org> wrote:
>
> From: Hemant Hariyani <hemanthariyani@ti.com>
>
> Allows mmap on dmabuf fd with MAP_SHARED and PROT_WRITE.
>
> This fixes boot failures caused due to mmap() returning error
>
Commit message is quite meh - xf86-video-omap does not use the API, so
things should work (tm) ;-)
Joking aside - Android and closed source user-space drivers are used,
so please mention that.

Although I'd stick with Rob's input - he is the principal author of this code.

-Emil
Christian König April 23, 2019, 12:56 p.m. UTC | #2
Am 23.04.19 um 12:26 schrieb Emil Velikov:
> On Sat, 20 Apr 2019 at 05:25, John Stultz <john.stultz@linaro.org> wrote:
>> From: Hemant Hariyani <hemanthariyani@ti.com>
>>
>> Allows mmap on dmabuf fd with MAP_SHARED and PROT_WRITE.
>>
>> This fixes boot failures caused due to mmap() returning error
>>
> Commit message is quite meh - xf86-video-omap does not use the API, so
> things should work (tm) ;-)
> Joking aside - Android and closed source user-space drivers are used,
> so please mention that.
>
> Although I'd stick with Rob's input - he is the principal author of this code.

IIRC we had the same problem in amdgpu some time ago, so in general the 
patch looks correct to me.

Christian.

>
> -Emil
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/omap/omap_drm.c b/omap/omap_drm.c
index 3aed4e0..ffacea6 100644
--- a/omap/omap_drm.c
+++ b/omap/omap_drm.c
@@ -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;