Add Crtc::page_flip()
authorTomi Valkeinen <tomi.valkeinen@iki.fi>
Tue, 29 Sep 2015 19:40:44 +0000 (22:40 +0300)
committerTomi Valkeinen <tomi.valkeinen@iki.fi>
Thu, 1 Oct 2015 16:40:22 +0000 (19:40 +0300)
libkms++/crtc.cpp
libkms++/crtc.h
tests/db.cpp

index e583be802b933104855f478bf877ccc59f045cd7..b0a962e2d4af542e2ccb2ab1bc2a7d1b6fba64ab 100644 (file)
@@ -71,4 +71,9 @@ int Crtc::set_plane(Plane* plane, Framebuffer& fb,
                               dst_x, dst_y, dst_w, dst_h,
                               conv(src_x), conv(src_y), conv(src_w), conv(src_h));
 }
+
+int Crtc::page_flip(Framebuffer& fb, void *data)
+{
+       return drmModePageFlip(card().fd(), id(), fb.id(), DRM_MODE_PAGE_FLIP_EVENT, data);
+}
 }
index ac05da9a0fc5fdd527bb9597acff737b0abc5674..fabc6e250d3314f3fead222a1f7cf9beb71e658c 100644 (file)
@@ -27,6 +27,8 @@ public:
                      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 page_flip(Framebuffer& fb, void *data);
+
 private:
        CrtcPriv* m_priv;
 
index 5df104d87a93c5a2e2b0890dc06831350b6dcc0b..bfefcb8468797fcc5416a606ad3a73685149822e 100644 (file)
@@ -79,7 +79,7 @@ public:
                        r = ctx.commit(this);
                        ASSERT(r == 0);
                } else {
-                       int r = drmModePageFlip(card.fd(), m_crtc->id(), fb->id(), DRM_MODE_PAGE_FLIP_EVENT, this);
+                       int r = crtc->page_flip(*fb, this);
                        ASSERT(r == 0);
                }
        }