summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e4fbf01)
raw | patch | inline | side by side (parent: e4fbf01)
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Tue, 11 Oct 2016 08:21:13 +0000 (11:21 +0300) | ||
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Tue, 11 Oct 2016 08:24:00 +0000 (11:24 +0300) |
Instead of searching through the dmt and cea tables (if user has given
the option), lets be more explicit about it. Only look for the mode from
a single source, and fail if not found there.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
the option), lets be more explicit about it. Only look for the mode from
a single source, and fail if not found there.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
utils/kmstest.cpp | patch | blob | history |
diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp
index a88d09258f588bc12fa8c45862c06ee37fb88add..cfec7804bc2184ba88e5c8ff7607ea7de945605f 100644 (file)
--- a/utils/kmstest.cpp
+++ b/utils/kmstest.cpp
@@ -148,38 +148,27 @@ static void parse_crtc(Card& card, const string& crtc_str, OutputInfo& output)
bool ilace = sm[5].matched ? true : false;
float refresh = sm[6].matched ? stof(sm[6]) : 0;
- bool found_mode = false;
-
if (s_cvt) {
output.mode = videomode_from_cvt(w, h, refresh, ilace, s_cvt_v2, s_cvt_vid_opt);
- found_mode = true;
- }
-
- if (!found_mode) {
- try {
- output.mode = output.connector->get_mode(w, h, refresh, ilace);
- found_mode = true;
- } catch (exception& e) { }
- }
-
- if (!found_mode && s_use_dmt) {
+ } else if (s_use_dmt) {
try {
output.mode = find_dmt(w, h, refresh, ilace);
- found_mode = true;
- printf("Found mode from DMT\n");
- } catch (exception& e) { }
- }
-
- if (!found_mode && s_use_cea) {
+ } catch (exception& e) {
+ EXIT("Mode not found from DMT tables\n");
+ }
+ } else if (s_use_cea) {
try {
output.mode = find_cea(w, h, refresh, ilace);
- found_mode = true;
- printf("Found mode from CEA\n");
- } catch (exception& e) { }
+ } catch (exception& e) {
+ EXIT("Mode not found from CEA tables\n");
+ }
+ } else {
+ try {
+ output.mode = output.connector->get_mode(w, h, refresh, ilace);
+ } catch (exception& e) {
+ EXIT("Mode not found from the connector\n");
+ }
}
-
- if (!found_mode)
- throw invalid_argument("Mode not found");
} else if (regex_match(crtc_str, sm, modeline_re)) {
if (sm[2].matched) {
bool use_id = sm[1].length() == 1;