summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2019-01-11 11:51:11 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2019-01-14 09:27:28 +0200
commit6126525e3921d2ccc54ca393e6a24d4bd0f08429 (patch)
tree6984774e95969fb4219a02db68efe9bb8c9773a2
parent588570115ff515fb2152e5ae1cd34fedbf5937c2 (diff)
card: don't throw if no dumb buffers
Allow opening DRM cards without dumb buffers. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--kms++/inc/kms++/card.h2
-rw-r--r--kms++/src/card.cpp3
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<Connector*> get_connectors() const { return m_connectors; }
const std::vector<Encoder*> 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) {