aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen2017-10-02 04:03:07 -0500
committerTomi Valkeinen2017-10-03 04:29:12 -0500
commitb67254a94c0333c6c4409743a54d0544a5763f95 (patch)
tree5da690caa46549f789c53d596d199ce4ecdf5858
parent95de32aa7fbb1a2da547418b296f649ee4be1feb (diff)
downloadexternal-kmsxx-b67254a94c0333c6c4409743a54d0544a5763f95.tar.gz
external-kmsxx-b67254a94c0333c6c4409743a54d0544a5763f95.tar.xz
external-kmsxx-b67254a94c0333c6c4409743a54d0544a5763f95.zip
add ExtFramebuffer::prime_fd
-rw-r--r--kms++/inc/kms++/extframebuffer.h1
-rw-r--r--kms++/src/extframebuffer.cpp10
2 files changed, 11 insertions, 0 deletions
diff --git a/kms++/inc/kms++/extframebuffer.h b/kms++/inc/kms++/extframebuffer.h
index cee82d3..1ec614f 100644
--- a/kms++/inc/kms++/extframebuffer.h
+++ b/kms++/inc/kms++/extframebuffer.h
@@ -26,6 +26,7 @@ public:
26 uint32_t size(unsigned plane) const { return m_planes[plane].size; } 26 uint32_t size(unsigned plane) const { return m_planes[plane].size; }
27 uint32_t offset(unsigned plane) const { return m_planes[plane].offset; } 27 uint32_t offset(unsigned plane) const { return m_planes[plane].offset; }
28 uint8_t* map(unsigned plane); 28 uint8_t* map(unsigned plane);
29 int prime_fd(unsigned plane);
29 30
30private: 31private:
31 struct FramebufferPlane { 32 struct FramebufferPlane {
diff --git a/kms++/src/extframebuffer.cpp b/kms++/src/extframebuffer.cpp
index 51f3611..f50c36e 100644
--- a/kms++/src/extframebuffer.cpp
+++ b/kms++/src/extframebuffer.cpp
@@ -102,4 +102,14 @@ uint8_t* ExtFramebuffer::map(unsigned plane)
102 return p.map; 102 return p.map;
103} 103}
104 104
105int ExtFramebuffer::prime_fd(unsigned plane)
106{
107 FramebufferPlane& p = m_planes[plane];
108
109 if (!p.prime_fd)
110 throw invalid_argument("no primefb for non-dmabuf fb");
111
112 return p.prime_fd;
113}
114
105} 115}