surfaceflinger: add support for gralloc dump hooks
Change-Id: Ib6f539ed0132b70d040d653c03d52cc04249ac3c
This commit is contained in:
parent
db4fdaaa1e
commit
1d21a9cafc
|
@ -23,6 +23,7 @@
|
|||
#include <EGL/egl.h>
|
||||
|
||||
#include <utils/threads.h>
|
||||
#include <utils/String8.h>
|
||||
#include <ui/Rect.h>
|
||||
|
||||
#include <pixelflinger/pixelflinger.h>
|
||||
|
@ -56,7 +57,9 @@ public:
|
|||
bool isUpdateOnDemand() const { return mUpdateOnDemand; }
|
||||
status_t setUpdateRectangle(const Rect& updateRect);
|
||||
status_t compositionComplete();
|
||||
|
||||
|
||||
void dump(String8& result);
|
||||
|
||||
// for debugging only
|
||||
int getCurrentBufferIndex() const;
|
||||
|
||||
|
|
|
@ -182,6 +182,16 @@ int FramebufferNativeWindow::setSwapInterval(
|
|||
return fb->setSwapInterval(fb, interval);
|
||||
}
|
||||
|
||||
void FramebufferNativeWindow::dump(String8& result) {
|
||||
if (fbDev->common.version >= 1 && fbDev->dump) {
|
||||
const size_t SIZE = 4096;
|
||||
char buffer[SIZE];
|
||||
|
||||
fbDev->dump(fbDev, buffer, SIZE);
|
||||
result.append(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
// only for debugging / logging
|
||||
int FramebufferNativeWindow::getCurrentBufferIndex() const
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@ void GraphicBufferAllocator::dump(String8& result) const
|
|||
Mutex::Autolock _l(sLock);
|
||||
KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList);
|
||||
size_t total = 0;
|
||||
const size_t SIZE = 512;
|
||||
const size_t SIZE = 4096;
|
||||
char buffer[SIZE];
|
||||
snprintf(buffer, SIZE, "Allocated buffers:\n");
|
||||
result.append(buffer);
|
||||
|
@ -71,6 +71,10 @@ void GraphicBufferAllocator::dump(String8& result) const
|
|||
}
|
||||
snprintf(buffer, SIZE, "Total allocated: %.2f KB\n", total/1024.0f);
|
||||
result.append(buffer);
|
||||
if (mAllocDev->common.version >= 1 && mAllocDev->dump) {
|
||||
mAllocDev->dump(mAllocDev, buffer, SIZE);
|
||||
result.append(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicBufferAllocator::dumpToSystemLog()
|
||||
|
|
|
@ -367,3 +367,8 @@ void DisplayHardware::makeCurrent() const
|
|||
{
|
||||
eglMakeCurrent(mDisplay, mSurface, mSurface, mContext);
|
||||
}
|
||||
|
||||
void DisplayHardware::dump(String8& res) const
|
||||
{
|
||||
mNativeWindow->dump(res);
|
||||
}
|
||||
|
|
|
@ -80,6 +80,8 @@ public:
|
|||
EGLDisplay getEGLDisplay() const { return mDisplay; }
|
||||
overlay_control_device_t* getOverlayEngine() const { return mOverlayEngine; }
|
||||
|
||||
void dump(String8& res) const;
|
||||
|
||||
// Hardware Composer
|
||||
HWComposer& getHwComposer() const;
|
||||
|
||||
|
|
|
@ -120,6 +120,11 @@ void HWComposer::dump(String8& result, char* buffer, size_t SIZE) const {
|
|||
l.displayFrame.left, l.displayFrame.top, l.displayFrame.right, l.displayFrame.bottom);
|
||||
result.append(buffer);
|
||||
}
|
||||
|
||||
}
|
||||
if (mHwc && mHwc->common.version >= 1 && mHwc->dump) {
|
||||
mHwc->dump(mHwc, buffer, SIZE);
|
||||
result.append(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1460,7 +1460,7 @@ void SurfaceFlinger::screenAcquired(int dpy)
|
|||
|
||||
status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
|
||||
{
|
||||
const size_t SIZE = 1024;
|
||||
const size_t SIZE = 4096;
|
||||
char buffer[SIZE];
|
||||
String8 result;
|
||||
if (!mDump.checkCalling()) {
|
||||
|
@ -1538,6 +1538,7 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
|
|||
|
||||
const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
|
||||
alloc.dump(result);
|
||||
hw.dump(result);
|
||||
|
||||
if (locked) {
|
||||
mStateLock.unlock();
|
||||
|
|
Loading…
Reference in New Issue