drm_hwcomposer: Add VSyncWorker::GetNextVsyncTimestamp

Add a function to approximate when the next vsync after a given
timestamp will be.

This can be used to support expectedPresentTime functionality to
determine if a pending property set should be committed immediately or
for a future vsync.

Change-Id: I6b1f0182d3416b0ffa361f54e6695b2894eb842a
Signed-off-by: Drew Davenport <ddavenport@google.com>
diff --git a/drm/VSyncWorker.cpp b/drm/VSyncWorker.cpp
index 7ec1c28..4b08515 100644
--- a/drm/VSyncWorker.cpp
+++ b/drm/VSyncWorker.cpp
@@ -84,6 +84,11 @@
   return last_timestamp_is_fresh_ ? last_timestamp_.value_or(0) : 0;
 }
 
+int64_t VSyncWorker::GetNextVsyncTimestamp(int64_t time) {
+  const std::lock_guard<std::mutex> lock(mutex_);
+  return GetPhasedVSync(vsync_period_ns_, time);
+}
+
 void VSyncWorker::SetTimestampCallback(
     std::optional<VsyncTimestampCallback> &&callback) {
   {