1 #pragma once
3 #include <vector>
5 #include "drmobject.h"
7 namespace kms
8 {
10 struct ConnectorPriv;
12 struct Videomode
13 {
14 uint32_t clock;
15 uint16_t hdisplay, hsync_start, hsync_end, htotal, hskew;
16 uint16_t vdisplay, vsync_start, vsync_end, vtotal, vscan;
18 uint32_t vrefresh;
20 uint32_t flags;
21 uint32_t type;
22 char name[32]; // XXX
23 };
25 class Connector : public DrmObject
26 {
27 public:
28 Connector(Card& card, uint32_t id, uint32_t idx);
29 ~Connector();
31 void setup();
33 void print_short() const;
35 Videomode get_default_mode() const;
37 Videomode get_mode(const char *mode) const;
39 Crtc* get_current_crtc() const { return m_current_crtc; }
40 std::vector<Crtc*> get_possible_crtcs() const;
42 bool connected() const;
44 private:
45 ConnectorPriv* m_priv;
47 std::string m_fullname;
49 Crtc* m_current_crtc;
50 };
51 }