summaryrefslogtreecommitdiff
path: root/kms++util/src
diff options
context:
space:
mode:
Diffstat (limited to 'kms++util/src')
-rw-r--r--kms++util/src/resourcemanager.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/kms++util/src/resourcemanager.cpp b/kms++util/src/resourcemanager.cpp
index c4bf7f8..465d817 100644
--- a/kms++util/src/resourcemanager.cpp
+++ b/kms++util/src/resourcemanager.cpp
@@ -132,6 +132,19 @@ Crtc* ResourceManager::reserve_crtc(Connector* conn)
return nullptr;
}
+Crtc* ResourceManager::reserve_crtc(Crtc* crtc)
+{
+ if (!crtc)
+ return nullptr;
+
+ if (contains(m_reserved_crtcs, crtc))
+ return nullptr;
+
+ m_reserved_crtcs.push_back(crtc);
+
+ return crtc;
+}
+
Plane* ResourceManager::reserve_plane(Crtc* crtc, PlaneType type, PixelFormat format)
{
if (!crtc)
@@ -154,6 +167,19 @@ Plane* ResourceManager::reserve_plane(Crtc* crtc, PlaneType type, PixelFormat fo
return nullptr;
}
+Plane* ResourceManager::reserve_plane(Plane* plane)
+{
+ if (!plane)
+ return nullptr;
+
+ if (contains(m_reserved_planes, plane))
+ return nullptr;
+
+ m_reserved_planes.push_back(plane);
+
+ return plane;
+}
+
Plane* ResourceManager::reserve_generic_plane(Crtc* crtc, PixelFormat format)
{
if (!crtc)