summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kms++/inc/kms++/card.h2
-rw-r--r--kms++/src/card.cpp20
2 files changed, 22 insertions, 0 deletions
diff --git a/kms++/inc/kms++/card.h b/kms++/inc/kms++/card.h
index 90ad1f6..c86278d 100644
--- a/kms++/inc/kms++/card.h
+++ b/kms++/inc/kms++/card.h
@@ -49,6 +49,8 @@ public:
void call_page_flip_handlers();
+ int disable_all();
+
private:
void restore_modes();
diff --git a/kms++/src/card.cpp b/kms++/src/card.cpp
index d8d89b2..f7f1a5a 100644
--- a/kms++/src/card.cpp
+++ b/kms++/src/card.cpp
@@ -224,4 +224,24 @@ void Card::call_page_flip_handlers()
drmHandleEvent(fd(), &ev);
}
+int Card::disable_all()
+{
+ AtomicReq req(*this);
+
+ for (Crtc* c : m_crtcs) {
+ req.add(c, {
+ { "ACTIVE", 0 },
+ });
+ }
+
+ for (Plane* p : m_planes) {
+ req.add(p, {
+ { "FB_ID", 0 },
+ { "CRTC_ID", 0 },
+ });
+ }
+
+ return req.commit_sync(true);
+}
+
}