summaryrefslogtreecommitdiff
path: root/utils/kmsview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/kmsview.cpp')
-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)