From f73fdfb4651887bc2520dea226b526b36493dc02 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Tue, 16 May 2023 17:21:06 +0200 Subject: drm-buffer-gbm: Bail out early if FBO allocation fails A failing allocation is non-fatal here, however if it fails later in a lazy allocation triggered by `cogl_framebuffer_create_timestamp_query()` we end up crashing. Thus force the allocation early, like we already do in other places. Part-of: --- src/backends/native/meta-drm-buffer-gbm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backends/native/meta-drm-buffer-gbm.c b/src/backends/native/meta-drm-buffer-gbm.c index 17d18115f..86c60fd00 100644 --- a/src/backends/native/meta-drm-buffer-gbm.c +++ b/src/backends/native/meta-drm-buffer-gbm.c @@ -328,6 +328,9 @@ meta_drm_buffer_gbm_fill_timings (MetaDrmBuffer *buffer, cogl_fbo = cogl_offscreen_new_with_texture (COGL_TEXTURE (cogl_tex)); cogl_object_unref (cogl_tex); + if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (cogl_fbo), error)) + goto out; + if (cogl_has_feature (cogl_context, COGL_FEATURE_ID_TIMESTAMP_QUERY)) { info->gpu_time_before_buffer_swap_ns = -- cgit v1.2.1