From 9cc83934f92aab292f16213c1b716e8ecfcb5875 Mon Sep 17 00:00:00 2001 From: Adrian Salido Date: Mon, 21 Aug 2017 16:14:57 -0700 Subject: DO NOT MERGE: revert HWC2 changes The changes are causing some issues with multi-window use cases. Fixes: 64491794 Test: test gmail compose in multi-window + show taps enabled Change-Id: I0b0a3f351ed48f81db89a71c78bf17bab8cb2acf Signed-off-by: Adrian Salido --- vsyncworker.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'vsyncworker.cpp') diff --git a/vsyncworker.cpp b/vsyncworker.cpp index 2177521..ee140cb 100644 --- a/vsyncworker.cpp +++ b/vsyncworker.cpp @@ -34,6 +34,7 @@ namespace android { VSyncWorker::VSyncWorker() : Worker("vsync", HAL_PRIORITY_URGENT_DISPLAY), drm_(NULL), + procs_(NULL), display_(-1), last_timestamp_(-1) { } @@ -48,9 +49,9 @@ int VSyncWorker::Init(DrmResources *drm, int display) { return InitWorker(); } -void VSyncWorker::RegisterCallback(std::shared_ptr callback) { +void VSyncWorker::SetProcs(hwc_procs_t const *procs) { Lock(); - callback_ = callback; + procs_ = procs; Unlock(); } @@ -125,8 +126,7 @@ void VSyncWorker::Routine() { bool enabled = enabled_; int display = display_; - std::shared_ptr callback(callback_); - + hwc_procs_t const *procs = procs_; Unlock(); if (!enabled) @@ -159,16 +159,16 @@ void VSyncWorker::Routine() { } /* - * There's a race here where a change in callback_ will not take effect until + * There's a race here where a change in procs_ will not take effect until * the next subsequent requested vsync. This is unavoidable since we can't * call the vsync hook while holding the thread lock. * - * We could shorten the race window by caching callback_ right before calling - * the hook. However, in practice, callback_ is only updated once, so it's not + * We could shorten the race window by caching procs_ right before calling + * the hook. However, in practice, procs_ is only updated once, so it's not * worth the overhead. */ - if (callback) - callback->Callback(display, timestamp); + if (procs && procs->vsync) + procs->vsync(procs, display, timestamp); last_timestamp_ = timestamp; } } -- cgit v1.2.3