From 6126525e3921d2ccc54ca393e6a24d4bd0f08429 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 11 Jan 2019 11:51:11 +0200 Subject: card: don't throw if no dumb buffers Allow opening DRM cards without dumb buffers. Signed-off-by: Tomi Valkeinen --- kms++/inc/kms++/card.h | 2 ++ kms++/src/card.cpp | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kms++/inc/kms++/card.h b/kms++/inc/kms++/card.h index b96e1c1..72111f1 100644 --- a/kms++/inc/kms++/card.h +++ b/kms++/inc/kms++/card.h @@ -37,6 +37,7 @@ public: bool is_master() const { return m_is_master; } bool has_atomic() const { return m_has_atomic; } bool has_has_universal_planes() const { return m_has_universal_planes; } + bool has_dumb_buffers() const { return m_has_dumb; } const std::vector get_connectors() const { return m_connectors; } const std::vector get_encoders() const { return m_encoders; } @@ -72,6 +73,7 @@ private: bool m_has_atomic; bool m_has_universal_planes; + bool m_has_dumb; int m_version_major; int m_version_minor; diff --git a/kms++/src/card.cpp b/kms++/src/card.cpp index 3b3e2c1..4632f22 100644 --- a/kms++/src/card.cpp +++ b/kms++/src/card.cpp @@ -143,8 +143,7 @@ void Card::setup() uint64_t has_dumb; r = drmGetCap(m_fd, DRM_CAP_DUMB_BUFFER, &has_dumb); - if (r || !has_dumb) - throw invalid_argument("Dumb buffers not available"); + m_has_dumb = r == 0 && has_dumb; auto res = drmModeGetResources(m_fd); if (res) { -- cgit v1.2.3