1 #pragma once 2 3 #include <vector> 4 5 #include "drmpropobject.h" 6 #include "videomode.h" 7 8 namespace kms 9 { 10 11 struct ConnectorPriv; 12 13 class Connector : public DrmPropObject 14 { 15 friend class Card; 16 public: 17 void refresh(); 18 19 Videomode get_default_mode() const; 20 21 Videomode get_mode(const std::string& mode) const; 22 Videomode get_mode(unsigned xres, unsigned yres, float vrefresh, bool ilace) const; 23 24 Crtc* get_current_crtc() const; 25 std::vector<Crtc*> get_possible_crtcs() const; 26 27 bool connected() const; 28 fullname()29 const std::string& fullname() const { return m_fullname; } 30 uint32_t connector_type() const; 31 uint32_t connector_type_id() const; 32 uint32_t mmWidth() const; 33 uint32_t mmHeight() const; 34 uint32_t subpixel() const; 35 const std::string& subpixel_str() const; 36 std::vector<Videomode> get_modes() const; 37 std::vector<Encoder*> get_encoders() const; 38 private: 39 Connector(Card& card, uint32_t id, uint32_t idx); 40 ~Connector(); 41 42 void setup(); 43 void restore_mode(); 44 45 ConnectorPriv* m_priv; 46 47 std::string m_fullname; 48 49 Encoder* m_current_encoder; 50 51 Crtc* m_saved_crtc; 52 }; 53 } 54