summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-09-04 15:37:46 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-09-04 15:43:25 +0300
commitd6300fcfb0bc420ff30a6c8f44f9b5fe862cdb3d (patch)
treec1adef07dbeb4839ce75169bcb2f2cf046cf0e08 /utils
parent7eeef88eec86a156ecccac510a1b66d60483f395 (diff)
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.
Diffstat (limited to 'utils')
-rw-r--r--utils/kmstest.cpp10
1 files changed, 10 insertions, 0 deletions
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<const OutputInfo*> 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;