aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen2017-10-20 03:32:40 -0500
committerTomi Valkeinen2017-10-20 03:32:40 -0500
commit32255b811edae510304389de4e30fe3e4aaa9ab7 (patch)
tree5a4ee2862e2d1bdefc16c151b0b63ea1305e83fd
parent34a3e4916fc076d4a687d96ac4ad4484ad046d6d (diff)
downloadexternal-libkmsxx-32255b811edae510304389de4e30fe3e4aaa9ab7.tar.gz
external-libkmsxx-32255b811edae510304389de4e30fe3e4aaa9ab7.tar.xz
external-libkmsxx-32255b811edae510304389de4e30fe3e4aaa9ab7.zip
Card: add disable_all()
-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:
49 49
50 void call_page_flip_handlers(); 50 void call_page_flip_handlers();
51 51
52 int disable_all();
53
52private: 54private:
53 void restore_modes(); 55 void restore_modes();
54 56
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()
224 drmHandleEvent(fd(), &ev); 224 drmHandleEvent(fd(), &ev);
225} 225}
226 226
227int Card::disable_all()
228{
229 AtomicReq req(*this);
230
231 for (Crtc* c : m_crtcs) {
232 req.add(c, {
233 { "ACTIVE", 0 },
234 });
235 }
236
237 for (Plane* p : m_planes) {
238 req.add(p, {
239 { "FB_ID", 0 },
240 { "CRTC_ID", 0 },
241 });
242 }
243
244 return req.commit_sync(true);
245}
246
227} 247}