From 0bdc88a432d0b9581606e86e53d686b91def4002 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 28 Sep 2015 17:59:52 +0300 Subject: Add Card::get_connected_pipelines() --- tests/db.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'tests/db.cpp') diff --git a/tests/db.cpp b/tests/db.cpp index 576896e..5df104d 100644 --- a/tests/db.cpp +++ b/tests/db.cpp @@ -84,8 +84,6 @@ public: } } - Crtc* crtc() const { return m_crtc; } - private: Connector* m_connector; Crtc* m_crtc; @@ -106,28 +104,13 @@ int main() vector outputs; - for (auto conn : card.get_connectors()) + for (auto pipe : card.get_connected_pipelines()) { - if (conn->connected() == false) - continue; + auto conn = pipe.connector; + auto crtc = pipe.crtc; auto mode = conn->get_default_mode(); - Crtc* crtc = conn->get_current_crtc(); - if (!crtc) { - for (auto c : conn->get_possible_crtcs()) { - if (find_if(outputs.begin(), outputs.end(), [c](OutputFlipHandler* o) { return o->crtc() == c; }) == outputs.end()) { - crtc = c; - break; - } - } - } - - if (!crtc) { - printf("failed to find crtc\n"); - return -1; - } - auto fb1 = new Framebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); auto fb2 = new Framebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); -- cgit v1.2.3