From 7eb69193974e771788e7dbce60f15693413cf2bb Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 7 Dec 2015 20:06:22 +0200 Subject: [PATCH] testpat: support interlace --- tests/testpat.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/testpat.cpp b/tests/testpat.cpp index c51d3ec..56ad7a5 100644 --- a/tests/testpat.cpp +++ b/tests/testpat.cpp @@ -120,7 +120,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+))(?:-(\\d+))?"); + const regex mode_re("(?:(@?)(\\d+):)?(?:(\\d+)x(\\d+)(i)?)(?:-(\\d+))?"); smatch sm; if (!regex_match(crtc_str, sm, mode_re)) @@ -150,11 +150,10 @@ static void parse_crtc(Card& card, const string& crtc_str, OutputInfo& output) unsigned w = stoul(sm[3]); unsigned h = stoul(sm[4]); - unsigned refresh = 0; - if (sm[5].matched) - refresh = stoul(sm[5]); + bool ilace = sm[5].matched ? true : false; + unsigned refresh = sm[6].matched ? stoul(sm[6]) : 0; - output.mode = output.connector->get_mode(w, h, refresh); + output.mode = output.connector->get_mode(w, h, refresh, ilace); } static void parse_plane(Card& card, const string& plane_str, const OutputInfo& output, PlaneInfo& pinfo) -- 2.39.2