diff options
author | Jesse Hall <jessehall@google.com> | 2013-03-21 14:06:52 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2013-03-22 15:27:58 -0700 |
commit | 48bc05b56df9919fc39c5f2e3ea6535560eec98f (patch) | |
tree | 25b2531eaac8975a71fcee6a421059d130c7f8fe /services/surfaceflinger/SurfaceFlinger.cpp | |
parent | 851cfe834295224cd64bdd499872b95b19c4de8c (diff) | |
download | frameworks_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.cpp | 16 |
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() |