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

Commit 2d19dd65 authored by Marin Shalamanov's avatar Marin Shalamanov Committed by Android (Google) Code Review
Browse files

Merge changes I0332cc46,I5f8c7737

* changes:
  Fix dump of active config
  SF: In dumpsys add head row for "Allocated buffers" table
parents 14f2174c 61b00bcd
Loading
Loading
Loading
Loading
+10 −13
Original line number Diff line number Diff line
@@ -83,20 +83,17 @@ void GraphicBufferAllocator::dump(std::string& result, bool less) const {
    KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList);
    uint64_t total = 0;
    result.append("GraphicBufferAllocator buffers:\n");
    const size_t c = list.size();
    for (size_t i=0 ; i<c ; i++) {
    const size_t count = list.size();
    StringAppendF(&result, "%10s | %11s | %18s | %s | %8s | %10s | %s\n", "Handle", "Size",
                  "W (Stride) x H", "Layers", "Format", "Usage", "Requestor");
    for (size_t i = 0; i < count; i++) {
        const alloc_rec_t& rec(list.valueAt(i));
        if (rec.size) {
            StringAppendF(&result,
                          "%10p: %7.2f KiB | %4u (%4u) x %4u | %4u | %8X | 0x%" PRIx64 " | %s\n",
                          list.keyAt(i), static_cast<double>(rec.size) / 1024.0, rec.width, rec.stride, rec.height,
        std::string sizeStr = (rec.size)
                ? base::StringPrintf("%7.2f KiB", static_cast<double>(rec.size) / 1024.0)
                : "unknown";
        StringAppendF(&result, "%10p | %11s | %4u (%4u) x %4u | %6u | %8X | 0x%8" PRIx64 " | %s\n",
                      list.keyAt(i), sizeStr.c_str(), rec.width, rec.stride, rec.height,
                      rec.layerCount, rec.format, rec.usage, rec.requestorName.c_str());
        } else {
            StringAppendF(&result,
                          "%10p: unknown     | %4u (%4u) x %4u | %4u | %8X | 0x%" PRIx64 " | %s\n",
                          list.keyAt(i), rec.width, rec.stride, rec.height, rec.layerCount,
                          rec.format, rec.usage, rec.requestorName.c_str());
        }
        total += rec.size;
    }
    StringAppendF(&result, "Total allocated by GraphicBufferAllocator (estimate): %.2f KB\n",
+4 −3
Original line number Diff line number Diff line
@@ -4824,9 +4824,10 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, std::string& result) co
        const auto activeConfig = getHwComposer().getActiveConfig(*displayId);
        std::string fps, xDpi, yDpi;
        if (activeConfig) {
            fps = std::to_string(1e9 / getHwComposer().getDisplayVsyncPeriod(*displayId)) + " fps";
            xDpi = activeConfig->getDpiX();
            yDpi = activeConfig->getDpiY();
            fps = base::StringPrintf("%.2f Hz",
                                     1e9f / getHwComposer().getDisplayVsyncPeriod(*displayId));
            xDpi = base::StringPrintf("%.2f", activeConfig->getDpiX());
            yDpi = base::StringPrintf("%.2f", activeConfig->getDpiY());
        } else {
            fps = "unknown";
            xDpi = "unknown";