summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kms++/inc/kms++/card.h4
-rw-r--r--kms++/src/card.cpp3
-rw-r--r--utils/kmstest.cpp3
3 files changed, 7 insertions, 3 deletions
diff --git a/kms++/inc/kms++/card.h b/kms++/inc/kms++/card.h
index c86278d..a3479d1 100644
--- a/kms++/inc/kms++/card.h
+++ b/kms++/inc/kms++/card.h
@@ -33,7 +33,7 @@ public:
Plane* get_plane(uint32_t id) const;
Property* get_prop(uint32_t id) const;
- bool master() const { return m_master; }
+ 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; }
@@ -64,7 +64,7 @@ private:
std::vector<Framebuffer*> m_framebuffers;
int m_fd;
- bool m_master;
+ bool m_is_master;
bool m_has_atomic;
bool m_has_universal_planes;
diff --git a/kms++/src/card.cpp b/kms++/src/card.cpp
index f7f1a5a..0e6c0b0 100644
--- a/kms++/src/card.cpp
+++ b/kms++/src/card.cpp
@@ -32,7 +32,7 @@ Card::Card(const std::string& device)
int r;
r = drmSetMaster(fd);
- m_master = r == 0;
+ m_is_master = r == 0;
if (getenv("KMSXX_DISABLE_UNIVERSAL_PLANES") == 0) {
r = drmSetClientCap(m_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
@@ -135,6 +135,7 @@ Card::~Card()
void Card::drop_master()
{
drmDropMaster(fd());
+ m_is_master = false;
}
void Card::restore_modes()
diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp
index 06e00ba..698ad25 100644
--- a/utils/kmstest.cpp
+++ b/utils/kmstest.cpp
@@ -1101,6 +1101,9 @@ int main(int argc, char **argv)
Card card(s_device_path);
+ if (!card.is_master())
+ EXIT("Could not get DRM master permission. Card already in use?");
+
if (!card.has_atomic() && s_flip_sync)
EXIT("Synchronized flipping requires atomic modesetting");