summaryrefslogtreecommitdiff
path: root/kms++util/inc
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-14 22:20:08 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-16 21:45:26 +0300
commit84d89b1659b6eb3e7707f2fe107b9cada516f053 (patch)
tree8120c41cd8fdeb7f583c2432b5422deb5cd0a30d /kms++util/inc
parent34e63f641195019e903104c8b9e6eb855efeee2c (diff)
add ResourceManager
Diffstat (limited to 'kms++util/inc')
-rw-r--r--kms++util/inc/kms++util/kms++util.h1
-rw-r--r--kms++util/inc/kms++util/resourcemanager.h27
2 files changed, 28 insertions, 0 deletions
diff --git a/kms++util/inc/kms++util/kms++util.h b/kms++util/inc/kms++util/kms++util.h
index ca3c406..10a1f0a 100644
--- a/kms++util/inc/kms++util/kms++util.h
+++ b/kms++util/inc/kms++util/kms++util.h
@@ -8,6 +8,7 @@
#include <kms++util/extcpuframebuffer.h>
#include <kms++util/stopwatch.h>
#include <kms++util/opts.h>
+#include <kms++util/resourcemanager.h>
#include <cstdio>
#include <cstdlib>
diff --git a/kms++util/inc/kms++util/resourcemanager.h b/kms++util/inc/kms++util/resourcemanager.h
new file mode 100644
index 0000000..92e7b93
--- /dev/null
+++ b/kms++util/inc/kms++util/resourcemanager.h
@@ -0,0 +1,27 @@
+#include <kms++/kms++.h>
+#include <vector>
+#include <string>
+
+namespace kms {
+
+class ResourceManager
+{
+public:
+ ResourceManager(Card& card);
+
+ void reset();
+
+ Connector* reserve_connector(const std::string& name = "");
+ Crtc* reserve_crtc(Connector* conn);
+ Plane* reserve_plane(Crtc* crtc, PlaneType type, PixelFormat format = PixelFormat::Undefined);
+ Plane* reserve_primary_plane(Crtc* crtc, PixelFormat format = PixelFormat::Undefined);
+ Plane* reserve_overlay_plane(Crtc* crtc, PixelFormat format = PixelFormat::Undefined);
+
+private:
+ Card& m_card;
+ std::vector<Connector*> m_reserved_connectors;
+ std::vector<Crtc*> m_reserved_crtcs;
+ std::vector<Plane*> m_reserved_planes;
+};
+
+}