diff options
author | HyunKyung Kim <hk310.kim@samsung.com> | 2020-12-14 19:38:00 +0900 |
---|---|---|
committer | Long Ling <longling@google.com> | 2021-07-01 12:07:13 -0700 |
commit | 44b3cf1bc4c843d06f31e60b6819dea36251aa56 (patch) | |
tree | c289c3bd93a5199eb7b1852f59213e0164a00c27 /libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp | |
parent | 5407c19e7dc61b2216559c65e8fb9bf6047e5082 (diff) |
libhwc2.1: Handle TUI events
This patch refreshes frame or skipes frame update
when tui event is generated.
Bug: 157272869
Signed-off-by: HyunKyung Kim <hk310.kim@samsung.com>
Change-Id: I92affee60d02d8570378e2f2275ccd0a46b063ec
Diffstat (limited to 'libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp')
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp b/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp index f0caf47..21b7f92 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp +++ b/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp @@ -71,6 +71,7 @@ ExynosDeviceDrmInterface::ExynosDeviceDrmInterface(ExynosDevice *exynosDevice) ExynosDeviceDrmInterface::~ExynosDeviceDrmInterface() { mDrmDevice->event_listener()->UnRegisterHotplugHandler(static_cast<DrmEventHandler *>(&mExynosDrmEventHandler)); + mDrmDevice->event_listener()->UnRegisterTUIHandler(static_cast<DrmTUIEventHandler *>(&mExynosDrmEventHandler)); } void ExynosDeviceDrmInterface::init(ExynosDevice *exynosDevice) @@ -83,8 +84,14 @@ void ExynosDeviceDrmInterface::init(ExynosDevice *exynosDevice) updateRestrictions(); - mExynosDrmEventHandler.init(mExynosDevice); + mExynosDrmEventHandler.init(mExynosDevice, mDrmDevice); mDrmDevice->event_listener()->RegisterHotplugHandler(static_cast<DrmEventHandler *>(&mExynosDrmEventHandler)); + mDrmDevice->event_listener()->RegisterTUIHandler(static_cast<DrmTUIEventHandler *>(&mExynosDrmEventHandler)); + + if (mDrmDevice->event_listener()->IsDrmInTUI()) { + mExynosDevice->enterToTUI(); + ALOGD("%s:: device is already in TUI", __func__); + } } int32_t ExynosDeviceDrmInterface::initDisplayInterface( @@ -187,9 +194,10 @@ void ExynosDeviceDrmInterface::updateRestrictions() } } -void ExynosDeviceDrmInterface::ExynosDrmEventHandler::init(ExynosDevice *exynosDevice) +void ExynosDeviceDrmInterface::ExynosDrmEventHandler::init(ExynosDevice *exynosDevice, DrmDevice *drmDevice) { mExynosDevice = exynosDevice; + mDrmDevice = drmDevice; } void ExynosDeviceDrmInterface::ExynosDrmEventHandler::HandleEvent(uint64_t timestamp_us) @@ -220,3 +228,21 @@ void ExynosDeviceDrmInterface::ExynosDrmEventHandler::HandleEvent(uint64_t times if (display != NULL) display->handleHotplugEvent(); } + +void ExynosDeviceDrmInterface::ExynosDrmEventHandler::HandleTUIEvent() +{ + if (mDrmDevice->event_listener()->IsDrmInTUI()) { + /* Received TUI Enter event */ + if (!mExynosDevice->isInTUI()) { + mExynosDevice->enterToTUI(); + ALOGV("%s:: DRM device in TUI", __func__); + } + } else { + /* Received TUI Exit event */ + if (mExynosDevice->isInTUI()) { + mExynosDevice->invalidate(); + mExynosDevice->exitFromTUI(); + ALOGV("%s:: DRM device out TUI", __func__); + } + } +} |