summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-02-04 08:45:14 +0200
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-03-26 15:52:08 +0200
commit51055ced0e0e849051f5aaf3620724e16ef25d6d (patch)
treef8d7f0ff9909e4758037cb8f0e2c2588c57f9eb5 /utils
parentf758e324e17b52116075bb9175a3dd03d223a424 (diff)
kmstest: Add test pattern parameters
Add new parameters: --pattern=PAT --rec=REC --range=RANGE Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/kmstest.cpp37
1 files changed, 35 insertions, 2 deletions
diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp
index 7c733da..0a8ca22 100644
--- a/utils/kmstest.cpp
+++ b/utils/kmstest.cpp
@@ -70,6 +70,7 @@ static bool s_cvt_v2;
static bool s_cvt_vid_opt;
static unsigned s_max_flips;
static bool s_print_crc;
+static TestPatternOptions s_pattern_options;
__attribute__((unused)) static void print_regex_match(smatch sm)
{
@@ -408,6 +409,9 @@ static const char* usage_str =
" --flip[=max] Do page flipping for each output with an optional maximum flips count\n"
" --sync Synchronize page flipping\n"
" --crc Print CRC16 for framebuffer contents\n"
+ " -T, --pattern=PAT test, white, black, red, green, blue, smpte\n"
+ " --rec=REC bt601, bt709, bt2020\n"
+ " --range=RANGE limited, full\n"
"\n"
"<connector>, <crtc> and <plane> can be given by index (<idx>) or id (@<id>).\n"
"<connector> can also be given by name.\n"
@@ -511,6 +515,35 @@ static vector<Arg> parse_cmdline(int argc, char** argv)
Option("|crc", []() {
s_print_crc = true;
}),
+ Option("T|pattern=", [&](string s) {
+ s_pattern_options.pattern = s;
+ }),
+ Option("|rec=", [&](string s) {
+ s = to_lower(s);
+
+ if (s == "bt601")
+ s_pattern_options.rec = RecStandard::BT601;
+ else if (s == "bt709")
+ s_pattern_options.rec = RecStandard::BT709;
+ else if (s == "bt2020")
+ s_pattern_options.rec = RecStandard::BT2020;
+ else {
+ usage();
+ exit(-1);
+ }
+ }),
+ Option("|range=", [&](string s) {
+ s = to_lower(s);
+
+ if (s == "limited")
+ s_pattern_options.range = ColorRange::Limited;
+ else if (s == "full")
+ s_pattern_options.range = ColorRange::Full;
+ else {
+ usage();
+ exit(-1);
+ }
+ }),
Option("h|help", [&]() {
usage();
exit(-1);
@@ -771,11 +804,11 @@ static void draw_test_patterns(const vector<OutputInfo>& outputs)
{
for (const OutputInfo& o : outputs) {
for (auto fb : o.legacy_fbs)
- draw_test_pattern(*fb);
+ draw_test_pattern(*fb, s_pattern_options);
for (const PlaneInfo& p : o.planes)
for (auto fb : p.fbs)
- draw_test_pattern(*fb);
+ draw_test_pattern(*fb, s_pattern_options);
}
}