From 5bd1b2794b227e25fbd7e4c919bcefc3510e0761 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 9 Sep 2011 00:49:11 -0700 Subject: Improve SF dumpsys output wrt HWC Change-Id: Ibdb7930fa3b521bfd3f44750ed98cfd75f9a01fe --- services/surfaceflinger/DisplayHardware/HWComposer.cpp | 10 +++++++--- services/surfaceflinger/DisplayHardware/HWComposer.h | 5 ++++- services/surfaceflinger/LayerBase.cpp | 7 +++---- services/surfaceflinger/SurfaceFlinger.cpp | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) (limited to 'services') diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 0ff1cce..c9567d5 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -22,6 +22,7 @@ #include #include +#include #include @@ -29,6 +30,7 @@ #include +#include "LayerBase.h" #include "HWComposer.h" #include "SurfaceFlinger.h" @@ -133,7 +135,8 @@ hwc_layer_t* HWComposer::getLayers() const { return mList ? mList->hwLayers : 0; } -void HWComposer::dump(String8& result, char* buffer, size_t SIZE) const { +void HWComposer::dump(String8& result, char* buffer, size_t SIZE, + const Vector< sp >& visibleLayersSortedByZ) const { if (mHwc && mList) { result.append("Hardware Composer state:\n"); @@ -143,11 +146,12 @@ void HWComposer::dump(String8& result, char* buffer, size_t SIZE) const { for (size_t i=0 ; inumHwLayers ; 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", + snprintf(buffer, SIZE, " %8s | %08x | %08x | %02x | %04x | [%5d,%5d,%5d,%5d] | [%5d,%5d,%5d,%5d] %s\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); + l.displayFrame.left, l.displayFrame.top, l.displayFrame.right, l.displayFrame.bottom, + visibleLayersSortedByZ[i]->getName().string()); result.append(buffer); } diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h index 77c1a4b..8758a80 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.h +++ b/services/surfaceflinger/DisplayHardware/HWComposer.h @@ -25,12 +25,14 @@ #include #include +#include namespace android { // --------------------------------------------------------------------------- class String8; class SurfaceFlinger; +class LayerBase; class HWComposer { @@ -63,7 +65,8 @@ public: hwc_layer_t* getLayers() const; // for debugging - void dump(String8& out, char* scratch, size_t SIZE) const; + void dump(String8& out, char* scratch, size_t SIZE, + const Vector< sp >& visibleLayersSortedByZ) const; private: struct cb_context { diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp index dfc531e..a63dcd3 100644 --- a/services/surfaceflinger/LayerBase.cpp +++ b/services/surfaceflinger/LayerBase.cpp @@ -480,12 +480,13 @@ void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const { const Layer::State& s(drawingState()); snprintf(buffer, SIZE, - "+ %s %p\n" + "+ %s %p (%s)\n" " " "z=%9d, pos=(%g,%g), size=(%4d,%4d), " "isOpaque=%1d, needsDithering=%1d, invalidate=%1d, " "alpha=0x%02x, flags=0x%08x, tr=[%.2f, %.2f][%.2f, %.2f]\n", - getTypeId(), this, s.z, s.transform.tx(), s.transform.ty(), s.w, s.h, + getTypeId(), this, getName().string(), + s.z, s.transform.tx(), s.transform.ty(), s.w, s.h, isOpaque(), needsDithering(), contentDirty, s.alpha, s.flags, s.transform[0][0], s.transform[0][1], @@ -561,9 +562,7 @@ void LayerBaseClient::dump(String8& result, char* buffer, size_t SIZE) const sp client(mClientRef.promote()); snprintf(buffer, SIZE, - " name=%s\n" " client=%p, identity=%u\n", - getName().string(), client.get(), getIdentity()); result.append(buffer); diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 2576576..768f8e0 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1606,7 +1606,7 @@ status_t SurfaceFlinger::dump(int fd, const Vector& args) hwc.initCheck()==NO_ERROR ? "present" : "not present", (mDebugDisableHWC || mDebugRegion) ? "disabled" : "enabled"); result.append(buffer); - hwc.dump(result, buffer, SIZE); + hwc.dump(result, buffer, SIZE, mVisibleLayersSortedByZ); /* * Dump gralloc state -- cgit v1.1