summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2015-11-06 22:08:23 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-11-06 22:08:23 +0200
commite398869b2b41e15fcc70e409f59233a0b3ea7189 (patch)
tree7fca546a9eb5d9a628a2866a40a75cc5e5e1d4da
parentf19497eb25de28d76cdbd425134e925e295c9468 (diff)
card: collect obs to vectors
-rw-r--r--libkms++/card.cpp23
-rw-r--r--libkms++/card.h6
2 files changed, 23 insertions, 6 deletions
diff --git a/libkms++/card.cpp b/libkms++/card.cpp
index 2852f4a..3aaa8a6 100644
--- a/libkms++/card.cpp
+++ b/libkms++/card.cpp
@@ -60,17 +60,23 @@ Card::Card()
for (int i = 0; i < res->count_connectors; ++i) {
uint32_t id = res->connectors[i];
- m_obmap[id] = new Connector(*this, id, i);
+ auto ob = new Connector(*this, id, i);
+ m_obmap[id] = ob;
+ m_connectors.push_back(ob);
}
for (int i = 0; i < res->count_crtcs; ++i) {
uint32_t id = res->crtcs[i];
- m_obmap[id] = new Crtc(*this, id, i);
+ auto ob = new Crtc(*this, id, i);
+ m_obmap[id] = ob;
+ m_crtcs.push_back(ob);
}
for (int i = 0; i < res->count_encoders; ++i) {
uint32_t id = res->encoders[i];
- m_obmap[id] = new Encoder(*this, id);
+ auto ob = new Encoder(*this, id);
+ m_obmap[id] = ob;
+ m_encoders.push_back(ob);
}
drmModeFreeResources(res);
@@ -79,7 +85,9 @@ Card::Card()
for (uint i = 0; i < planeRes->count_planes; ++i) {
uint32_t id = planeRes->planes[i];
- m_obmap[id] = new Plane(*this, id);
+ auto ob = new Plane(*this, id);
+ m_obmap[id] = ob;
+ m_planes.push_back(ob);
}
drmModeFreePlaneResources(planeRes);
@@ -94,8 +102,11 @@ Card::Card()
for (unsigned i = 0; i < props->count_props; ++i) {
uint32_t prop_id = props->props[i];
- if (m_obmap.find(prop_id) == m_obmap.end())
- m_obmap[prop_id] = new Property(*this, prop_id);
+ if (m_obmap.find(prop_id) == m_obmap.end()) {
+ auto ob = new Property(*this, prop_id);
+ m_obmap[prop_id] = ob;
+ m_properties.push_back(ob);
+ }
}
drmModeFreeObjectProperties(props);
diff --git a/libkms++/card.h b/libkms++/card.h
index ea84081..25261be 100644
--- a/libkms++/card.h
+++ b/libkms++/card.h
@@ -51,6 +51,12 @@ private:
std::map<uint32_t, DrmObject*> m_obmap;
+ std::vector<Connector*> m_connectors;
+ std::vector<Encoder*> m_encoders;
+ std::vector<Crtc*> m_crtcs;
+ std::vector<Plane*> m_planes;
+ std::vector<Property*> m_properties;
+
int m_fd;
bool m_master;