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

Commit 9a15fabc authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "dump HWC state in dumpsys"

parents 6f0fe650 83727858
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <sys/types.h>

#include <utils/Errors.h>
#include <utils/String8.h>

#include <hardware/hardware.h>

@@ -100,5 +101,25 @@ hwc_layer_t* HWComposer::getLayers() const {
    return mList ? mList->hwLayers : 0;
}

void HWComposer::dump(String8& result, char* buffer, size_t SIZE) const {
    if (mHwc && mList) {
        result.append("Hardware Composer state:\n");

        snprintf(buffer, SIZE, "  numHwLayers=%u, flags=%08x\n",
                mList->numHwLayers, mList->flags);
        result.append(buffer);

        for (size_t i=0 ; i<mList->numHwLayers ; i++) {
            const hwc_layer_t& l(mList->hwLayers[i]);
            snprintf(buffer, SIZE, "  %8s | %08x | %08x | %02x | %04x | [%5d,%5d,%5d,%5d] |  [%5d,%5d,%5d,%5d]\n",
                    l.compositionType ? "OVERLAY" : "FB",
                    l.hints, l.flags, l.transform, l.blending,
                    l.sourceCrop.left, l.sourceCrop.top, l.sourceCrop.right, l.sourceCrop.bottom,
                    l.displayFrame.left, l.displayFrame.top, l.displayFrame.right, l.displayFrame.bottom);
            result.append(buffer);
        }
    }
}

// ---------------------------------------------------------------------------
}; // namespace android
+5 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@
namespace android {
// ---------------------------------------------------------------------------

class String8;

class HWComposer
{
public:
@@ -54,6 +56,9 @@ public:
    size_t getNumLayers() const;
    hwc_layer_t* getLayers() const;

    // for debugging
    void dump(String8& out, char* scratch, size_t SIZE) const;

private:
    hw_module_t const*      mModule;
    hwc_composer_device_t*  mHwc;
+1 −0
Original line number Diff line number Diff line
@@ -1533,6 +1533,7 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
                hwc.initCheck()==NO_ERROR ? "present" : "not present",
                mDebugDisableHWC ? "disabled" : "enabled");
        result.append(buffer);
        hwc.dump(result, buffer, SIZE);

        const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
        alloc.dump(result);