With the modifier support it is possible to force a modifier which isn't
compatible with any of the GPU targets. In that case the EGL platform will
be unable to allocate the back buffers.

Provide an error message in that case, instead of crashing.

Signed-off-by: Lucas Stach <l.st...@pengutronix.de>
---
 drm-atomic.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drm-atomic.c b/drm-atomic.c
index 0f3c4f285fb7..1b1cc633c1cb 100644
--- a/drm-atomic.c
+++ b/drm-atomic.c
@@ -187,6 +187,10 @@ static int atomic_run(const struct gbm *gbm, const struct 
egl *egl)
 
        eglSwapBuffers(egl->display, egl->surface);
        bo = gbm_surface_lock_front_buffer(gbm->surface);
+       if (!bo) {
+               printf("Failed to lock frontbuffer\n");
+               return -1;
+       }
        fb = drm_fb_get_from_bo(bo);
        if (!fb) {
                printf("Failed to get a new framebuffer BO\n");
-- 
2.11.0

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to