Skip to content

Commit

Permalink
Holding the visible_fb in the eglstreams DisplayBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkae committed Oct 17, 2023
1 parent 6e64dfc commit e32d07e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/platforms/eglstream-kms/server/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -338,6 +337,7 @@ class DisplayBuffer

/// Used only for the KMS case
std::shared_ptr<mg::FBHandle const> next_swap{nullptr};
std::shared_ptr<mg::FBHandle const> visible_fb{nullptr};
std::chrono::milliseconds recommend_sleep{0};
};

Expand Down

0 comments on commit e32d07e

Please sign in to comment.