Card: add disable_all()
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 20 Oct 2017 08:32:40 +0000 (11:32 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 20 Oct 2017 08:32:40 +0000 (11:32 +0300)
kms++/inc/kms++/card.h
kms++/src/card.cpp

index 90ad1f6c697897f7b8b541d2d7b7218b924af4c9..c86278d6f1de773b066ece906d30be7b13d048ce 100644 (file)
@@ -49,6 +49,8 @@ public:
 
        void call_page_flip_handlers();
 
+       int disable_all();
+
 private:
        void restore_modes();
 
index d8d89b2b66c729e8a6cc7ebb781bd585b532846f..f7f1a5aa3598c246807afaa6e6e90bafb1212a47 100644 (file)
@@ -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);
+}
+
 }