summaryrefslogtreecommitdiff
path: root/libkms++/card.h
blob: fb45d04ca79a10b2b609d42fc47852c9832a3688 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once

#include <cstdint>
#include <vector>
#include <map>

#include "decls.h"

namespace kms
{

class Card
{
public:
	Card();
	~Card();

	Card(const Card& other) = delete;
	Card& operator=(const Card& other) = delete;

	int fd() const { return m_fd; }

	Connector* get_first_connected_connector() const;

	DrmObject* get_object(uint32_t id) const;
	Crtc* get_crtc(uint32_t id) const;
	Crtc* get_crtc_by_index(uint32_t idx) const;
	Encoder* get_encoder(uint32_t id) const;
	Property* get_prop(uint32_t id) const;
	Property* get_prop(const char *name) const;

	bool master() const { return m_master; }
	bool has_atomic() const { return m_has_atomic; }

	void print_short() const;

	std::vector<Connector*> get_connectors() const;
	std::vector<DrmObject*> get_objects() const;
	std::vector<Plane*> get_planes() const;

private:
	std::map<uint32_t, DrmObject*> m_obmap;

	int m_fd;
	bool m_master;

	bool m_has_atomic;
};
}