From a4002d21673cbd6a9b22a7c3705f2a3b741fda38 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 12 Sep 2023 18:03:53 +0100 Subject: kmstest: Support signed values for crtc_[xy] Signed-off-by: Dave Stevenson --- utils/kmstest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'utils/kmstest.cpp') diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp index c2f50c3..580b69b 100644 --- a/utils/kmstest.cpp +++ b/utils/kmstest.cpp @@ -32,8 +32,8 @@ struct PropInfo { struct PlaneInfo { Plane* plane; - unsigned x; - unsigned y; + signed x; + signed y; unsigned w; unsigned h; @@ -256,7 +256,7 @@ static void parse_plane(ResourceManager& resman, Card& card, const string& plane { // 3:400,400-400x400 const regex plane_re("(?:(@?)(\\d+):)?" // 3: - "(?:(\\d+),(\\d+)-)?" // 400,400- + "(?:(-?\\d+),(-?\\d+)-)?" // 400,400- "(\\d+)x(\\d+)"); // 400x400 smatch sm; @@ -291,12 +291,12 @@ static void parse_plane(ResourceManager& resman, Card& card, const string& plane pinfo.h = stoul(sm[6]); if (sm[3].matched) - pinfo.x = stoul(sm[3]); + pinfo.x = stol(sm[3]); else pinfo.x = output.mode.hdisplay / 2 - pinfo.w / 2; if (sm[4].matched) - pinfo.y = stoul(sm[4]); + pinfo.y = stol(sm[4]); else pinfo.y = output.mode.vdisplay / 2 - pinfo.h / 2; } -- cgit v1.2.3