summaryrefslogtreecommitdiff
path: root/kms++util/src
diff options
context:
space:
mode:
authorMatt Hoosier <matt.hoosier@garmin.com>2020-05-12 14:49:40 -0500
committerMatt Hoosier <matt.hoosier@garmin.com>2020-05-15 08:07:26 -0500
commit1a651be7a46073b1095a492d497bd089e9242087 (patch)
tree97e5323de13622552b0048f3073bc2782408d8c8 /kms++util/src
parent4091a630137400dfac389215a7ec8c43b191ec5f (diff)
resmgr: add release() methods
This makes the ResourceManager class much more functional for uses where the set of resources used to scan out a scene changes from frame to frame. The atomic modesetting API discipline requires a brute-force search to find a compatible pairing of planes/etc, and being able to reserve bits incrementally is much simpler than throwing out the entire resourcemanager and make a new one each time a resource reserved in a tentative attempt to probe its compatibility with an test-mode atomic commit, turns out not to pan out.
Diffstat (limited to 'kms++util/src')
-rw-r--r--kms++util/src/resourcemanager.cpp15
1 files changed, 15 insertions, 0 deletions
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);
+}