drm_hwcomposer: Fix EDID fetch from DRM

EDID fetch procedure consist of two steps:
1) get appropriate blob_id
2) fetch EDID blob using blob_id
Those steps should be done sequentially, in
other case drivers can update EDID and blob_id
won't be actual.

Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com>
diff --git a/drm/DrmConnector.cpp b/drm/DrmConnector.cpp
index 8fa47f5..0de0f91 100644
--- a/drm/DrmConnector.cpp
+++ b/drm/DrmConnector.cpp
@@ -58,10 +58,7 @@
     ALOGE("Could not get CRTC_ID property\n");
     return ret;
   }
-  ret = drm_->GetConnectorProperty(*this, "EDID", &edid_property_);
-  if (ret) {
-    ALOGW("Could not get EDID property\n");
-  }
+  ret = UpdateEdidProperty();
   if (writeback()) {
     ret = drm_->GetConnectorProperty(*this, "WRITEBACK_PIXEL_FORMATS",
                                      &writeback_pixel_formats_);
@@ -85,6 +82,30 @@
   return 0;
 }
 
+int DrmConnector::UpdateEdidProperty() {
+  int ret = drm_->GetConnectorProperty(*this, "EDID", &edid_property_);
+  if (ret) {
+    ALOGW("Could not get EDID property\n");
+  }
+  return ret;
+}
+
+int DrmConnector::GetEdidBlob(drmModePropertyBlobPtr &blob) {
+  uint64_t blob_id;
+  int ret = UpdateEdidProperty();
+  if (ret) {
+    return ret;
+  }
+
+  std::tie(ret, blob_id) = edid_property().value();
+  if (ret) {
+    return ret;
+  }
+
+  blob = drmModeGetPropertyBlob(drm_->fd(), blob_id);
+  return 0;
+}
+
 uint32_t DrmConnector::id() const {
   return id_;
 }