]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/external-libkmsxx.git/blob - libkms++/connector.h
9776be35258c940609c22d6b3d65ce187ce8631e
[android/external-libkmsxx.git] / libkms++ / connector.h
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         Videomode get_default_mode() const;
31         Videomode get_mode(const std::string& mode) const;
33         Crtc* get_current_crtc() const;
34         std::vector<Crtc*> get_possible_crtcs() const;
36         bool connected() const;
38         const std::string& fullname() const { return m_fullname; }
39         uint32_t connector_type() const;
40         uint32_t connector_type_id() const;
41         uint32_t mmWidth() const;
42         uint32_t mmHeight() const;
43         uint32_t subpixel() const;
44         const std::string& subpixel_str() const;
45         std::vector<Videomode> get_modes() const;
46         std::vector<Encoder*> get_encoders() const;
47 private:
48         Connector(Card& card, uint32_t id, uint32_t idx);
49         ~Connector();
51         void setup();
52         void restore_mode();
54         ConnectorPriv* m_priv;
56         std::string m_fullname;
58         Encoder* m_current_encoder;
60         Crtc* m_saved_crtc;
61 };
62 }