mpv/video/out/opengl
Anton Kindestam 537006965e context_drm_egl: implement n-buffering
This allows context_drm_egl to use as many buffers as libgbm or the
swapchain_depth setting allows (whichever is smaller).

On pause and on still images (cover art etc.) to make sure that output does not
lag behind user input, the swapchain is drained and reverts to working in a dual
buffered (equivalent to swapchain-depth=1) manner.

When possible (swapchain-depth>=2), the wait on the page flip event is now not
done immediately after queueing, but is deferred to the next invocation of
swap_buffers. Which should give us more CPU time between invocations.

Although, since gbm_surface_has_free_buffers() can only tell us a boolean value
and not how many buffers we have left, we are forced to do this contortionist
dance where we first overshoot until gbm_surface_has_free_buffers() reports 0,
followed by immediately waiting so we can free a buffer, to be able to get the
deferred wait on page flip rolling.

With this commit we do not rely on the default vsync fences/latency emulation of
video/out/opengl/context.c, but supply our own, since the places we create and
wait for the fences needs to be somewhat different for best performance.

Minor fixes:

 * According to GBM documentation all BO:s gotten with
   gbm_surface_lock_front_buffer must be released before gbm_surface_destroy is
   called on the surface.
 * We let the page flip handler function handle the waiting_for_flip flag.
2019-02-25 01:25:25 +01:00
..
angle_dynamic.c angle_dynamic: silence warnings during compilation 2016-11-25 09:49:49 +01:00
angle_dynamic.h vo_opengl: angle: rewrite with custom swap chain 2017-02-07 22:45:07 +11:00
common.c opengl: Support GL_ARB_sync style fences on OpenGL ES 3.0 2019-02-25 01:25:25 +01:00
common.h client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
context.c client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
context.h client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
context_android.c vo_gpu/context_android: replace both options with android-surface-size 2018-01-02 15:04:31 -08:00
context_angle.c vo_gpu: d3d11: implement tex_download() 2018-02-13 21:25:15 +11:00
context_cocoa.c cocoa: change deprecation warning from opengl-cb to libmpv 2018-04-29 15:03:47 +03:00
context_drm_egl.c context_drm_egl: implement n-buffering 2019-02-25 01:25:25 +01:00
context_dxinterop.c client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
context_glx.c vo_opengl: refactor into vo_gpu 2017-09-21 15:00:55 +02:00
context_mali_fbdev.c vo_opengl: refactor into vo_gpu 2017-09-21 15:00:55 +02:00
context_rpi.c client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
context_vdpau.c vo_gpu: simplify structs / names 2017-09-22 16:58:55 +02:00
context_wayland.c client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
context_win.c vo_gpu: win: remove exclusive-fullscreen detection hack 2017-12-20 14:53:41 +11:00
context_x11egl.c client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
egl_helpers.c egl_helpers: change minimum framebuffer size to 8 bit per component 2018-04-29 02:21:32 +03:00
egl_helpers.h egl_helpers: mpegl_cb can now signal an error condition 2018-02-26 23:56:13 -08:00
formats.c vo_opengl: remove some dead code 2017-08-11 21:29:35 +02:00
formats.h vo_opengl: refactor into vo_gpu 2017-09-21 15:00:55 +02:00
gl_headers.h vo_opengl: handle probing GL texture formats better 2017-08-11 21:29:35 +02:00
hwdec_cuda.c vo_gpu: hwdec_cuda: Guard GL and Vulkan headers properly 2018-11-18 23:50:38 +02:00
hwdec_d3d11egl.c video: rewrite filtering glue code 2018-01-30 03:10:27 -08:00
hwdec_d3d11eglrgb.c video: rewrite filtering glue code 2018-01-30 03:10:27 -08:00
hwdec_drmprime_drm.c drm: rename plane options to better, invariant, names 2018-12-01 15:42:20 +02:00
hwdec_dxva2egl.c hwdec: don't require setting legacy hwdec fields 2017-12-02 04:53:51 +01:00
hwdec_dxva2gldx.c client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
hwdec_ios.m hwdec_ios: fix crash after mapper_init failure 2018-04-17 01:06:29 +03:00
hwdec_osx.c hwdec: don't require setting legacy hwdec fields 2017-12-02 04:53:51 +01:00
hwdec_rpi.c client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
hwdec_vaegl.c hwdec_vaegl: Fix VAAPI EGL interop used with gpu-context=drm 2018-07-09 02:33:35 +03:00
hwdec_vdpau.c vo_gpu: hwdec: remove redundant fields 2017-12-01 05:57:41 +01:00
libmpv_gl.c client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
ra_gl.c vo_gpu: opengl: disable compute shaders for old GLSL 2018-11-17 00:49:10 +01:00
ra_gl.h vo_opengl: refactor into vo_gpu 2017-09-21 15:00:55 +02:00
utils.c vo_gpu: make screenshots use the GL renderer 2018-02-11 17:45:51 -08:00
utils.h vo_gpu: make screenshots use the GL renderer 2018-02-11 17:45:51 -08:00