Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 1 | From 2f0b25266d0b4b04ef78b8950f5bd9749857b4f0 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 |
| 4 | Subject: [PATCH 10/18] Fix for framerate with nested composition |
| 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(); |
| 58 | -- |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 59 | 2.20.1 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 60 | |