0010-Fix-for-framerate-with-nested-composition.patch 2.4 KB

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