]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/external-libkmsxx.git/commitdiff
kmsview: use resman
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 14 Jun 2016 19:38:29 +0000 (22:38 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 16 Jun 2016 18:45:26 +0000 (21:45 +0300)
utils/kmsview.cpp

index b503f0a0ecfc6fe91ae9533712993fda07952502..6f236a11254e446bc20a5ceeffccf83bcaf9dc1b 100644 (file)
@@ -79,27 +79,14 @@ int main(int argc, char** argv)
 
 
        Card card(dev_path);
+       ResourceManager res(card);
 
-       auto conn = card.get_first_connected_connector();
-       auto crtc = conn->get_current_crtc();
-
-       auto fb = new DumbFramebuffer(card, w, h, pixfmt);
-
-       Plane* plane = 0;
-
-       for (Plane* p : crtc->get_possible_planes()) {
-               if (p->plane_type() != PlaneType::Overlay)
-                       continue;
-
-               if (!p->supports_format(pixfmt))
-                       continue;
-
-               plane = p;
-               break;
-       }
-
+       auto conn = res.reserve_connector();
+       auto crtc = res.reserve_crtc(conn);
+       auto plane = res.reserve_overlay_plane(crtc, pixfmt);
        FAIL_IF(!plane, "available plane not found");
 
+       auto fb = new DumbFramebuffer(card, w, h, pixfmt);
 
        unsigned frame_size = 0;
        for (unsigned i = 0; i < fb->num_planes(); ++i)