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

Commit 2e5ccb7b authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7579269 from 6a95f050 to sc-v2-release

Change-Id: I6f58cdc034f7390df979a43f7220667d5edca67c
parents 4a3d9a06 6a95f050
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ cc_defaults {
        "libhidlbase",
        "liblog",
        "libmedia_helper",
        "libmediautils_vendor",
        "libmemunreachable",
        "libutils",
        "android.hardware.audio.common-util",
    ],
+27 −2
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@
#include <algorithm>

#include <android/log.h>
#include <mediautils/MemoryLeakTrackUtil.h>
#include <memunreachable/memunreachable.h>

#include <HidlUtils.h>

@@ -456,9 +458,32 @@ Return<void> Device::debugDump(const hidl_handle& fd) {
}
#endif

Return<void> Device::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& /* options */) {
Return<void> Device::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) {
    if (fd.getNativeHandle() != nullptr && fd->numFds == 1) {
        analyzeStatus("dump", mDevice->dump(mDevice, fd->data[0]));
        const int fd0 = fd->data[0];
        bool dumpMem = false;
        bool unreachableMemory = false;
        for (const auto& option : options) {
            if (option == "-m") {
                dumpMem = true;
            } else if (option == "--unreachable") {
                unreachableMemory = true;
            }
        }

        if (dumpMem) {
            dprintf(fd0, "\nDumping memory:\n");
            std::string s = dumpMemoryAddresses(100 /* limit */);
            write(fd0, s.c_str(), s.size());
        }
        if (unreachableMemory) {
            dprintf(fd0, "\nDumping unreachable memory:\n");
            // TODO - should limit be an argument parameter?
            std::string s = GetUnreachableMemoryString(true /* contents */, 100 /* limit */);
            write(fd0, s.c_str(), s.size());
        }

        analyzeStatus("dump", mDevice->dump(mDevice, fd0));
    }
    return Void();
}
+25 −9
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#define LOG_TAG "graphics_composer_hidl_hal_test@2.3"

#include <algorithm>
#include <numeric>

#include <android-base/logging.h>
#include <android-base/properties.h>
@@ -155,7 +156,23 @@ class GraphicsComposerHidlCommandTest : public GraphicsComposerHidlTest {
TEST_P(GraphicsComposerHidlTest, GetDisplayIdentificationData) {
    uint8_t port0;
    std::vector<uint8_t> data0;
    if (mComposerClient->getDisplayIdentificationData(mPrimaryDisplay, &port0, &data0)) {

    if (!mComposerClient->getDisplayIdentificationData(mPrimaryDisplay, &port0, &data0)) {
        return;
    }

    ASSERT_FALSE(data0.empty());
    constexpr size_t kEdidBlockSize = 128;
    ASSERT_TRUE(data0.size() % kEdidBlockSize == 0)
            << "EDID blob length is not a multiple of " << kEdidBlockSize;

    const uint8_t kEdidHeader[] = {0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00};
    ASSERT_TRUE(std::equal(std::begin(kEdidHeader), std::end(kEdidHeader), data0.begin()))
            << "EDID blob doesn't start with the fixed EDID header";
    ASSERT_EQ(0, std::accumulate(data0.begin(), data0.begin() + kEdidBlockSize,
                                 static_cast<uint8_t>(0)))
            << "EDID base block doesn't checksum";

    uint8_t port1;
    std::vector<uint8_t> data1;
    ASSERT_TRUE(mComposerClient->getDisplayIdentificationData(mPrimaryDisplay, &port1, &data1));
@@ -165,7 +182,6 @@ TEST_P(GraphicsComposerHidlTest, GetDisplayIdentificationData) {
                std::equal(data0.begin(), data0.end(), data1.begin()))
            << "data is not stable";
}
}

/**
 * Test IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA.