summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorAnton Kindestam <antonki@kth.se>2018-11-27 18:39:16 +0100
committersfan5 <sfan5@live.de>2019-02-25 01:25:25 +0100
commit537006965e98255deb6c433c3f715738d9092946 (patch)
tree06f02adca01dc77c7d322e545880f6ef84ca6ce1 /player
parentae115bd8d8535bd4d40438d1bf7c380a6731d6a4 (diff)
downloadmpv-537006965e98255deb6c433c3f715738d9092946.tar.bz2
mpv-537006965e98255deb6c433c3f715738d9092946.tar.xz
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.
Diffstat (limited to 'player')
0 files changed, 0 insertions, 0 deletions