summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2018-08-23 13:45:30 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-08-23 13:45:30 +0300
commitfa5373b65dbe71f235cc4caddd66b3a51b0fafc1 (patch)
treec35783dfcf786d9c6c54c49c2a4b1cc13fe0c8bf /utils
parent40d96062a37ca924a66a926a234b35644928d4a7 (diff)
kmstest: fix "Could not find available crtc" when crtc was not connected.
If a connector doesn't already have a crtc, we might get "Could not find available crtc" error from kmstest as it fails to search for the crtc. Fix this. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/kmstest.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp
index aecb089..1c2d086 100644
--- a/utils/kmstest.cpp
+++ b/utils/kmstest.cpp
@@ -234,7 +234,12 @@ static void parse_crtc(ResourceManager& resman, Card& card, const string& crtc_s
EXIT("Failed to parse crtc option '%s'", crtc_str.c_str());
}
- if (!resman.reserve_crtc(output.crtc))
+ if (output.crtc)
+ output.crtc = resman.reserve_crtc(output.crtc);
+ else
+ output.crtc = resman.reserve_crtc(output.connector);
+
+ if (!output.crtc)
EXIT("Could not find available crtc");
}