summaryrefslogtreecommitdiff
path: root/libkms++/connector.h
blob: cc04d522279e91941922c7e95ebdf0ce5193a95f (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
50
51
#pragma once

#include <vector>

#include "drmobject.h"
#include "videomode.h"

namespace kms
{

struct ConnectorPriv;

class Connector : public DrmObject
{
	friend class Card;
public:
	Videomode get_default_mode() const;

	Videomode get_mode(const std::string& mode) const;
	Videomode get_mode(unsigned xres, unsigned yres, unsigned refresh) const;

	Crtc* get_current_crtc() const;
	std::vector<Crtc*> get_possible_crtcs() const;

	bool connected() const;

	const std::string& fullname() const { return m_fullname; }
	uint32_t connector_type() const;
	uint32_t connector_type_id() const;
	uint32_t mmWidth() const;
	uint32_t mmHeight() const;
	uint32_t subpixel() const;
	const std::string& subpixel_str() const;
	std::vector<Videomode> get_modes() const;
	std::vector<Encoder*> get_encoders() const;
private:
	Connector(Card& card, uint32_t id, uint32_t idx);
	~Connector();

	void setup();
	void restore_mode();

	ConnectorPriv* m_priv;

	std::string m_fullname;

	Encoder* m_current_encoder;

	Crtc* m_saved_crtc;
};
}