56ac3152721c754a88856db1894fc850b19116ee
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 friend class Card;
28 public:
29 void print_short() const;
31 Videomode get_default_mode() const;
33 Videomode get_mode(const std::string& mode) const;
35 Crtc* get_current_crtc() const { return m_current_crtc; }
36 std::vector<Crtc*> get_possible_crtcs() const;
38 bool connected() const;
40 private:
41 Connector(Card& card, uint32_t id, uint32_t idx);
42 ~Connector();
44 void setup();
45 void restore_mode();
47 ConnectorPriv* m_priv;
49 std::string m_fullname;
51 Crtc* m_current_crtc;
53 Crtc* m_saved_crtc;
54 };
55 }