Mir

Comment 1 for bug 1379685

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Missing frames/out of order with swap interval 0

The problem appears to be our new(ish) drop_frame implementation:

void mc::BufferQueue::drop_frame(std::unique_lock<std::mutex> lock)
{
    auto buffer_to_give = pop(ready_to_composite_queue);
    /* Advance compositor buffer so it always points to the most recent
     * client content
     */
    if (!contains(current_compositor_buffer, buffers_sent_to_compositor))
    {
       current_buffer_users.clear();
       void const* const impossible_user_id = this;
       current_buffer_users.push_back(impossible_user_id);
       std::swap(buffer_to_give, current_compositor_buffer);
    }
    give_buffer_to_client(buffer_to_give, std::move(lock));
}

The issue is that ready_to_composite_queue.size() == 1, somehow, and so we're actually dropping the newest frame. The complicated swapping logic in the middle (which seems to be an attempt to avoid the problem) appears to be doing nothing, or simply not working.