From b67254a94c0333c6c4409743a54d0544a5763f95 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 2 Oct 2017 12:03:07 +0300 Subject: add ExtFramebuffer::prime_fd --- kms++/inc/kms++/extframebuffer.h | 1 + kms++/src/extframebuffer.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) (limited to 'kms++') 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: 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 { 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) 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; +} + } -- cgit v1.2.3