aboutsummaryrefslogtreecommitdiff
path: root/vsyncworker.cpp
diff options
context:
space:
mode:
authorAdrian Salido <salidoa@google.com>2017-08-21 16:14:57 -0700
committerAdrian Salido <salidoa@google.com>2017-08-21 16:44:39 -0700
commit9cc83934f92aab292f16213c1b716e8ecfcb5875 (patch)
tree5f78eeca0ef448297762e0cf9e3b84fe93e25557 /vsyncworker.cpp
parent2827209f7801a9c1eb272075f8b8b0f80c663d31 (diff)
downloaddrm_hwcomposer-9cc83934f92aab292f16213c1b716e8ecfcb5875.tar.gz
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 <salidoa@google.com>
Diffstat (limited to 'vsyncworker.cpp')
-rw-r--r--vsyncworker.cpp18
1 files changed, 9 insertions, 9 deletions
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<VsyncCallback> 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<VsyncCallback> 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;
}
}