summaryrefslogtreecommitdiff
path: root/kms++util/inc/kms++util/resourcemanager.h
blob: 42e50001de6be3c2386e6cf142d29e608f2d5dee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <kms++/kms++.h>
#include <vector>
#include <string>

namespace kms {

class ResourceManager
{
public:
	ResourceManager(Card& card);

	void reset();

	Card& card() const { return m_card; }
	Connector* reserve_connector(const std::string& name = "");
	Crtc* reserve_crtc(Connector* conn);
	Plane* reserve_plane(Crtc* crtc, PlaneType type, PixelFormat format = PixelFormat::Undefined);
	Plane* reserve_primary_plane(Crtc* crtc, PixelFormat format = PixelFormat::Undefined);
	Plane* reserve_overlay_plane(Crtc* crtc, PixelFormat format = PixelFormat::Undefined);

private:
	Card& m_card;
	std::vector<Connector*> m_reserved_connectors;
	std::vector<Crtc*> m_reserved_crtcs;
	std::vector<Plane*> m_reserved_planes;
};

}