summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-05-27 14:28:56 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-05-30 13:52:34 +0300
commitb35fc6442d02d8a405bf71864b18de16a1184647 (patch)
treed50aa58b3af3ac6869d715990365e290f6458eeb
parent9e233836840d9708d32dc5a0b15df631ea274e7a (diff)
testpat: draw pattern separately
-rw-r--r--utils/testpat.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/utils/testpat.cpp b/utils/testpat.cpp
index cb2fe41..0dc7c17 100644
--- a/utils/testpat.cpp
+++ b/utils/testpat.cpp
@@ -245,9 +245,7 @@ static void parse_plane(Card& card, const string& plane_str, const OutputInfo& o
static DumbFramebuffer* get_default_fb(Card& card, unsigned width, unsigned height)
{
- auto fb = new DumbFramebuffer(card, width, height, PixelFormat::XRGB8888);
- draw_test_pattern(*fb);
- return fb;
+ return new DumbFramebuffer(card, width, height, PixelFormat::XRGB8888);
}
static DumbFramebuffer* parse_fb(Card& card, const string& fb_str, unsigned def_w, unsigned def_h)
@@ -273,9 +271,7 @@ static DumbFramebuffer* parse_fb(Card& card, const string& fb_str, unsigned def_
format = FourCCToPixelFormat(sm[3]);
}
- auto fb = new DumbFramebuffer(card, w, h, format);
- draw_test_pattern(*fb);
- return fb;
+ return new DumbFramebuffer(card, w, h, format);
}
static const char* usage_str =
@@ -562,6 +558,17 @@ static void print_outputs(const vector<OutputInfo>& outputs)
}
}
+static void draw_test_patterns(const vector<OutputInfo>& outputs)
+{
+ for (const OutputInfo& o : outputs) {
+ if (o.fb)
+ draw_test_pattern(*o.fb);
+
+ for (const PlaneInfo& p : o.planes)
+ draw_test_pattern(*p.fb);
+ }
+}
+
static void set_crtcs_n_planes(Card& card, const vector<OutputInfo>& outputs)
{
for (const OutputInfo& o : outputs) {
@@ -594,6 +601,8 @@ int main(int argc, char **argv)
vector<OutputInfo> outputs = setups_to_outputs(card, output_args);
+ draw_test_patterns(outputs);
+
print_outputs(outputs);
set_crtcs_n_planes(card, outputs);