summaryrefslogtreecommitdiff
path: root/services/displayservice/DisplayEventReceiver.cpp
diff options
context:
space:
mode:
author Manasi Navare <navaremanasi@google.com> 2025-01-31 00:12:06 +0000
committer Manasi Navare <navaremanasi@google.com> 2025-02-06 11:47:25 -0800
commit4759f605384c5739a0223f4db16347b91cb8388b (patch)
treec0220ee1a748e1cb507c6f2b6aef65577a4a9814 /services/displayservice/DisplayEventReceiver.cpp
parent6cd42cbdc70e768c8f4b28f111c1b3efac41b823 (diff)
SF: Fix dispatch of DISPLAY_EVENT_MODE_REJECTION
The onModeRejected() callback was not getting dispatched correctly from SF to DM because of the missing case for this display event in EventThread.cpp, so add that. While at it, make the Display Event Types enum an enum class so that the compiler will complain for any missing cases. Do the necessary refactor in other files for this. Bug: 393133868 Test: m surfaceflinger, End to End testing forcing Display config failure in DRM HWC and checking that the correct failure and is propagated from DRM HWC to SF and received in DM Flag: com.android.graphics.surfaceflinger.flags.display_config_error_hal Change-Id: I63914a3555466bc6c382ab1bf9ed57eb5eef7cd0 Signed-off-by: Manasi Navare <navaremanasi@google.com>
Diffstat (limited to 'services/displayservice/DisplayEventReceiver.cpp')
-rw-r--r--services/displayservice/DisplayEventReceiver.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/services/displayservice/DisplayEventReceiver.cpp b/services/displayservice/DisplayEventReceiver.cpp
index 2bb74c2cad..9927fb66d3 100644
--- a/services/displayservice/DisplayEventReceiver.cpp
+++ b/services/displayservice/DisplayEventReceiver.cpp
@@ -22,6 +22,7 @@
#include <android/frameworks/displayservice/1.0/BpHwEventCallback.h>
#include <thread>
+#include <ftl/enum.h>
namespace android {
namespace frameworks {
@@ -97,11 +98,11 @@ int DisplayEventReceiver::AttachedEvent::handleEvent(int fd, int events, void* /
for (size_t i = 0; i < static_cast<size_t>(n); ++i) {
const FwkReceiver::Event &event = buf[i];
- uint32_t type = event.header.type;
+ android::DisplayEventType type = event.header.type;
uint64_t timestamp = event.header.timestamp;
switch(buf[i].header.type) {
- case FwkReceiver::DISPLAY_EVENT_VSYNC: {
+ case DisplayEventType::DISPLAY_EVENT_VSYNC: {
auto ret = mCallback->onVsync(timestamp, event.vsync.count);
if (!ret.isOk()) {
LOG(ERROR) << "AttachedEvent handleEvent fails on onVsync callback"
@@ -109,7 +110,7 @@ int DisplayEventReceiver::AttachedEvent::handleEvent(int fd, int events, void* /
return 0; // remove the callback
}
} break;
- case FwkReceiver::DISPLAY_EVENT_HOTPLUG: {
+ case DisplayEventType::DISPLAY_EVENT_HOTPLUG: {
auto ret = mCallback->onHotplug(timestamp, event.hotplug.connected);
if (!ret.isOk()) {
LOG(ERROR) << "AttachedEvent handleEvent fails on onHotplug callback"
@@ -118,7 +119,8 @@ int DisplayEventReceiver::AttachedEvent::handleEvent(int fd, int events, void* /
}
} break;
default: {
- LOG(ERROR) << "AttachedEvent handleEvent unknown type: " << type;
+ LOG(ERROR) << "AttachedEvent handleEvent unknown type: "
+ << ftl::to_underlying(type);
}
}
}