From db0da1f33c7d688e84e9cd7ff0551842bb68ca6f Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 17 Jan 2019 17:24:25 +0200 Subject: card: another try with card constructors Let's try again with the card constructors. Card::open_modesetting_card() is removed. The main constructor is Card(const std::string& dev_path = ""). If dev_path is set, the device node with that path is used. If dev_path is not set, the behavior is similar as previously, except a modeset capable card is used at the third step: - If KMSXX_DEVICE env variable is set, the card device with that path is opened. - If KMSXX_DRIVER env variable is set, the card with the given driver name and index is opened. The format is either "drvname" or "drvname:idx". - If neither env variable is given, the first modeset capable card is opened. Signed-off-by: Tomi Valkeinen --- kms++/inc/kms++/card.h | 5 +---- kms++/inc/kms++/omap/omapcard.h | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'kms++/inc') diff --git a/kms++/inc/kms++/card.h b/kms++/inc/kms++/card.h index a2c27f8..099d5b5 100644 --- a/kms++/inc/kms++/card.h +++ b/kms++/inc/kms++/card.h @@ -14,10 +14,7 @@ class Card { friend class Framebuffer; public: - static std::unique_ptr open_modesetting_card(); - - Card(); - Card(const std::string& dev_path); + Card(const std::string& dev_path = ""); Card(const std::string& driver, uint32_t idx); virtual ~Card(); diff --git a/kms++/inc/kms++/omap/omapcard.h b/kms++/inc/kms++/omap/omapcard.h index 5c2f3a5..2f1f528 100644 --- a/kms++/inc/kms++/omap/omapcard.h +++ b/kms++/inc/kms++/omap/omapcard.h @@ -9,8 +9,7 @@ namespace kms class OmapCard : public Card { public: - OmapCard(); - OmapCard(const std::string& device); + OmapCard(const std::string& device = ""); virtual ~OmapCard(); struct omap_device* dev() const { return m_omap_dev; } -- cgit v1.2.3