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

Commit 48bc05b5 authored by Jesse Hall's avatar Jesse Hall
Browse files

Fix dump when virtual display exists

SurfaceFlinger::getLayerSortedByZForHwcDisplay only worked for builtin
displays.

Bug: 8384764
Change-Id: I989275407fb2f06d166a6e70321c3211e27e562e
parent 851cfe83
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -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()
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ public:

    // for debugging only
    // TODO: this should be made accessible only to HWComposer
    const Vector< sp<Layer> >& getLayerSortedByZForHwcDisplay(int disp);
    const Vector< sp<Layer> >& getLayerSortedByZForHwcDisplay(int id);

private:
    friend class Client;