1*1a4b7ee2SBrad BishopFrom 8e6cde08077eadfe563dc17c19995ebc48e30b97 Mon Sep 17 00:00:00 2001 2*1a4b7ee2SBrad BishopFrom: Khem Raj <raj.khem@gmail.com> 3*1a4b7ee2SBrad BishopDate: Tue, 29 Mar 2016 20:38:30 -0700 4*1a4b7ee2SBrad BishopSubject: [PATCH 10/18] Fix for framerate with nested composition 5*1a4b7ee2SBrad Bishop 6*1a4b7ee2SBrad Bishopframe rate appears irregular and lower than expected when using nested composition. 7*1a4b7ee2SBrad Bishop 8*1a4b7ee2SBrad BishopSigned-off-by: Khem Raj <raj.khem@gmail.com> 9*1a4b7ee2SBrad Bishop--- 10*1a4b7ee2SBrad Bishop interface/khronos/egl/egl_client.c | 8 ++++++++ 11*1a4b7ee2SBrad Bishop 1 file changed, 8 insertions(+) 12*1a4b7ee2SBrad Bishop 13*1a4b7ee2SBrad Bishopdiff --git a/interface/khronos/egl/egl_client.c b/interface/khronos/egl/egl_client.c 14*1a4b7ee2SBrad Bishopindex 03fe67b..13a110c 100644 15*1a4b7ee2SBrad Bishop--- a/interface/khronos/egl/egl_client.c 16*1a4b7ee2SBrad Bishop+++ b/interface/khronos/egl/egl_client.c 17*1a4b7ee2SBrad Bishop@@ -2342,6 +2342,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf) 18*1a4b7ee2SBrad Bishop surface->back_wl_buffer = buffer; 19*1a4b7ee2SBrad Bishop } 20*1a4b7ee2SBrad Bishop 21*1a4b7ee2SBrad Bishop+ glFlush(); 22*1a4b7ee2SBrad Bishop+ glFinish(); 23*1a4b7ee2SBrad Bishop+ 24*1a4b7ee2SBrad Bishop RPC_CALL7(eglIntSwapBuffers_impl, 25*1a4b7ee2SBrad Bishop thread, 26*1a4b7ee2SBrad Bishop EGLINTSWAPBUFFERS_ID_V2, 27*1a4b7ee2SBrad Bishop@@ -2353,6 +2356,8 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf) 28*1a4b7ee2SBrad Bishop RPC_UINT(khrn_platform_get_window_position(surface->win)), 29*1a4b7ee2SBrad Bishop RPC_INT(surface->back_wl_buffer->resource)); 30*1a4b7ee2SBrad Bishop 31*1a4b7ee2SBrad Bishop+ RPC_FLUSH(thread); 32*1a4b7ee2SBrad Bishop+ 33*1a4b7ee2SBrad Bishop surface->front_wl_buffer->in_use = 1; 34*1a4b7ee2SBrad Bishop wl_surface_attach(wl_egl_window->wl_surface, 35*1a4b7ee2SBrad Bishop surface->front_wl_buffer->wl_buffer, 36*1a4b7ee2SBrad Bishop@@ -2360,11 +2365,13 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf) 37*1a4b7ee2SBrad Bishop wl_surface_damage(wl_egl_window->wl_surface, 0, 0, 38*1a4b7ee2SBrad Bishop surface->width, surface->height); 39*1a4b7ee2SBrad Bishop wl_surface_commit(wl_egl_window->wl_surface); 40*1a4b7ee2SBrad Bishop+ wl_display_flush(wl_display); 41*1a4b7ee2SBrad Bishop 42*1a4b7ee2SBrad Bishop while(ret != -1 && surface->back_wl_buffer->in_use) 43*1a4b7ee2SBrad Bishop ret = wl_display_dispatch_queue(wl_display, process->wl_queue); 44*1a4b7ee2SBrad Bishop } else 45*1a4b7ee2SBrad Bishop #endif 46*1a4b7ee2SBrad Bishop+ { 47*1a4b7ee2SBrad Bishop RPC_CALL6(eglIntSwapBuffers_impl, 48*1a4b7ee2SBrad Bishop thread, 49*1a4b7ee2SBrad Bishop EGLINTSWAPBUFFERS_ID, 50*1a4b7ee2SBrad Bishop@@ -2376,6 +2383,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf) 51*1a4b7ee2SBrad Bishop RPC_UINT(khrn_platform_get_window_position(surface->win))); 52*1a4b7ee2SBrad Bishop 53*1a4b7ee2SBrad Bishop RPC_FLUSH(thread); 54*1a4b7ee2SBrad Bishop+ } 55*1a4b7ee2SBrad Bishop 56*1a4b7ee2SBrad Bishop #ifdef ANDROID 57*1a4b7ee2SBrad Bishop CLIENT_UNLOCK(); 58*1a4b7ee2SBrad Bishop-- 59*1a4b7ee2SBrad Bishop2.19.1 60*1a4b7ee2SBrad Bishop 61