dumbfb: pass O_RDWR to drmPrimeHandleToFD()
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 3 Nov 2016 09:52:44 +0000 (11:52 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 3 Nov 2016 09:52:44 +0000 (11:52 +0200)
This enables write access to the dumb fb with mmap().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
kms++/src/dumbframebuffer.cpp

index d22b9f3b1716024612ac4f3816f87ff8e7be7e80..b21e8ff0072e6fce3fbf0634311d6d40552455d9 100644 (file)
@@ -127,7 +127,7 @@ int DumbFramebuffer::prime_fd(unsigned int plane)
                return m_planes[plane].prime_fd;
 
        int r = drmPrimeHandleToFD(card().fd(), m_planes[plane].handle,
-                                  DRM_CLOEXEC, &m_planes[plane].prime_fd);
+                                  DRM_CLOEXEC | O_RDWR, &m_planes[plane].prime_fd);
        if (r)
                throw std::runtime_error("drmPrimeHandleToFD failed");