kmstest: don't reserve primary_plane if it's not needed
[android/external-libkmsxx.git] / utils / kmstest.cpp
index e9493682e456d4f93c78704a82c39741c0704a50..557c3e56c3b36304b55cba07ec4582f178c01ad1 100644 (file)
@@ -991,9 +991,12 @@ int main(int argc, char **argv)
 
        if (card.has_atomic()) {
                for (OutputInfo& o : outputs) {
+                       if (o.fbs.empty())
+                               continue;
+
                        o.primary_plane = resman.reserve_primary_plane(o.crtc);
 
-                       if (!o.fbs.empty() && !o.primary_plane)
+                       if (!o.primary_plane)
                                EXIT("Could not get primary plane for crtc '%u'", o.crtc->id());
                }
        }