summaryrefslogtreecommitdiff
path: root/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp
diff options
context:
space:
mode:
authorsusi_su <susisu@google.com>2022-08-18 21:42:26 +0800
committersusi_su <susisu@google.com>2022-09-13 21:51:11 +0800
commit7f28726597aa232277afd8c075e4e7f6b144e82c (patch)
tree8082d4be1aa0f66b56cef49a5a7b668e36dcc990 /libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp
parentcb3b7ad1cf51ce40161c88d982da5c359e77f633 (diff)
libhwc2.1: handling histogram events from different display
use crtc_id to tell which display histogram event handling should be called Bug: 238830432 Test: local verified with an aidl_hist_client on an F10 proto1.0, sampling histogram concurrently, and check the readback histogram data Change-Id: Ic67f25bbf557f024e8e89b5ad43a0d510071c7e2
Diffstat (limited to 'libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp')
-rw-r--r--libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp b/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp
index 1df6fe9..0437bbb 100644
--- a/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp
+++ b/libhwc2.1/libdisplayinterface/ExynosDeviceDrmInterface.cpp
@@ -236,12 +236,19 @@ void ExynosDeviceDrmInterface::ExynosDrmEventHandler::handleEvent(uint64_t times
display->handleHotplugEvent();
}
-void ExynosDeviceDrmInterface::ExynosDrmEventHandler::handleHistogramEvent(void *bin) {
- ExynosDisplay *primaryDisplay = mExynosDevice->getDisplay(HWC_DISPLAY_PRIMARY);
- if (primaryDisplay != NULL) {
- ExynosDisplayDrmInterface *displayInterface =
- static_cast<ExynosDisplayDrmInterface *>(primaryDisplay->mDisplayInterface.get());
- displayInterface->setHistogramData(bin);
+void ExynosDeviceDrmInterface::ExynosDrmEventHandler::handleHistogramEvent(uint32_t crtc_id,
+ void *bin) {
+ ExynosDisplayDrmInterface *displayInterface;
+ DrmProperty crtc;
+ uint32_t id;
+
+ for (auto display : mExynosDevice->mDisplays) {
+ displayInterface =
+ static_cast<ExynosDisplayDrmInterface *>(display->mDisplayInterface.get());
+ id = displayInterface->getCrtcId();
+ if (id == crtc_id) {
+ displayInterface->setHistogramData(bin);
+ }
}
}