From e32d07e441e27d9253f15f7f7d309ae80efb18cf Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Tue, 17 Oct 2023 18:00:45 -0400 Subject: [PATCH] Holding the visible_fb in the eglstreams DisplayBuffer --- src/platforms/eglstream-kms/server/display.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platforms/eglstream-kms/server/display.cpp b/src/platforms/eglstream-kms/server/display.cpp index 3052d91a26..f05348dff7 100644 --- a/src/platforms/eglstream-kms/server/display.cpp +++ b/src/platforms/eglstream-kms/server/display.cpp @@ -213,12 +213,11 @@ class DisplayBuffer if (next_swap) // This is the KMS route { + visible_fb = std::move(next_swap); + next_swap = nullptr; auto const predicted_render_time = 50ms; // Predicted worst case render time for the next frame... - output->queue_atomic_flip(*next_swap, event_handler->drm_event_data()); - // TODO: Do we need to wait for a page flip here? KMS does it here, - // but perhaps our 'pending_flip.get()' is good enough? I am a bit unfamiliar - next_swap = nullptr; + output->queue_atomic_flip(*visible_fb, event_handler->drm_event_data()); auto const min_frame_interval = 1000ms / output->max_refresh_rate(); if (predicted_render_time < min_frame_interval) recommend_sleep = min_frame_interval - predicted_render_time; @@ -338,6 +337,7 @@ class DisplayBuffer /// Used only for the KMS case std::shared_ptr next_swap{nullptr}; + std::shared_ptr visible_fb{nullptr}; std::chrono::milliseconds recommend_sleep{0}; };