renderer/native: Also wrap flip closures for EGLStreams

When using the EGLStream backend, the MetaRendererNative passed a
GClosure to KMS when using EGLStreams, but KMS flip callback event
handler in meta-gpu-kms.c expected a closure wrapped in a closure
container, meaning it'd instead crash when using EGLStreams. Make the
flip handler get what it expects also when using EGLStreams by wrapping
the flip closure in the container before handing it over to EGL.

https://bugzilla.gnome.org/show_bug.cgi?id=790316
This commit is contained in:
Jonas Ådahl
2017-11-14 16:08:52 +08:00
parent 909dbafd67
commit 8ee14a7cb7
3 changed files with 44 additions and 14 deletions

View File

@ -1271,6 +1271,7 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native,
MetaRendererNativeGpuData *renderer_gpu_data;
EGLDisplay *egl_display;
MetaEgl *egl = meta_onscreen_native_get_egl (onscreen_native);
MetaGpuKmsFlipClosureContainer *closure_container;
EGLAttrib *acquire_attribs;
GError *error = NULL;
@ -1280,9 +1281,12 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native,
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);
acquire_attribs = (EGLAttrib[]) {
EGL_DRM_FLIP_EVENT_DATA_NV,
(EGLAttrib) flip_closure,
(EGLAttrib) closure_container,
EGL_NONE
};
@ -1301,6 +1305,7 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native,
renderer_gpu_data->egl.no_egl_output_drm_flip_event = TRUE;
}
g_error_free (error);
meta_gpu_kms_flip_closure_container_free (closure_container);
return FALSE;
}