kmstest: enable display even if crtc doesn't have fb
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 30 Sep 2016 07:19:43 +0000 (10:19 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 30 Sep 2016 07:19:43 +0000 (10:19 +0300)
With atomic modesetting we can enable the crtc without a primary plane.
This allows enabling only a plane on the screen.

Change set_crtcs_n_planes() to allow this.

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

index 5fb46f982aff7854d6d9405ff7612f3ddb76156c..52e4614f9f49f8ea45b223aa520ef9de927aa269 100644 (file)
@@ -670,20 +670,20 @@ static void set_crtcs_n_planes(Card& card, const vector<OutputInfo>& outputs)
                auto conn = o.connector;
                auto crtc = o.crtc;
 
-               if (!o.fbs.empty()) {
-                       auto fb = o.fbs[0];
+               blobs.emplace_back(o.mode.to_blob(card));
+               Blob* mode_blob = blobs.back().get();
 
-                       blobs.emplace_back(o.mode.to_blob(card));
-                       Blob* mode_blob = blobs.back().get();
+               req.add(conn, {
+                               { "CRTC_ID", crtc->id() },
+                       });
 
-                       req.add(conn, {
-                                       { "CRTC_ID", crtc->id() },
-                               });
+               req.add(crtc, {
+                               { "ACTIVE", 1 },
+                               { "MODE_ID", mode_blob->id() },
+                       });
 
-                       req.add(crtc, {
-                                       { "ACTIVE", 1 },
-                                       { "MODE_ID", mode_blob->id() },
-                               });
+               if (!o.fbs.empty()) {
+                       auto fb = o.fbs[0];
 
                        req.add(o.primary_plane, {
                                        { "FB_ID", fb->id() },