summaryrefslogtreecommitdiff
path: root/kms++util
diff options
context:
space:
mode:
Diffstat (limited to 'kms++util')
-rw-r--r--kms++util/inc/kms++util/resourcemanager.h3
-rw-r--r--kms++util/src/resourcemanager.cpp15
2 files changed, 18 insertions, 0 deletions
diff --git a/kms++util/inc/kms++util/resourcemanager.h b/kms++util/inc/kms++util/resourcemanager.h
index 1b5cf21..3301da2 100644
--- a/kms++util/inc/kms++util/resourcemanager.h
+++ b/kms++util/inc/kms++util/resourcemanager.h
@@ -14,13 +14,16 @@ public:
Card& card() const { return m_card; }
Connector* reserve_connector(const std::string& name = "");
Connector* reserve_connector(Connector* conn);
+ void release_connector(Connector* conn);
Crtc* reserve_crtc(Connector* conn);
Crtc* reserve_crtc(Crtc* crtc);
+ void release_crtc(Crtc* crtc);
Plane* reserve_plane(Crtc* crtc, PlaneType type, PixelFormat format = PixelFormat::Undefined);
Plane* reserve_plane(Plane* plane);
Plane* reserve_generic_plane(Crtc* crtc, PixelFormat format = PixelFormat::Undefined);
Plane* reserve_primary_plane(Crtc* crtc, PixelFormat format = PixelFormat::Undefined);
Plane* reserve_overlay_plane(Crtc* crtc, PixelFormat format = PixelFormat::Undefined);
+ void release_plane(Plane* plane);
private:
Card& m_card;
diff --git a/kms++util/src/resourcemanager.cpp b/kms++util/src/resourcemanager.cpp
index 9a8a66b..5a9f016 100644
--- a/kms++util/src/resourcemanager.cpp
+++ b/kms++util/src/resourcemanager.cpp
@@ -104,6 +104,11 @@ Connector* ResourceManager::reserve_connector(Connector* conn)
return conn;
}
+void ResourceManager::release_connector(Connector* conn)
+{
+ m_reserved_connectors.erase(conn);
+}
+
Crtc* ResourceManager::reserve_crtc(Connector* conn)
{
if (!conn)
@@ -138,6 +143,11 @@ Crtc* ResourceManager::reserve_crtc(Crtc* crtc)
return crtc;
}
+void ResourceManager::release_crtc(Crtc* crtc)
+{
+ m_reserved_crtcs.erase(crtc);
+}
+
Plane* ResourceManager::reserve_plane(Crtc* crtc, PlaneType type, PixelFormat format)
{
if (!crtc)
@@ -204,3 +214,8 @@ Plane* ResourceManager::reserve_overlay_plane(Crtc* crtc, PixelFormat format)
{
return reserve_plane(crtc, PlaneType::Overlay, format);
}
+
+void ResourceManager::release_plane(Plane* plane)
+{
+ m_reserved_planes.erase(plane);
+}