Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe5dd039 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SF: remove IComposer.dumpDebugInfo" into tm-dev

parents 120a2361 c4acf513
Loading
Loading
Loading
Loading
+20 −5
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@


#include "AidlComposerHal.h"
#include "AidlComposerHal.h"


#include <android-base/file.h>
#include <android/binder_ibinder_platform.h>
#include <android/binder_ibinder_platform.h>
#include <android/binder_manager.h>
#include <android/binder_manager.h>
#include <log/log.h>
#include <log/log.h>
@@ -262,13 +263,27 @@ std::vector<Capability> AidlComposer::getCapabilities() {
}
}


std::string AidlComposer::dumpDebugInfo() {
std::string AidlComposer::dumpDebugInfo() {
    std::string info;
    int pipefds[2];
    const auto status = mAidlComposer->dumpDebugInfo(&info);
    int result = pipe(pipefds);
    if (!status.isOk()) {
    if (result < 0) {
        ALOGE("dumpDebugInfo failed %s", status.getDescription().c_str());
        ALOGE("dumpDebugInfo: pipe failed: %s", strerror(errno));
        return {};
        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) {
void AidlComposer::registerCallback(HWC2::ComposerCallback& callback) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -5341,7 +5341,7 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, std::string& result) co
    colorizer.reset(result);
    colorizer.reset(result);
    const bool hwcDisabled = mDebugDisableHWC || mDebugFlashDelay;
    const bool hwcDisabled = mDebugDisableHWC || mDebugFlashDelay;
    StringAppendF(&result, "  h/w composer %s\n", hwcDisabled ? "disabled" : "enabled");
    StringAppendF(&result, "  h/w composer %s\n", hwcDisabled ? "disabled" : "enabled");
    getHwComposer().dump(result);
    dumpHwc(result);


    /*
    /*
     * Dump gralloc state
     * Dump gralloc state