drm_hwcomposer: uses edid DTD to get better estimate of dpi

Edid are not the most reliable when it comes to panel size, however it
seems like preferred DTD are slightly more reliable. This change moves
from the drm parse edid display size to the first preferred DTD to try
improve dpi accuracy.
If no preferred DTD is available we still fallback to the display size.

Change-Id: Ibcc95da9f38ba74e9b95b9d68587b38efbed8de2
signed-off-by: Lucas Berthou <berlu@google.com>
diff --git a/utils/EdidWrapper.h b/utils/EdidWrapper.h
index 30124d7..137e8be 100644
--- a/utils/EdidWrapper.h
+++ b/utils/EdidWrapper.h
@@ -18,6 +18,7 @@
 
 #if HAS_LIBDISPLAY_INFO
 extern "C" {
+#include <libdisplay-info/edid.h>
 #include <libdisplay-info/info.h>
 }
 #endif
@@ -48,6 +49,16 @@
   virtual void GetColorModes(std::vector<Colormode> &color_modes) {
     color_modes.clear();
   };
+  virtual int GetDpiX() {
+    return -1;
+  }
+  virtual int GetDpiY() {
+    return -1;
+  }
+
+  virtual auto GetBoundsMm() -> std::pair<int32_t, int32_t> {
+    return {-1, -1};
+  }
 };
 
 #if HAS_LIBDISPLAY_INFO
@@ -70,10 +81,17 @@
 
   void GetColorModes(std::vector<Colormode> &color_modes) override;
 
+  auto GetDpiX() -> int override;
+  auto GetDpiY() -> int override;
+
+  auto GetBoundsMm() -> std::pair<int32_t, int32_t> override;
+
  private:
   LibdisplayEdidWrapper(di_info *info) : info_(std::move(info)) {
   }
 
+  std::pair<int32_t, int32_t> GetDpi();
+
   di_info *info_{};
 };
 #endif