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