summaryrefslogtreecommitdiff
path: root/kms++util/src
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-11-22 10:05:53 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-11-22 12:47:15 +0200
commita4724a1dae7a877ae7bb7082b068bbb12032ff63 (patch)
treeef3264139d2f48c39787d3f692a834da3f8581ea /kms++util/src
parent448dec0fa7e398bff2152f5e01671353af03bc8c (diff)
kmstest: use resman
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)