summaryrefslogtreecommitdiff
path: root/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp
diff options
context:
space:
mode:
authorYichi Chen <yichichen@google.com>2022-03-15 07:21:58 +0800
committerYichi Chen <yichichen@google.com>2022-04-08 05:25:15 +0800
commitd767263ad9fb5c93da0864c4311b0ec8a8ab5a08 (patch)
tree37a0edd8f53962bc73562773d3945aff0f0b772d /libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp
parent5fb2b2e3057510c14a68d947552adf3bbdcc90cb (diff)
hwc3: implement VsyncIdle callback for HWC3
The patch creates the new method to register the HWC3 callback function. The corresponding VsyncIdle callback function will be called when idle TE vrefresh is changed in the idle. Bug: 194068871 Test: switch refresh rates, enable panel idle at 60hz Change-Id: I4876fdfd341366ca2012a3ce6704a2c8de5866d2
Diffstat (limited to 'libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp')
-rw-r--r--libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp b/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp
index c3746ef..1836c11 100644
--- a/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp
+++ b/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp
@@ -272,7 +272,7 @@ void ExynosDeviceDrmInterface::ExynosDrmEventHandler::handleTUIEvent() {
constexpr size_t IDLE_ENTER_EVENT_DATA_SIZE = 3;
void ExynosDeviceDrmInterface::ExynosDrmEventHandler::handleIdleEnterEvent(char const *event) {
- /* PANEL_IDLE_ENTER=<display id>,<vrefresh>,<idle te vrefresh> */
+ /* PANEL_IDLE_ENTER=<display index>,<vrefresh>,<idle te vrefresh> */
std::string_view idle_event_str(event);
auto prefix_shift_pos = idle_event_str.find("=");
if (prefix_shift_pos == std::string::npos) {
@@ -280,7 +280,9 @@ void ExynosDeviceDrmInterface::ExynosDrmEventHandler::handleIdleEnterEvent(char
}
int count = 0;
- int value[IDLE_ENTER_EVENT_DATA_SIZE] = {0}; /* display id, vrefresh, idle_te_vrefresh */
+ int value[IDLE_ENTER_EVENT_DATA_SIZE] = {0};
+ const auto &[displayIndex, vrefresh, idleTeVrefresh] = value;
+
auto start_pos = prefix_shift_pos + 1;
auto end_pos = idle_event_str.find(",", start_pos);
while (end_pos != std::string::npos && count < IDLE_ENTER_EVENT_DATA_SIZE) {
@@ -300,12 +302,14 @@ void ExynosDeviceDrmInterface::ExynosDrmEventHandler::handleIdleEnterEvent(char
return;
}
- /* TODO: b/194068871 sending vsyncIdle callback */
- // if (value[1] != value[2])
-
ExynosDisplay *primaryDisplay =
- mExynosDevice->getDisplay(getDisplayId(HWC_DISPLAY_PRIMARY, value[0]));
+ mExynosDevice->getDisplay(getDisplayId(HWC_DISPLAY_PRIMARY, displayIndex));
if (primaryDisplay) {
- primaryDisplay->handleDisplayIdleEnter(value[2]);
+ /* sending vsyncIdle callback */
+ if (vrefresh != idleTeVrefresh) {
+ mExynosDevice->onVsyncIdle(primaryDisplay->getId());
+ }
+
+ primaryDisplay->handleDisplayIdleEnter(idleTeVrefresh);
}
}