From cc6e6b22af6b962a10eb862986ecbe1f135f2f7d Mon Sep 17 00:00:00 2001 From: Matt Hoosier Date: Fri, 15 Nov 2019 14:35:50 -0600 Subject: Allow making extframebuffer and dmabufframebuffer with modifiers Many GPUs use bandwidth compression or tiling, and this information must be passed along to KMS when constructing the framebuffer object around the GEM handle or prime filedescriptor. Add an vector of modifiers as an optional parameter to both of these classes. Bump the minimum required version of libdrm to 2.4.17 to ensure drmModeAddFB2WithModifiers() is available. Signed-off-by: Matt Hoosier --- kms++/inc/kms++/dmabufframebuffer.h | 3 ++- kms++/inc/kms++/extframebuffer.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'kms++/inc') diff --git a/kms++/inc/kms++/dmabufframebuffer.h b/kms++/inc/kms++/dmabufframebuffer.h index 2a9182d..a17b1f1 100644 --- a/kms++/inc/kms++/dmabufframebuffer.h +++ b/kms++/inc/kms++/dmabufframebuffer.h @@ -11,7 +11,7 @@ class DmabufFramebuffer : public Framebuffer { public: DmabufFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format, - std::vector fds, std::vector pitches, std::vector offsets); + std::vector fds, std::vector pitches, std::vector offsets, std::vector modifiers = {}); ~DmabufFramebuffer() override; uint32_t width() const override { return Framebuffer::width(); } @@ -37,6 +37,7 @@ private: uint32_t size; uint32_t stride; uint32_t offset; + uint64_t modifier; uint8_t *map; }; diff --git a/kms++/inc/kms++/extframebuffer.h b/kms++/inc/kms++/extframebuffer.h index 5239a3d..f906fb2 100644 --- a/kms++/inc/kms++/extframebuffer.h +++ b/kms++/inc/kms++/extframebuffer.h @@ -11,7 +11,7 @@ class ExtFramebuffer : public Framebuffer { public: ExtFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format, - std::vector handles, std::vector pitches, std::vector offsets); + std::vector handles, std::vector pitches, std::vector offsets, std::vector modifiers = {}); ~ExtFramebuffer() override; uint32_t width() const override { return Framebuffer::width(); } @@ -31,6 +31,7 @@ private: uint32_t size; uint32_t stride; uint32_t offset; + uint64_t modifier; uint8_t *map; }; -- cgit v1.2.3