aboutsummaryrefslogtreecommitdiff
path: root/drm/VSyncWorker.h
diff options
context:
space:
mode:
authorRoman Stratiienko <r.stratiienko@gmail.com>2020-09-26 02:08:41 +0300
committerRoman Stratiienko <r.stratiienko@gmail.com>2020-09-28 15:21:29 +0300
commit2370109af70b31937b44c663ab4882d2c74fbc53 (patch)
treeba84eeffc4bd094f9cddb5179a039c331691aece /drm/VSyncWorker.h
parent25ddbc44acfbe6d53439deb68e0f92b5809b5738 (diff)
downloaddrm_hwcomposer-2370109af70b31937b44c663ab4882d2c74fbc53.tar.gz
drm_hwcomposer: Fix RegisterCallback() function
- Fixes segfault during client switch. - Allows to run VTS on Android-11. VTS Results: ============================================ arm64-v8a VtsHalGraphicsComposerV2_1TargetTest: [53 tests / 42808 msec] armeabi-v7a VtsHalGraphicsComposerV2_1TargetTest: [53 tests / 33353 msec] =============== Summary =============== 2/2 modules completed Total Tests : 106 PASSED : 106 FAILED : 0 ============================================ Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Diffstat (limited to 'drm/VSyncWorker.h')
-rw-r--r--drm/VSyncWorker.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drm/VSyncWorker.h b/drm/VSyncWorker.h
index 0121a6c..7454b51 100644
--- a/drm/VSyncWorker.h
+++ b/drm/VSyncWorker.h
@@ -19,6 +19,7 @@
#include <hardware/hardware.h>
#include <hardware/hwcomposer.h>
+#include <hardware/hwcomposer2.h>
#include <stdint.h>
#include <map>
@@ -42,6 +43,8 @@ class VSyncWorker : public Worker {
int Init(DrmDevice *drm, int display);
void RegisterCallback(std::shared_ptr<VsyncCallback> callback);
+ void RegisterClientCallback(hwc2_callback_data_t data,
+ hwc2_function_pointer_t hook);
void VSyncControl(bool enabled);
@@ -62,6 +65,9 @@ class VSyncWorker : public Worker {
int display_;
std::atomic_bool enabled_;
int64_t last_timestamp_;
+
+ hwc2_callback_data_t vsync_callback_data_ = NULL;
+ HWC2_PFN_VSYNC vsync_callback_hook_ = NULL;
};
} // namespace android