From fa5373b65dbe71f235cc4caddd66b3a51b0fafc1 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 23 Aug 2018 13:45:30 +0300 Subject: 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 --- utils/kmstest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'utils') 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"); } -- cgit v1.2.3