improve logging of external displays

Change-Id: I041aebb7fc655aeca98bbf698d15e05d7c12cac9
This commit is contained in:
Mathias Agopian 2012-09-18 01:38:00 -07:00
parent 6ab93290ae
commit 1d12d8a8e6
3 changed files with 29 additions and 28 deletions

View File

@ -235,13 +235,6 @@ uint32_t DisplayDevice::getFlags() const
return mFlags;
}
void DisplayDevice::dump(String8& res) const
{
if (mFramebufferSurface != NULL) {
mFramebufferSurface->dump(res);
}
}
EGLBoolean DisplayDevice::makeCurrent(EGLDisplay dpy,
const sp<const DisplayDevice>& hw, EGLContext ctx) {
EGLBoolean result = EGL_TRUE;
@ -406,3 +399,30 @@ void DisplayDevice::updateGeometryTransform() {
mGlobalTransform = R * TP * S * TL;
}
}
void DisplayDevice::dump(String8& result, char* buffer, size_t SIZE) const {
const Transform& tr(mGlobalTransform);
snprintf(buffer, SIZE,
"+ DisplayDevice: %s\n"
" type=%x, layerStack=%u, (%4dx%4d), ANativeWindow=%p, orient=%2d (type=%08x), "
"flips=%u, secure=%d, acquired=%d, numLayers=%u\n"
" v:[%d,%d,%d,%d], f:[%d,%d,%d,%d], "
"transform:[[%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f]]\n",
mType, mDisplayName.string(),
mLayerStack, mDisplayWidth, mDisplayHeight, mNativeWindow.get(),
mOrientation, tr.getType(), getPageFlipCount(),
mSecureLayerVisible, mScreenAcquired, mVisibleLayersSortedByZ.size(),
mViewport.left, mViewport.top, mViewport.right, mViewport.bottom,
mFrame.left, mFrame.top, mFrame.right, mFrame.bottom,
tr[0][0], tr[1][0], tr[2][0],
tr[0][1], tr[1][1], tr[2][1],
tr[0][2], tr[1][2], tr[2][2]);
result.append(buffer);
String8 fbtargetDump;
if (mFramebufferSurface != NULL) {
mFramebufferSurface->dump(fbtargetDump);
result.append(fbtargetDump);
}
}

View File

@ -138,7 +138,7 @@ public:
* Debugging
*/
uint32_t getPageFlipCount() const;
void dump(String8& res) const;
void dump(String8& result, char* buffer, size_t SIZE) const;
private:
void init(EGLConfig config);

View File

@ -2025,25 +2025,7 @@ void SurfaceFlinger::dumpAllLocked(
result.append(buffer);
for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) {
const sp<const DisplayDevice>& hw(mDisplays[dpy]);
snprintf(buffer, SIZE,
"+ DisplayDevice[%u] '%s'\n"
" type=%x, layerStack=%u, (%4dx%4d), orient=%2d (type=%08x), "
"flips=%u, secure=%d, numLayers=%u, v:[%d,%d,%d,%d], f:[%d,%d,%d,%d], "
"transform:[[%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f]]\n",
dpy, (const char*) hw->getDisplayName(),
hw->getDisplayType(), hw->getLayerStack(),
hw->getWidth(), hw->getHeight(),
hw->getOrientation(), hw->getTransform().getType(),
hw->getPageFlipCount(),
hw->getSecureLayerVisible(),
hw->getVisibleLayersSortedByZ().size(),
hw->getViewport().left, hw->getViewport().top, hw->getViewport().right, hw->getViewport().bottom,
hw->getFrame().left, hw->getFrame().top, hw->getFrame().right, hw->getFrame().bottom,
hw->getTransform()[0][0], hw->getTransform()[1][0], hw->getTransform()[2][0],
hw->getTransform()[0][1], hw->getTransform()[1][1], hw->getTransform()[2][1],
hw->getTransform()[0][2], hw->getTransform()[1][2], hw->getTransform()[2][2]);
result.append(buffer);
hw->dump(result, buffer, SIZE);
}
/*
@ -2118,7 +2100,6 @@ void SurfaceFlinger::dumpAllLocked(
*/
const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
alloc.dump(result);
hw->dump(result);
}
bool SurfaceFlinger::startDdmConnection()