1 #include <kms++/kms++.h> 2 #include <set> 3 #include <string> 4 5 namespace kms 6 { 7 class ResourceManager 8 { 9 public: 10 ResourceManager(Card& card); 11 12 void reset(); 13 card()14 Card& card() const { return m_card; } 15 Connector* reserve_connector(const std::string& name = ""); 16 Connector* reserve_connector(Connector* conn); 17 void release_connector(Connector* conn); 18 Crtc* reserve_crtc(Connector* conn); 19 Crtc* reserve_crtc(Crtc* crtc); 20 void release_crtc(Crtc* crtc); 21 Plane* reserve_plane(Crtc* crtc, PlaneType type, PixelFormat format = PixelFormat::Undefined); 22 Plane* reserve_plane(Plane* plane); 23 Plane* reserve_generic_plane(Crtc* crtc, PixelFormat format = PixelFormat::Undefined); 24 Plane* reserve_primary_plane(Crtc* crtc, PixelFormat format = PixelFormat::Undefined); 25 Plane* reserve_overlay_plane(Crtc* crtc, PixelFormat format = PixelFormat::Undefined); 26 void release_plane(Plane* plane); 27 28 private: 29 Card& m_card; 30 std::set<Connector*> m_reserved_connectors; 31 std::set<Crtc*> m_reserved_crtcs; 32 std::set<Plane*> m_reserved_planes; 33 }; 34 35 } // namespace kms 36