summaryrefslogtreecommitdiff
path: root/kms++/src/framebuffer.cpp
diff options
context:
space:
mode:
authorDom Cobley <popcornmix@gmail.com>2022-10-31 18:37:37 +0000
committerDom Cobley <popcornmix@gmail.com>2022-11-01 16:36:59 +0000
commitb141ae7acc753481d050ebb16d20fc44000c55e7 (patch)
tree11fb83368c80c055330131e7f94952abaaff75d2 /kms++/src/framebuffer.cpp
parent0f3534d3be5750ff9cb03cb997a8efc91de07347 (diff)
kmsxx: Also report format of framebuffer
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Diffstat (limited to 'kms++/src/framebuffer.cpp')
-rw-r--r--kms++/src/framebuffer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/kms++/src/framebuffer.cpp b/kms++/src/framebuffer.cpp
index 72e1a73..3a76b73 100644
--- a/kms++/src/framebuffer.cpp
+++ b/kms++/src/framebuffer.cpp
@@ -20,13 +20,14 @@ Framebuffer::Framebuffer(Card& card, uint32_t width, uint32_t height)
Framebuffer::Framebuffer(Card& card, uint32_t id)
: DrmObject(card, id, DRM_MODE_OBJECT_FB)
{
- auto fb = drmModeGetFB(card.fd(), id);
+ auto fb = drmModeGetFB2(card.fd(), id);
if (fb) {
m_width = fb->width;
m_height = fb->height;
+ m_format = (PixelFormat)fb->pixel_format;
- drmModeFreeFB(fb);
+ drmModeFreeFB2(fb);
} else {
m_width = m_height = 0;
}