summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2013-03-21 14:06:52 -0700
committerJesse Hall <jessehall@google.com>2013-03-22 15:27:58 -0700
commit48bc05b56df9919fc39c5f2e3ea6535560eec98f (patch)
tree25b2531eaac8975a71fcee6a421059d130c7f8fe /services/surfaceflinger/SurfaceFlinger.cpp
parent851cfe834295224cd64bdd499872b95b19c4de8c (diff)
downloadframeworks_native-48bc05b56df9919fc39c5f2e3ea6535560eec98f.zip
frameworks_native-48bc05b56df9919fc39c5f2e3ea6535560eec98f.tar.gz
frameworks_native-48bc05b56df9919fc39c5f2e3ea6535560eec98f.tar.bz2
Fix dump when virtual display exists
SurfaceFlinger::getLayerSortedByZForHwcDisplay only worked for builtin displays. Bug: 8384764 Change-Id: I989275407fb2f06d166a6e70321c3211e27e562e
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 0e5d602..2df279a 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2381,9 +2381,21 @@ void SurfaceFlinger::dumpAllLocked(
}
const Vector< sp<Layer> >&
-SurfaceFlinger::getLayerSortedByZForHwcDisplay(int disp) {
+SurfaceFlinger::getLayerSortedByZForHwcDisplay(int id) {
// Note: mStateLock is held here
- return getDisplayDevice( getBuiltInDisplay(disp) )->getVisibleLayersSortedByZ();
+ wp<IBinder> dpy;
+ for (size_t i=0 ; i<mDisplays.size() ; i++) {
+ if (mDisplays.valueAt(i)->getHwcDisplayId() == id) {
+ dpy = mDisplays.keyAt(i);
+ break;
+ }
+ }
+ if (dpy == NULL) {
+ ALOGE("getLayerSortedByZForHwcDisplay: invalid hwc display id %d", id);
+ // Just use the primary display so we have something to return
+ dpy = getBuiltInDisplay(DisplayDevice::DISPLAY_PRIMARY);
+ }
+ return getDisplayDevice(dpy)->getVisibleLayersSortedByZ();
}
bool SurfaceFlinger::startDdmConnection()