card: add get_crtcs()
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 6 Nov 2015 19:54:15 +0000 (21:54 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 6 Nov 2015 19:59:36 +0000 (21:59 +0200)
libkms++/card.cpp
libkms++/card.h

index 63a068a71953b06590cd2b8f441079054f2eaa07..34dbc3253a0a65417477c6c468035d523e22cf2c 100644 (file)
@@ -182,6 +182,17 @@ vector<Connector*> Card::get_connectors() const
        return v;
 }
 
        return v;
 }
 
+vector<Crtc*> Card::get_crtcs() const
+{
+       vector<Crtc*> v;
+       for(auto pair : m_obmap) {
+               auto p = dynamic_cast<Crtc*>(pair.second);
+               if (p)
+                       v.push_back(p);
+       }
+       return v;
+}
+
 vector<Plane*> Card::get_planes() const
 {
        vector<Plane*> v;
 vector<Plane*> Card::get_planes() const
 {
        vector<Plane*> v;
index f35ba60e47427ae750f9a8e26fdb8acb3360ffb6..dc97703f2d5e18c2845adab9812b820f2ace6748 100644 (file)
@@ -37,6 +37,7 @@ public:
        void print_short() const;
 
        std::vector<Connector*> get_connectors() const;
        void print_short() const;
 
        std::vector<Connector*> get_connectors() const;
+       std::vector<Crtc*> get_crtcs() const;
        std::vector<DrmObject*> get_objects() const;
        std::vector<Plane*> get_planes() const;
 
        std::vector<DrmObject*> get_objects() const;
        std::vector<Plane*> get_planes() const;