diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-05-27 15:11:33 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-05-30 13:52:34 +0300 |
commit | b6cdf7f9b75d27bb151c6dd49882eed9509515ac (patch) | |
tree | d152d6c41f52c3a14d70db885d8b3124e254d205 /utils | |
parent | e35a2ad5dca78273455001181b67858831d1333c (diff) |
testpat: get primary plane
Diffstat (limited to 'utils')
-rw-r--r-- | utils/testpat.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/utils/testpat.cpp b/utils/testpat.cpp index 5f1095c..919774f 100644 --- a/utils/testpat.cpp +++ b/utils/testpat.cpp @@ -30,6 +30,7 @@ struct OutputInfo Connector* connector; Crtc* crtc; + Plane* primary_plane; Videomode mode; bool user_set_crtc; vector<DumbFramebuffer*> fbs; @@ -552,7 +553,10 @@ static void print_outputs(const vector<OutputInfo>& outputs) printf("Connector %u/@%u: %s\n", o.connector->id(), o.connector->idx(), o.connector->fullname().c_str()); - printf(" Crtc %u/@%u: %ux%u-%u (%s)\n", o.crtc->id(), o.crtc->idx(), + printf(" Crtc %u/@%u", o.crtc->id(), o.crtc->idx()); + if (o.primary_plane) + printf(" (plane %u/@%u)", o.primary_plane->id(), o.primary_plane->idx()); + printf(": %ux%u-%u (%s)\n", o.mode.hdisplay, o.mode.vdisplay, o.mode.vrefresh, videomode_to_string(o.mode).c_str()); if (!o.fbs.empty()) { @@ -618,6 +622,15 @@ int main(int argc, char **argv) vector<OutputInfo> outputs = setups_to_outputs(card, output_args); + if (card.has_atomic()) { + for (OutputInfo& o : outputs) { + o.primary_plane = o.crtc->get_primary_plane(); + + if (!o.fbs.empty() && !o.primary_plane) + EXIT("Could not get primary plane for crtc '%u'", o.crtc->id()); + } + } + draw_test_patterns(outputs); print_outputs(outputs); |