diff options
Diffstat (limited to 'libkms++')
-rw-r--r-- | libkms++/encoder.cpp | 18 | ||||
-rw-r--r-- | libkms++/encoder.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/libkms++/encoder.cpp b/libkms++/encoder.cpp index 81eba71..6f79e4f 100644 --- a/libkms++/encoder.cpp +++ b/libkms++/encoder.cpp @@ -18,6 +18,18 @@ struct EncoderPriv drmModeEncoderPtr drm_encoder; }; +static const map<int, string> encoder_types = { +#define DEF_ENC(c) { DRM_MODE_ENCODER_##c, #c } + DEF_ENC(NONE), + DEF_ENC(DAC), + DEF_ENC(TMDS), + DEF_ENC(LVDS), + DEF_ENC(TVDAC), + DEF_ENC(VIRTUAL), + DEF_ENC(DSI), +#undef DEF_ENC +}; + Encoder::Encoder(Card &card, uint32_t id) :DrmObject(card, id, DRM_MODE_OBJECT_ENCODER) { @@ -63,4 +75,10 @@ vector<Crtc*> Encoder::get_possible_crtcs() const return crtcs; } + +const string& Encoder::get_encoder_type() const +{ + return encoder_types.at(m_priv->drm_encoder->encoder_type); +} + } diff --git a/libkms++/encoder.h b/libkms++/encoder.h index 77e4e3e..609e136 100644 --- a/libkms++/encoder.h +++ b/libkms++/encoder.h @@ -17,6 +17,7 @@ public: Crtc* get_crtc() const; std::vector<Crtc*> get_possible_crtcs() const; + const std::string& get_encoder_type() const; private: Encoder(Card& card, uint32_t id); ~Encoder(); |