summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-14 22:38:29 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-16 21:45:26 +0300
commit511d5934c4ae34db9c9dc4dce746aa8aef0272e1 (patch)
treebeec94e000eea7c7bceef2cf6d682c2ddf2dc696
parent7881bfd6586bd8ffa9b766cdba332c7a1015c9dd (diff)
kmsview: use resman
-rw-r--r--utils/kmsview.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/utils/kmsview.cpp b/utils/kmsview.cpp
index b503f0a..6f236a1 100644
--- a/utils/kmsview.cpp
+++ b/utils/kmsview.cpp
@@ -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)