composer: add support for advanced offset based wakeup

Add support to get the Display elapse time via. composer HIDL.
This is needed to wait till the specified timestamp is expired
before committing the frame to DRM driver.

Change-Id: Id16965acdc82c858203c6b27fe127e708ad92e33
CRs-Fixed: 2576715
diff --git a/composer/hwc_display.cpp b/composer/hwc_display.cpp
index 20efb7f..d80de31 100644
--- a/composer/hwc_display.cpp
+++ b/composer/hwc_display.cpp
@@ -1582,6 +1582,11 @@
       tone_mapper_->Terminate();
     }
   }
+
+  if (elapse_timestamp_) {
+    layer_stack_.elapse_timestamp = elapse_timestamp_;
+  }
+
   error = display_intf_->Commit(&layer_stack_);
 
   if (error == kErrorNone) {
@@ -2368,6 +2373,11 @@
   return HWC2::Error::None;
 }
 
+HWC2::Error HWCDisplay::SetDisplayElapseTime(uint64_t time) {
+  elapse_timestamp_ = time;
+  return HWC2::Error::None;
+}
+
 bool HWCDisplay::IsDisplayCommandMode() {
   return is_cmd_mode_;
 }