summaryrefslogtreecommitdiff
path: root/hwc3/impl/HalImpl.cpp
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2022-02-16 23:41:58 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-02-16 23:41:58 +0000
commit0ec8e120c9b88fb7dc7f590e23914dd8267a5941 (patch)
tree450716777b36d70b5916f3f6d5365ec9e5da1797 /hwc3/impl/HalImpl.cpp
parentb3cdfd864feb0bcb12e5a6c8177d2e2cfbeea7ab (diff)
parent6d26734c3f9f28283d8ab2114f3254f1a3697540 (diff)
Merge "hwc3: simplify dumpDebugInfo to avoid duplicated dump calls"
Diffstat (limited to 'hwc3/impl/HalImpl.cpp')
-rw-r--r--hwc3/impl/HalImpl.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/hwc3/impl/HalImpl.cpp b/hwc3/impl/HalImpl.cpp
index 240edff..1a56cfa 100644
--- a/hwc3/impl/HalImpl.cpp
+++ b/hwc3/impl/HalImpl.cpp
@@ -163,11 +163,13 @@ void HalImpl::getCapabilities(std::vector<Capability>* caps) {
}
void HalImpl::dumpDebugInfo(std::string* output) {
- uint32_t count = 0;
- mDevice->dump(&count, nullptr);
+ if (output == nullptr) return;
+
+ String8 result;
+ mDevice->dump(result);
- output->resize(count);
- mDevice->dump(&count, output->data());
+ output->resize(result.size());
+ output->assign(result.c_str());
}
void HalImpl::registerEventCallback(EventCallback* callback) {