summaryrefslogtreecommitdiff
path: root/kmscube
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-04-11 12:11:14 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-04-11 12:11:14 +0300
commita15d72debd94398e5e4c91b84e7d86055774a187 (patch)
tree08f20a6fe6ad944009cca2cf233f65ef5ae8ef19 /kmscube
parent0ae1c917da66d0542dc8cda718e57d787266c7e2 (diff)
kmscube: check for free bufs
Diffstat (limited to 'kmscube')
-rw-r--r--kmscube/kmscube.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/kmscube/kmscube.cpp b/kmscube/kmscube.cpp
index 49592ec..2b01b6b 100644
--- a/kmscube/kmscube.cpp
+++ b/kmscube/kmscube.cpp
@@ -91,6 +91,11 @@ public:
GbmSurface(const GbmSurface& other) = delete;
GbmSurface& operator=(const GbmSurface& other) = delete;
+ bool has_free()
+ {
+ return gbm_surface_has_free_buffers(m_surface);
+ }
+
gbm_bo* lock_front_buffer()
{
return gbm_surface_lock_front_buffer(m_surface);
@@ -381,6 +386,8 @@ public:
void make_current()
{
+ FAIL_IF(!gsurface->has_free(), "No free buffers");
+
eglMakeCurrent(egl.display(), esurface, esurface, egl.context());
}