1*26e4beaaSAndrew 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
4*26e4beaaSAndrew 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---
101a4b7ee2SBrad Bishop interface/khronos/egl/egl_client.c | 8 ++++++++
111a4b7ee2SBrad Bishop 1 file changed, 8 insertions(+)
121a4b7ee2SBrad Bishop
131a4b7ee2SBrad Bishopdiff --git a/interface/khronos/egl/egl_client.c b/interface/khronos/egl/egl_client.c
141a4b7ee2SBrad Bishopindex 03fe67b..13a110c 100644
151a4b7ee2SBrad Bishop--- a/interface/khronos/egl/egl_client.c
161a4b7ee2SBrad Bishop+++ b/interface/khronos/egl/egl_client.c
171a4b7ee2SBrad Bishop@@ -2342,6 +2342,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
181a4b7ee2SBrad Bishop                      surface->back_wl_buffer = buffer;
191a4b7ee2SBrad Bishop                   }
201a4b7ee2SBrad Bishop
211a4b7ee2SBrad Bishop+                  glFlush();
221a4b7ee2SBrad Bishop+                  glFinish();
231a4b7ee2SBrad Bishop+
241a4b7ee2SBrad Bishop                   RPC_CALL7(eglIntSwapBuffers_impl,
251a4b7ee2SBrad Bishop                         thread,
261a4b7ee2SBrad Bishop                         EGLINTSWAPBUFFERS_ID_V2,
271a4b7ee2SBrad Bishop@@ -2353,6 +2356,8 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
281a4b7ee2SBrad Bishop                         RPC_UINT(khrn_platform_get_window_position(surface->win)),
291a4b7ee2SBrad Bishop                         RPC_INT(surface->back_wl_buffer->resource));
301a4b7ee2SBrad Bishop
311a4b7ee2SBrad Bishop+                  RPC_FLUSH(thread);
321a4b7ee2SBrad Bishop+
331a4b7ee2SBrad Bishop                   surface->front_wl_buffer->in_use = 1;
341a4b7ee2SBrad Bishop                   wl_surface_attach(wl_egl_window->wl_surface,
351a4b7ee2SBrad Bishop                                     surface->front_wl_buffer->wl_buffer,
361a4b7ee2SBrad Bishop@@ -2360,11 +2365,13 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
371a4b7ee2SBrad Bishop                   wl_surface_damage(wl_egl_window->wl_surface, 0, 0,
381a4b7ee2SBrad Bishop                                     surface->width, surface->height);
391a4b7ee2SBrad Bishop                   wl_surface_commit(wl_egl_window->wl_surface);
401a4b7ee2SBrad Bishop+                  wl_display_flush(wl_display);
411a4b7ee2SBrad Bishop
421a4b7ee2SBrad Bishop                   while(ret != -1 && surface->back_wl_buffer->in_use)
431a4b7ee2SBrad Bishop                      ret = wl_display_dispatch_queue(wl_display, process->wl_queue);
441a4b7ee2SBrad Bishop                } else
451a4b7ee2SBrad Bishop #endif
461a4b7ee2SBrad Bishop+               {
471a4b7ee2SBrad Bishop                RPC_CALL6(eglIntSwapBuffers_impl,
481a4b7ee2SBrad Bishop                      thread,
491a4b7ee2SBrad Bishop                      EGLINTSWAPBUFFERS_ID,
501a4b7ee2SBrad Bishop@@ -2376,6 +2383,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
511a4b7ee2SBrad Bishop                      RPC_UINT(khrn_platform_get_window_position(surface->win)));
521a4b7ee2SBrad Bishop
531a4b7ee2SBrad Bishop                RPC_FLUSH(thread);
541a4b7ee2SBrad Bishop+               }
551a4b7ee2SBrad Bishop
561a4b7ee2SBrad Bishop #ifdef ANDROID
571a4b7ee2SBrad Bishop                CLIENT_UNLOCK();
58