From d6300fcfb0bc420ff30a6c8f44f9b5fe862cdb3d Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 4 Sep 2017 15:37:46 +0300 Subject: kmstest: fix --sync mode DRM sends page flips for each crtc in a commit. kmstest expected to get a single flip event for a single commit, which caused --sync not to work with two displays. Fix this by making kmstest skip the first flip event. --- utils/kmstest.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'utils/kmstest.cpp') diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp index f9486a4..ba7d790 100644 --- a/utils/kmstest.cpp +++ b/utils/kmstest.cpp @@ -851,6 +851,13 @@ public: private: void handle_page_flip(uint32_t frame, double time) { + /* + * We get flip event for each crtc in this flipstate. We can commit the next frames + * only after we've gotten the flip event for all crtcs + */ + if (++m_flip_count < m_outputs.size()) + return; + m_frame_num++; if (s_max_flips && m_frame_num >= s_max_flips) max_flips_reached = true; @@ -942,6 +949,8 @@ private: void queue_next() { + m_flip_count = 0; + if (m_card.has_atomic()) { AtomicReq req(m_card); @@ -961,6 +970,7 @@ private: string m_name; vector m_outputs; unsigned m_frame_num; + unsigned m_flip_count; chrono::steady_clock::time_point m_prev_print; chrono::steady_clock::time_point m_prev_frame; -- cgit v1.2.3