diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2019-01-17 16:18:15 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2019-01-17 17:14:10 +0200 |
commit | b13bf2e44827f9dea2149f72970239d4a7b0817b (patch) | |
tree | 659a9be559811c5f9f63a194456f417adce7a457 /kms++/src | |
parent | c200b3a24d49dfdc878258d89bc785686487ac89 (diff) |
card: add has_kms()
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'kms++/src')
-rw-r--r-- | kms++/src/card.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kms++/src/card.cpp b/kms++/src/card.cpp index f404d3a..85c693b 100644 --- a/kms++/src/card.cpp +++ b/kms++/src/card.cpp @@ -46,8 +46,7 @@ unique_ptr<Card> Card::open_modesetting_card() for (const string& path : paths) { unique_ptr<Card> card = unique_ptr<Card>(new Card(path)); - if (card->get_connectors().size() > 0 && - card->get_crtcs().size() > 0) + if (card->has_kms()) return card; } @@ -259,6 +258,11 @@ void Card::drop_master() m_is_master = false; } +bool Card::has_kms() const +{ + return m_connectors.size() > 0 && m_encoders.size() > 0 && m_crtcs.size() > 0; +} + void Card::restore_modes() { for (auto conn : get_connectors()) |