summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-10-10 11:06:46 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-10-10 14:07:36 +0300
commit876b2c9ee357eb680a2bae3703c1658d9e935536 (patch)
treefc717ae2b34f3cf771f5a832b08f4526f2113e10
parent35d54fdddd6d7add49efbb0d9dec30816de96c90 (diff)
kmscube: drop non-atomic support
-rw-r--r--kmscube/cube-gbm.cpp52
1 files changed, 19 insertions, 33 deletions
diff --git a/kmscube/cube-gbm.cpp b/kmscube/cube-gbm.cpp
index 07413ab..980352c 100644
--- a/kmscube/cube-gbm.cpp
+++ b/kmscube/cube-gbm.cpp
@@ -219,19 +219,17 @@ public:
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,
@@ -287,33 +285,19 @@ private:
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++;
}
@@ -340,6 +324,8 @@ void main_gbm()
{
Card card;
+ FAIL_IF(!card.has_atomic(), "No atomic modesetting");
+
GbmDevice gdev(card);
EglState egl(gdev.handle());