diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-11-18 22:09:11 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-11-18 22:21:18 +0200 |
commit | 622a9a49a8a69f934d18b90cbbe752ebb3e6334c (patch) | |
tree | c55d1c52b7fd6f4012b5f2cf48675251a7f0bb6c | |
parent | c78a869e7c00fa95fc6a9f62bbd822fa579806b2 (diff) |
Card: support opening specific drm device
-rw-r--r-- | libkms++/card.cpp | 11 | ||||
-rw-r--r-- | libkms++/card.h | 1 |
2 files changed, 8 insertions, 4 deletions
diff --git a/libkms++/card.cpp b/libkms++/card.cpp index 48ab560..d5b823f 100644 --- a/libkms++/card.cpp +++ b/libkms++/card.cpp @@ -17,13 +17,16 @@ namespace kms { Card::Card() + : Card("/dev/dri/card0") { - const char *card = "/dev/dri/card0"; +} + - int fd = open(card, O_RDWR | O_CLOEXEC); +Card::Card(const std::string& device) +{ + int fd = open(device.c_str(), O_RDWR | O_CLOEXEC); if (fd < 0) - throw invalid_argument(string(strerror(errno)) + " opening " + - card); + throw invalid_argument(string(strerror(errno)) + " opening " + device); m_fd = fd; int r; diff --git a/libkms++/card.h b/libkms++/card.h index 1bc6af7..6cf0c02 100644 --- a/libkms++/card.h +++ b/libkms++/card.h @@ -14,6 +14,7 @@ class Card friend class Framebuffer; public: Card(); + Card(const std::string& device); ~Card(); Card(const Card& other) = delete; |