add ExtFramebuffer::prime_fd
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 2 Oct 2017 09:03:07 +0000 (12:03 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 3 Oct 2017 09:29:12 +0000 (12:29 +0300)
kms++/inc/kms++/extframebuffer.h
kms++/src/extframebuffer.cpp

index cee82d3e6b9068c119c0610fa9ced195162ce59c..1ec614fbd07e1095a447291e832575e0f48af8c8 100644 (file)
@@ -26,6 +26,7 @@ public:
        uint32_t size(unsigned plane) const { return m_planes[plane].size; }
        uint32_t offset(unsigned plane) const { return m_planes[plane].offset; }
        uint8_t* map(unsigned plane);
+       int prime_fd(unsigned plane);
 
 private:
        struct FramebufferPlane {
index 51f361173823a0ef55b32dfe1328be47014731cf..f50c36ec939ea3de427c852584a3528d0e50ab53 100644 (file)
@@ -102,4 +102,14 @@ uint8_t* ExtFramebuffer::map(unsigned plane)
        return p.map;
 }
 
+int ExtFramebuffer::prime_fd(unsigned plane)
+{
+       FramebufferPlane& p = m_planes[plane];
+
+       if (!p.prime_fd)
+               throw invalid_argument("no primefb for non-dmabuf fb");
+
+       return p.prime_fd;
+}
+
 }