#include <errno.h>
#include <stdint.h>
+#include <array>
+#include <sstream>
+
#include <log/log.h>
#include <xf86drmMode.h>
encoder_(current_encoder),
display_(-1),
type_(c->connector_type),
+ type_id_(c->connector_type_id),
state_(c->connection),
mm_width_(c->mmWidth),
mm_height_(c->mmHeight),
return internal() || external() || writeback();
}
+std::string DrmConnector::name() const {
+ constexpr std::array names = {"None", "VGA", "DVI-I", "DVI-D",
+ "DVI-A", "Composite", "SVIDEO", "LVDS",
+ "Component", "DIN", "DP", "HDMI-A",
+ "HDMI-B", "TV", "eDP", "Virtual",
+ "DSI"};
+
+ std::ostringstream name_buf;
+ name_buf << names[type_] << "-" << type_id_;
+ return name_buf.str();
+}
+
int DrmConnector::UpdateModes() {
int fd = drm_->fd();
#include <stdint.h>
#include <xf86drmMode.h>
+#include <string>
#include <vector>
namespace android {
bool writeback() const;
bool valid_type() const;
+ std::string name() const;
+
int UpdateModes();
const std::vector<DrmMode> &modes() const {
int display_;
uint32_t type_;
+ uint32_t type_id_;
drmModeConnection state_;
uint32_t mm_width_;