summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ady Abraham <adyabr@google.com> 2022-02-18 17:11:59 -0800
committer Ady Abraham <adyabr@google.com> 2022-02-22 02:54:41 +0000
commitc4acf5130b3b226e66d2d9b7dd70d42c8244b6fa (patch)
treeb12817b31baa33c2288db6d85c6cf083864601db
parent1648aa42cf7c2dd127ca886e4916a4db1af240e9 (diff)
SF: remove IComposer.dumpDebugInfo
aidl already have a dump funciton, so there is no need to expose a custom dumpDebugInfo from IComposer. Bug: 220171623 Test: atest VtsHalGraphicsComposer3_TargetTest Test: adb shell dumpsys SurfaceFlinger Test: adb shell dumpsys android.hardware.graphics.composer3.IComposer/default Change-Id: Ifaf91e74b01230c5926fc43619cada80deaa1630
-rw-r--r--services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp25
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp2
2 files changed, 21 insertions, 6 deletions
diff --git a/services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp b/services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp
index 8d679540e8..b2d7a7a47d 100644
--- a/services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp
+++ b/services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp
@@ -20,6 +20,7 @@
#include "AidlComposerHal.h"
+#include <android-base/file.h>
#include <android/binder_ibinder_platform.h>
#include <android/binder_manager.h>
#include <log/log.h>
@@ -262,13 +263,27 @@ std::vector<Capability> AidlComposer::getCapabilities() {
}
std::string AidlComposer::dumpDebugInfo() {
- std::string info;
- const auto status = mAidlComposer->dumpDebugInfo(&info);
- if (!status.isOk()) {
- ALOGE("dumpDebugInfo failed %s", status.getDescription().c_str());
+ int pipefds[2];
+ int result = pipe(pipefds);
+ if (result < 0) {
+ ALOGE("dumpDebugInfo: pipe failed: %s", strerror(errno));
return {};
}
- return info;
+
+ std::string str;
+ const auto status = mAidlComposer->dump(pipefds[1], /*args*/ nullptr, /*numArgs*/ 0);
+ // Close the write-end of the pipe to make sure that when reading from the
+ // read-end we will get eof instead of blocking forever
+ close(pipefds[1]);
+
+ if (status == STATUS_OK) {
+ base::ReadFdToString(pipefds[0], &str);
+ } else {
+ ALOGE("dumpDebugInfo: dump failed: %d", status);
+ }
+
+ close(pipefds[0]);
+ return str;
}
void AidlComposer::registerCallback(HWC2::ComposerCallback& callback) {
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 59c07b6db1..4e5e6aaa3d 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -5341,7 +5341,7 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, std::string& result) co
colorizer.reset(result);
const bool hwcDisabled = mDebugDisableHWC || mDebugFlashDelay;
StringAppendF(&result, " h/w composer %s\n", hwcDisabled ? "disabled" : "enabled");
- getHwComposer().dump(result);
+ dumpHwc(result);
/*
* Dump gralloc state