crtc: add disable_mode()
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 19 Dec 2016 15:18:48 +0000 (17:18 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 20 Dec 2016 07:18:28 +0000 (09:18 +0200)
Add crtc::disable_mode() for disabling the crtc.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
kms++/inc/kms++/crtc.h
kms++/src/crtc.cpp

index f3b525acd7e70857e8fa3cd5dc2a87efc907c5bb..14860babdb59f2c410cc45cf6c369905357143c8 100644 (file)
@@ -21,6 +21,7 @@ public:
        int set_plane(Plane *plane, Framebuffer &fb,
                      int32_t dst_x, int32_t dst_y, uint32_t dst_w, uint32_t dst_h,
                      float src_x, float src_y, float src_w, float src_h);
+       int disable_mode();
 
        int disable_plane(Plane* plane);
 
index bad7d315aa854ce199e9eadb0825823b45fc78ac..4c2f5ce7a2623a8595238f6ccad1fe01f16570dd 100644 (file)
@@ -60,6 +60,11 @@ int Crtc::set_mode(Connector* conn, Framebuffer& fb, const Videomode& mode)
                              conns, 1, &drmmode);
 }
 
+int Crtc::disable_mode()
+{
+       return drmModeSetCrtc(card().fd(), id(), 0, 0, 0, 0, 0, 0);
+}
+
 static inline uint32_t conv(float x)
 {
        // XXX fix the conversion for fractional part