diff options
| author | Dave Stevenson <dave.stevenson@raspberrypi.com> | 2023-09-12 18:03:53 +0100 |
|---|---|---|
| committer | Dave Stevenson <dave.stevenson@raspberrypi.com> | 2023-09-15 15:24:35 +0100 |
| commit | a4002d21673cbd6a9b22a7c3705f2a3b741fda38 (patch) | |
| tree | aac789c4101c7d0d27c2265f7f69ed9740658819 /utils/kmstest.cpp | |
| parent | 0a5291ceb7ae7bf67ab89d93e803ae2ce33ca096 (diff) | |
kmstest: Support signed values for crtc_[xy]
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Diffstat (limited to 'utils/kmstest.cpp')
| -rw-r--r-- | utils/kmstest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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; } |
