aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen2017-09-04 07:37:46 -0500
committerTomi Valkeinen2017-09-04 07:43:25 -0500
commitd6300fcfb0bc420ff30a6c8f44f9b5fe862cdb3d (patch)
treec1adef07dbeb4839ce75169bcb2f2cf046cf0e08
parent7eeef88eec86a156ecccac510a1b66d60483f395 (diff)
downloadexternal-kmsxx-d6300fcfb0bc420ff30a6c8f44f9b5fe862cdb3d.tar.gz
external-kmsxx-d6300fcfb0bc420ff30a6c8f44f9b5fe862cdb3d.tar.xz
external-kmsxx-d6300fcfb0bc420ff30a6c8f44f9b5fe862cdb3d.zip
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.
-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:
851private: 851private:
852 void handle_page_flip(uint32_t frame, double time) 852 void handle_page_flip(uint32_t frame, double time)
853 { 853 {
854 /*
855 * We get flip event for each crtc in this flipstate. We can commit the next frames
856 * only after we've gotten the flip event for all crtcs
857 */
858 if (++m_flip_count < m_outputs.size())
859 return;
860
854 m_frame_num++; 861 m_frame_num++;
855 if (s_max_flips && m_frame_num >= s_max_flips) 862 if (s_max_flips && m_frame_num >= s_max_flips)
856 max_flips_reached = true; 863 max_flips_reached = true;
@@ -942,6 +949,8 @@ private:
942 949
943 void queue_next() 950 void queue_next()
944 { 951 {
952 m_flip_count = 0;
953
945 if (m_card.has_atomic()) { 954 if (m_card.has_atomic()) {
946 AtomicReq req(m_card); 955 AtomicReq req(m_card);
947 956
@@ -961,6 +970,7 @@ private:
961 string m_name; 970 string m_name;
962 vector<const OutputInfo*> m_outputs; 971 vector<const OutputInfo*> m_outputs;
963 unsigned m_frame_num; 972 unsigned m_frame_num;
973 unsigned m_flip_count;
964 974
965 chrono::steady_clock::time_point m_prev_print; 975 chrono::steady_clock::time_point m_prev_print;
966 chrono::steady_clock::time_point m_prev_frame; 976 chrono::steady_clock::time_point m_prev_frame;