From 1a651be7a46073b1095a492d497bd089e9242087 Mon Sep 17 00:00:00 2001 From: Matt Hoosier Date: Tue, 12 May 2020 14:49:40 -0500 Subject: 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. --- kms++util/inc/kms++util/resourcemanager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'kms++util/inc') 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; -- cgit v1.2.3