OSDN Git Service

drm_hwcomposer: Add connection state to DrmConnector
authorSean Paul <seanpaul@chromium.org>
Mon, 26 Oct 2015 19:36:37 +0000 (15:36 -0400)
committerSean Paul <seanpaul@chromium.org>
Thu, 24 Mar 2016 16:05:49 +0000 (12:05 -0400)
So we can determine if it's connected or not.

BUG=chrome-os-partner:41682
TEST=Tested on ryu with DP

Change-Id: Ie0dadb2737d3a98257fb6e4fa02f17d7dae44f6c
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drmconnector.cpp
drmconnector.h

index 8469c5e..ccb38e2 100644 (file)
@@ -81,6 +81,8 @@ int DrmConnector::UpdateModes() {
     return -ENODEV;
   }
 
+  state_ = c->connection;
+
   std::vector<DrmMode> new_modes;
   for (int i = 0; i < c->count_modes; ++i) {
     bool exists = false;
@@ -126,6 +128,10 @@ void DrmConnector::set_encoder(DrmEncoder *encoder) {
   encoder_ = encoder;
 }
 
+drmModeConnection DrmConnector::state() const {
+  return state_;
+}
+
 uint32_t DrmConnector::mm_width() const {
   return mm_width_;
 }
index 3c9eca0..e1488bb 100644 (file)
@@ -63,6 +63,8 @@ class DrmConnector {
   DrmEncoder *encoder() const;
   void set_encoder(DrmEncoder *encoder);
 
+  drmModeConnection state() const;
+
   uint32_t mm_width() const;
   uint32_t mm_height() const;