From 6cfab9d2140aecff2f7e267bfb97c810c38823f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 11 Jan 2019 16:05:09 +0100 Subject: [PATCH 1/2] renderer/native: Make EGLStream page flip errors non-fatal Just continue rendering; we don't care if we were busy once, as it'll most likely work when we flip the next time. --- src/backends/native/meta-renderer-native.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index 470da8845..130ca5268 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -96,8 +96,6 @@ typedef struct _MetaRendererNativeGpuData #ifdef HAVE_EGL_DEVICE struct { EGLDeviceEXT device; - - gboolean no_egl_output_drm_flip_event; } egl; #endif @@ -1293,8 +1291,6 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native, renderer_gpu_data = meta_renderer_native_get_gpu_data (onscreen_native->renderer_native, onscreen_native->render_gpu); - if (renderer_gpu_data->egl.no_egl_output_drm_flip_event) - return FALSE; closure_container = meta_gpu_kms_wrap_flip_closure (onscreen_native->render_gpu, flip_closure); @@ -1315,9 +1311,7 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native, if (error->domain != META_EGL_ERROR || error->code != EGL_RESOURCE_BUSY_EXT) { - g_warning ("Failed to flip EGL stream (%s), relying on clock from " - "now on", error->message); - renderer_gpu_data->egl.no_egl_output_drm_flip_event = TRUE; + g_warning ("Failed to flip EGL stream: %s", error->message); } g_error_free (error); meta_gpu_kms_flip_closure_container_free (closure_container); -- 2.19.2 From 7c22e8434348b16ff433494026a69d2892f3e48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 11 Jan 2019 16:03:37 +0100 Subject: [PATCH 2/2] renderer/native: Make the EGLStreams operate in mailbox mode This means eglSwapBuffers() wont dead lock if there is an old buffer pending page flip. This could happen after e.g. mode changes or for other reasons. --- src/backends/native/meta-renderer-native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index 130ca5268..af5693b6e 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -2122,7 +2122,7 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen, EGLOutputLayerEXT output_layer; EGLAttrib output_attribs[3]; EGLint stream_attribs[] = { - EGL_STREAM_FIFO_LENGTH_KHR, 1, + EGL_STREAM_FIFO_LENGTH_KHR, 0, EGL_CONSUMER_AUTO_ACQUIRE_EXT, EGL_FALSE, EGL_NONE }; -- 2.19.2