From e04bbf938ce258898565274b8542684295ee6cd4 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 15 Aug 2016 12:25:47 +0300 Subject: support finding fractional vrefresh --- utils/testpat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/testpat.cpp b/utils/testpat.cpp index 4cde7c1..ccddccb 100644 --- a/utils/testpat.cpp +++ b/utils/testpat.cpp @@ -102,7 +102,7 @@ static void get_default_crtc(Card& card, OutputInfo& output) static void parse_crtc(Card& card, const string& crtc_str, OutputInfo& output) { // @12:1920x1200@60 - const regex mode_re("(?:(@?)(\\d+):)?(?:(\\d+)x(\\d+)(i)?)(?:@(\\d+))?"); + const regex mode_re("(?:(@?)(\\d+):)?(?:(\\d+)x(\\d+)(i)?)(?:@([\\d\\.]+))?"); smatch sm; if (!regex_match(crtc_str, sm, mode_re)) @@ -133,7 +133,7 @@ static void parse_crtc(Card& card, const string& crtc_str, OutputInfo& output) unsigned w = stoul(sm[3]); unsigned h = stoul(sm[4]); bool ilace = sm[5].matched ? true : false; - unsigned refresh = sm[6].matched ? stoul(sm[6]) : 0; + float refresh = sm[6].matched ? stof(sm[6]) : 0; bool found_mode = false; -- cgit v1.2.3