126e4beaaSAndrew GeisslerFrom 09de2ce12ed8a879cc822cd20c5f2756d030808a Mon Sep 17 00:00:00 2001 21a4b7ee2SBrad BishopFrom: Khem Raj <raj.khem@gmail.com> 31a4b7ee2SBrad BishopDate: Tue, 29 Mar 2016 20:38:30 -0700 426e4beaaSAndrew GeisslerSubject: [PATCH] Fix for framerate with nested composition 51a4b7ee2SBrad Bishop 61a4b7ee2SBrad Bishopframe rate appears irregular and lower than expected when using nested composition. 71a4b7ee2SBrad Bishop 81a4b7ee2SBrad BishopSigned-off-by: Khem Raj <raj.khem@gmail.com> 91a4b7ee2SBrad Bishop--- 10*520786ccSPatrick WilliamsUpstream-Status: Pending 11*520786ccSPatrick Williams 121a4b7ee2SBrad Bishop interface/khronos/egl/egl_client.c | 8 ++++++++ 131a4b7ee2SBrad Bishop 1 file changed, 8 insertions(+) 141a4b7ee2SBrad Bishop 151a4b7ee2SBrad Bishopdiff --git a/interface/khronos/egl/egl_client.c b/interface/khronos/egl/egl_client.c 161a4b7ee2SBrad Bishopindex 03fe67b..13a110c 100644 171a4b7ee2SBrad Bishop--- a/interface/khronos/egl/egl_client.c 181a4b7ee2SBrad Bishop+++ b/interface/khronos/egl/egl_client.c 191a4b7ee2SBrad Bishop@@ -2342,6 +2342,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf) 201a4b7ee2SBrad Bishop surface->back_wl_buffer = buffer; 211a4b7ee2SBrad Bishop } 221a4b7ee2SBrad Bishop 231a4b7ee2SBrad Bishop+ glFlush(); 241a4b7ee2SBrad Bishop+ glFinish(); 251a4b7ee2SBrad Bishop+ 261a4b7ee2SBrad Bishop RPC_CALL7(eglIntSwapBuffers_impl, 271a4b7ee2SBrad Bishop thread, 281a4b7ee2SBrad Bishop EGLINTSWAPBUFFERS_ID_V2, 291a4b7ee2SBrad Bishop@@ -2353,6 +2356,8 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf) 301a4b7ee2SBrad Bishop RPC_UINT(khrn_platform_get_window_position(surface->win)), 311a4b7ee2SBrad Bishop RPC_INT(surface->back_wl_buffer->resource)); 321a4b7ee2SBrad Bishop 331a4b7ee2SBrad Bishop+ RPC_FLUSH(thread); 341a4b7ee2SBrad Bishop+ 351a4b7ee2SBrad Bishop surface->front_wl_buffer->in_use = 1; 361a4b7ee2SBrad Bishop wl_surface_attach(wl_egl_window->wl_surface, 371a4b7ee2SBrad Bishop surface->front_wl_buffer->wl_buffer, 381a4b7ee2SBrad Bishop@@ -2360,11 +2365,13 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf) 391a4b7ee2SBrad Bishop wl_surface_damage(wl_egl_window->wl_surface, 0, 0, 401a4b7ee2SBrad Bishop surface->width, surface->height); 411a4b7ee2SBrad Bishop wl_surface_commit(wl_egl_window->wl_surface); 421a4b7ee2SBrad Bishop+ wl_display_flush(wl_display); 431a4b7ee2SBrad Bishop 441a4b7ee2SBrad Bishop while(ret != -1 && surface->back_wl_buffer->in_use) 451a4b7ee2SBrad Bishop ret = wl_display_dispatch_queue(wl_display, process->wl_queue); 461a4b7ee2SBrad Bishop } else 471a4b7ee2SBrad Bishop #endif 481a4b7ee2SBrad Bishop+ { 491a4b7ee2SBrad Bishop RPC_CALL6(eglIntSwapBuffers_impl, 501a4b7ee2SBrad Bishop thread, 511a4b7ee2SBrad Bishop EGLINTSWAPBUFFERS_ID, 521a4b7ee2SBrad Bishop@@ -2376,6 +2383,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf) 531a4b7ee2SBrad Bishop RPC_UINT(khrn_platform_get_window_position(surface->win))); 541a4b7ee2SBrad Bishop 551a4b7ee2SBrad Bishop RPC_FLUSH(thread); 561a4b7ee2SBrad Bishop+ } 571a4b7ee2SBrad Bishop 581a4b7ee2SBrad Bishop #ifdef ANDROID 591a4b7ee2SBrad Bishop CLIENT_UNLOCK(); 60