summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 35d54fd)
raw | patch | inline | side by side (parent: 35d54fd)
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Tue, 10 Oct 2017 08:06:46 +0000 (11:06 +0300) | ||
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Tue, 10 Oct 2017 11:07:36 +0000 (14:07 +0300) |
kmscube/cube-gbm.cpp | patch | blob | history |
diff --git a/kmscube/cube-gbm.cpp b/kmscube/cube-gbm.cpp
index 07413ab9779f37e4ceffbc9af7568566146caf11..980352cda3db741ed1c9964674a9dcfaa88d9378 100644 (file)
--- a/kmscube/cube-gbm.cpp
+++ b/kmscube/cube-gbm.cpp
ret = m_crtc->set_mode(m_connector, *fb, m_mode);
FAIL_IF(ret, "failed to set mode");
- if (m_crtc->card().has_atomic()) {
- Plane* root_plane = 0;
- for (Plane* p : m_crtc->get_possible_planes()) {
- if (p->crtc_id() == m_crtc->id()) {
- root_plane = p;
- break;
- }
+ Plane* root_plane = 0;
+ for (Plane* p : m_crtc->get_possible_planes()) {
+ if (p->crtc_id() == m_crtc->id()) {
+ root_plane = p;
+ break;
}
+ }
- FAIL_IF(!root_plane, "No primary plane for crtc %d", m_crtc->id());
+ FAIL_IF(!root_plane, "No primary plane for crtc %d", m_crtc->id());
- m_root_plane = root_plane;
- }
+ m_root_plane = root_plane;
if (m_plane) {
ret = m_crtc->set_plane(m_plane, *planefb,
planefb = m_surface2->lock_next();
}
- if (m_crtc->card().has_atomic()) {
- int r;
-
- AtomicReq req(m_crtc->card());
-
- req.add(m_root_plane, "FB_ID", fb->id());
- if (m_plane)
- req.add(m_plane, "FB_ID", planefb->id());
+ int r;
- r = req.test();
- FAIL_IF(r, "atomic test failed");
+ AtomicReq req(m_crtc->card());
- r = req.commit(this);
- FAIL_IF(r, "atomic commit failed");
- } else {
- int ret;
+ req.add(m_root_plane, "FB_ID", fb->id());
+ if (m_plane)
+ req.add(m_plane, "FB_ID", planefb->id());
- ret = m_crtc->page_flip(*fb, this);
- FAIL_IF(ret, "failed to queue page flip");
+ r = req.test();
+ FAIL_IF(r, "atomic test failed");
- if (m_plane) {
- ret = m_crtc->set_plane(m_plane, *planefb,
- 0, 0, planefb->width(), planefb->height(),
- 0, 0, planefb->width(), planefb->height());
- FAIL_IF(ret, "failed to set plane");
- }
- }
+ r = req.commit(this);
+ FAIL_IF(r, "atomic commit failed");
s_flip_pending++;
}
{
Card card;
+ FAIL_IF(!card.has_atomic(), "No atomic modesetting");
+
GbmDevice gdev(card);
EglState egl(gdev.handle());