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

Commit 19987a8c authored by Courtney Goeltzenleuchter's avatar Courtney Goeltzenleuchter
Browse files

Dump FramebufferSurface dataspace

For debugging, dump the dataspace details for the
FramebufferSurface. Value will be 0 (UNKNOWN) if HWC is
doing composition.
Test: adb shell dumpsys SurfaceFlinger
      Look for FramebufferSurface details.
Bug: 63146977

Change-Id: I9eb40739a616246bdac6e039270609d42eb56b59
parent 9f484649
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include <gui/BufferQueue.h>
#include <gui/Surface.h>

#include <ui/DebugUtils.h>
#include <ui/GraphicBuffer.h>
#include <ui/Rect.h>

@@ -103,6 +104,7 @@ status_t FramebufferSurface::advanceFrame() {
    sp<Fence> acquireFence(Fence::NO_FENCE);
    android_dataspace_t dataspace = HAL_DATASPACE_UNKNOWN;
    status_t result = nextBuffer(slot, buf, acquireFence, dataspace);
    mDataSpace = dataspace;
    if (result != NO_ERROR) {
        ALOGE("error latching next FramebufferSurface buffer: %s (%d)",
                strerror(-result), result);
@@ -248,7 +250,10 @@ status_t FramebufferSurface::compositionComplete()
#endif

void FramebufferSurface::dumpAsString(String8& result) const {
    ConsumerBase::dumpState(result);
    Mutex::Autolock lock(mMutex);
    result.appendFormat("FramebufferSurface: dataspace: %s(%d)\n",
                        dataspaceDetails(mDataSpace).c_str(), mDataSpace);
    ConsumerBase::dumpLocked(result, "");
}

void FramebufferSurface::dumpLocked(String8& result, const char* prefix) const
+7 −0
Original line number Diff line number Diff line
@@ -83,6 +83,13 @@ private:
    // or the buffer is not associated with a slot.
    int mCurrentBufferSlot;

    // mDataSpace is the dataspace of the current composition buffer for
    // this FramebufferSurface. It will be 0 when HWC is doing the
    // compositing. Otherwise it will display the dataspace of the buffer
    // use for compositing which can change as wide-color content is
    // on/off.
    android_dataspace mDataSpace;

    // mCurrentBuffer is the current buffer or NULL to indicate that there is
    // no current buffer.
    sp<GraphicBuffer> mCurrentBuffer;