kmstest: use resman to get primary planes
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 12 Dec 2016 10:26:26 +0000 (12:26 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 12 Dec 2016 10:26:28 +0000 (12:26 +0200)
We need to ensure that a primary plane is not already in use.
ResourceManager does this for us.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
utils/kmstest.cpp

index 43cb55741510da40dc4f7231eef53faf15bdeaed..3a98468530c0f37089b25dc9163b5d74d7b65034 100644 (file)
@@ -939,9 +939,11 @@ int main(int argc, char **argv)
 
        vector<OutputInfo> outputs = setups_to_outputs(card, output_args);
 
+       ResourceManager resman(card);
+
        if (card.has_atomic()) {
                for (OutputInfo& o : outputs) {
-                       o.primary_plane = o.crtc->get_primary_plane();
+                       o.primary_plane = resman.reserve_primary_plane(o.crtc);
 
                        if (!o.fbs.empty() && !o.primary_plane)
                                EXIT("Could not get primary plane for crtc '%u'", o.crtc->id());