summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJyri Sarha <jsarha@ti.com>2015-10-20 16:47:46 +0300
committerJyri Sarha <jsarha@ti.com>2015-10-20 19:18:32 +0300
commit66429ef50279f0085d5637ceca7dae57bca5e981 (patch)
treebfd5ddb51be718091e064115cc77f6e3dabb00d4
parent18ba50b6b24b75bc23346cf232e01ec47b050f81 (diff)
libkms++/encoder: Add methods for getting details of the DRM object
-rw-r--r--libkms++/encoder.cpp18
-rw-r--r--libkms++/encoder.h1
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();