diff options
| author | 2012-10-08 16:12:12 -0700 | |
|---|---|---|
| committer | 2012-10-08 16:12:12 -0700 | |
| commit | 1a003e4aec1c4ffc2b11c8b9f05f69db6280987c (patch) | |
| tree | 996735a34db5bd99630616f747fad19c3d55dcb7 | |
| parent | eb38d85260073470e5a27af820fe6cd9f2bc35ae (diff) | |
| parent | cb55857bbde34a06c19dde3db5064d1717a0173e (diff) | |
am cb55857b: fix dumpsys Layer name when using multiple displays
* commit 'cb55857bbde34a06c19dde3db5064d1717a0173e':
fix dumpsys Layer name when using multiple displays
| -rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.cpp | 7 | ||||
| -rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.h | 3 | ||||
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 7 | ||||
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 4 |
4 files changed, 16 insertions, 5 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index dd9a762f95..be4af517f2 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -901,14 +901,16 @@ HWComposer::LayerListIterator HWComposer::end(int32_t id) { return getLayerIterator(id, numLayers); } -void HWComposer::dump(String8& result, char* buffer, size_t SIZE, - const Vector< sp<LayerBase> >& visibleLayersSortedByZ) const { +void HWComposer::dump(String8& result, char* buffer, size_t SIZE) const { if (mHwc) { result.appendFormat("Hardware Composer state (version %8x):\n", hwcApiVersion(mHwc)); result.appendFormat(" mDebugForceFakeVSync=%d\n", mDebugForceFakeVSync); for (size_t i=0 ; i<mNumDisplays ; i++) { const DisplayData& disp(mDisplayData[i]); + const Vector< sp<LayerBase> >& visibleLayersSortedByZ = + mFlinger->getLayerSortedByZForHwcDisplay(i); + if (disp.connected) { result.appendFormat( " Display[%d] : %ux%u, xdpi=%f, ydpi=%f, refresh=%lld\n", @@ -928,6 +930,7 @@ void HWComposer::dump(String8& result, char* buffer, size_t SIZE, const hwc_layer_1_t&l = disp.list->hwLayers[i]; int32_t format = -1; String8 name("unknown"); + if (i < visibleLayersSortedByZ.size()) { const sp<LayerBase>& layer(visibleLayersSortedByZ[i]); if (layer->getLayer() != NULL) { diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h index 269e1472a8..a78ffacf8b 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.h +++ b/services/surfaceflinger/DisplayHardware/HWComposer.h @@ -258,8 +258,7 @@ public: friend class VSyncThread; // for debugging ---------------------------------------------------------- - void dump(String8& out, char* scratch, size_t SIZE, - const Vector< sp<LayerBase> >& visibleLayersSortedByZ) const; + void dump(String8& out, char* scratch, size_t SIZE) const; private: void loadHwcModule(); diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 11031759e4..83674172f3 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2333,7 +2333,7 @@ void SurfaceFlinger::dumpAllLocked( hwc.initCheck()==NO_ERROR ? "present" : "not present", (mDebugDisableHWC || mDebugRegion) ? "disabled" : "enabled"); result.append(buffer); - hwc.dump(result, buffer, SIZE, hw->getVisibleLayersSortedByZ()); + hwc.dump(result, buffer, SIZE); /* * Dump gralloc state @@ -2342,6 +2342,11 @@ void SurfaceFlinger::dumpAllLocked( alloc.dump(result); } +const Vector< sp<LayerBase> >& +SurfaceFlinger::getLayerSortedByZForHwcDisplay(int disp) { + return getDisplayDevice( getBuiltInDisplay(disp) )->getVisibleLayersSortedByZ(); +} + bool SurfaceFlinger::startDdmConnection() { void* libddmconnection_dso = diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index 5bb3703684..6d36719fa7 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -130,6 +130,10 @@ public: // TODO: this should be made accessible only to MessageQueue void onMessageReceived(int32_t what); + // for debugging only + // TODO: this should be made accessible only to HWComposer + const Vector< sp<LayerBase> >& getLayerSortedByZForHwcDisplay(int disp); + private: friend class Client; friend class DisplayEventConnection; |