From c0093c91f0fa2fd6a5b9d1b206a6f44dcd55bfb5 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 23 Oct 2018 18:00:42 +0300 Subject: kmstest: show sync polarities Signed-off-by: Tomi Valkeinen --- utils/kmstest.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp index 698ad25..37f9e0f 100644 --- a/utils/kmstest.cpp +++ b/utils/kmstest.cpp @@ -691,10 +691,22 @@ static vector setups_to_outputs(Card& card, ResourceManager& resman, return outputs; } +static char sync_to_char(SyncPolarity pol) +{ + switch (pol) { + case SyncPolarity::Positive: + return '+'; + case SyncPolarity::Negative: + return '-'; + default: + return '?'; + } +} + static std::string videomode_to_string(const Videomode& m) { - string h = sformat("%u/%u/%u/%u", m.hdisplay, m.hfp(), m.hsw(), m.hbp()); - string v = sformat("%u/%u/%u/%u", m.vdisplay, m.vfp(), m.vsw(), m.vbp()); + string h = sformat("%u/%u/%u/%u/%c", m.hdisplay, m.hfp(), m.hsw(), m.hbp(), sync_to_char(m.hsync())); + string v = sformat("%u/%u/%u/%u/%c", m.vdisplay, m.vfp(), m.vsw(), m.vbp(), sync_to_char(m.vsync())); return sformat("%s %.3f %s %s %u (%.2f) %#x %#x", m.name.c_str(), -- cgit v1.2.3