aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen2017-10-10 03:06:46 -0500
committerTomi Valkeinen2017-10-10 06:07:36 -0500
commit876b2c9ee357eb680a2bae3703c1658d9e935536 (patch)
treefc717ae2b34f3cf771f5a832b08f4526f2113e10
parent35d54fdddd6d7add49efbb0d9dec30816de96c90 (diff)
downloadexternal-libkmsxx-876b2c9ee357eb680a2bae3703c1658d9e935536.tar.gz
external-libkmsxx-876b2c9ee357eb680a2bae3703c1658d9e935536.tar.xz
external-libkmsxx-876b2c9ee357eb680a2bae3703c1658d9e935536.zip
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:
219 ret = m_crtc->set_mode(m_connector, *fb, m_mode); 219 ret = m_crtc->set_mode(m_connector, *fb, m_mode);
220 FAIL_IF(ret, "failed to set mode"); 220 FAIL_IF(ret, "failed to set mode");
221 221
222 if (m_crtc->card().has_atomic()) { 222 Plane* root_plane = 0;
223 Plane* root_plane = 0; 223 for (Plane* p : m_crtc->get_possible_planes()) {
224 for (Plane* p : m_crtc->get_possible_planes()) { 224 if (p->crtc_id() == m_crtc->id()) {
225 if (p->crtc_id() == m_crtc->id()) { 225 root_plane = p;
226 root_plane = p; 226 break;
227 break;
228 }
229 } 227 }
228 }
230 229
231 FAIL_IF(!root_plane, "No primary plane for crtc %d", m_crtc->id()); 230 FAIL_IF(!root_plane, "No primary plane for crtc %d", m_crtc->id());
232 231
233 m_root_plane = root_plane; 232 m_root_plane = root_plane;
234 }
235 233
236 if (m_plane) { 234 if (m_plane) {
237 ret = m_crtc->set_plane(m_plane, *planefb, 235 ret = m_crtc->set_plane(m_plane, *planefb,
@@ -287,33 +285,19 @@ private:
287 planefb = m_surface2->lock_next(); 285 planefb = m_surface2->lock_next();
288 } 286 }
289 287
290 if (m_crtc->card().has_atomic()) { 288 int r;
291 int r;
292
293 AtomicReq req(m_crtc->card());
294
295 req.add(m_root_plane, "FB_ID", fb->id());
296 if (m_plane)
297 req.add(m_plane, "FB_ID", planefb->id());
298 289
299 r = req.test(); 290 AtomicReq req(m_crtc->card());
300 FAIL_IF(r, "atomic test failed");
301 291
302 r = req.commit(this); 292 req.add(m_root_plane, "FB_ID", fb->id());
303 FAIL_IF(r, "atomic commit failed"); 293 if (m_plane)
304 } else { 294 req.add(m_plane, "FB_ID", planefb->id());
305 int ret;
306 295
307 ret = m_crtc->page_flip(*fb, this); 296 r = req.test();
308 FAIL_IF(ret, "failed to queue page flip"); 297 FAIL_IF(r, "atomic test failed");
309 298
310 if (m_plane) { 299 r = req.commit(this);
311 ret = m_crtc->set_plane(m_plane, *planefb, 300 FAIL_IF(r, "atomic commit failed");
312 0, 0, planefb->width(), planefb->height(),
313 0, 0, planefb->width(), planefb->height());
314 FAIL_IF(ret, "failed to set plane");
315 }
316 }
317 301
318 s_flip_pending++; 302 s_flip_pending++;
319 } 303 }
@@ -340,6 +324,8 @@ void main_gbm()
340{ 324{
341 Card card; 325 Card card;
342 326
327 FAIL_IF(!card.has_atomic(), "No atomic modesetting");
328
343 GbmDevice gdev(card); 329 GbmDevice gdev(card);
344 EglState egl(gdev.handle()); 330 EglState egl(gdev.handle());
345 331