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

Commit f3b2de10 authored by Courtney Goeltzenleuchter's avatar Courtney Goeltzenleuchter
Browse files

Dump info about wide-color

Test: adb shell dumpsys SurfaceFlinger
      Look for section titled "Wide-Color information:"
Bug: 29940137

Change-Id: I2bd642aa026b49bbb9effd5cb1687c7a36dae684
parent 5d943892
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -412,9 +412,9 @@ void GLES20RenderEngine::drawMesh(const Mesh& mesh) {
void GLES20RenderEngine::dump(String8& result) {
    RenderEngine::dump(result);
    if (usesWideColor()) {
        result.append("Wide-color: On");
        result.append("Wide-color: On\n");
    } else {
        result.append("Wide-color: Off");
        result.append("Wide-color: Off\n");
    }
}

+34 −0
Original line number Diff line number Diff line
@@ -3249,6 +3249,12 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
                dumpFrameEventsLocked(result);
                dumpAll = false;
            }

            if ((index < numArgs) && (args[index] == String16("--wide-color"))) {
                index++;
                dumpWideColorInfo(result);
                dumpAll = false;
            }
        }

        if (dumpAll) {
@@ -3419,6 +3425,31 @@ void SurfaceFlinger::dumpBufferingStats(String8& result) const {
    result.append("\n");
}

void SurfaceFlinger::dumpWideColorInfo(String8& result) const {
    result.appendFormat("hasWideColorDisplay: %d\n", hasWideColorDisplay);

    // TODO: print out if wide-color mode is active or not

    for (size_t d = 0; d < mDisplays.size(); d++) {
        const sp<const DisplayDevice>& displayDevice(mDisplays[d]);
        int32_t hwcId = displayDevice->getHwcDisplayId();
        if (hwcId == DisplayDevice::DISPLAY_ID_INVALID) {
            continue;
        }

        result.appendFormat("Display %d color modes:\n", hwcId);
        std::vector<android_color_mode_t> modes = getHwComposer().getColorModes(hwcId);
        for (auto&& mode : modes) {
            result.appendFormat("    %s (%d)\n", decodeColorMode(mode).c_str(), mode);
        }

        android_color_mode_t currentMode = displayDevice->getActiveColorMode();
        result.appendFormat("    Current color mode: %s (%d)\n",
                            decodeColorMode(currentMode).c_str(), currentMode);
    }
    result.append("\n");
}

void SurfaceFlinger::dumpAllLocked(const Vector<String16>& args, size_t& index,
        String8& result) const
{
@@ -3450,6 +3481,9 @@ void SurfaceFlinger::dumpAllLocked(const Vector<String16>& args, size_t& index,
    appendGuiConfigString(result);
    result.append("\n");

    result.append("\nWide-Color information:\n");
    dumpWideColorInfo(result);

    colorizer.bold(result);
    result.append("Sync configuration: ");
    colorizer.reset(result);
+1 −0
Original line number Diff line number Diff line
@@ -535,6 +535,7 @@ private:
    void recordBufferingStats(const char* layerName,
            std::vector<OccupancyTracker::Segment>&& history);
    void dumpBufferingStats(String8& result) const;
    void dumpWideColorInfo(String8& result) const;

    bool isLayerTripleBufferingDisabled() const {
        return this->mLayerTripleBufferingDisabled;