diff options
author | Mathias Agopian <mathias@google.com> | 2010-09-14 15:14:10 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-14 15:14:10 -0700 |
commit | 48a862407dda482450bdfd5aa2a2cd8b3e8e38dd (patch) | |
tree | 9cf822d456fab1858f266b491a81bc90868c36b5 /services/surfaceflinger | |
parent | b30f21882080bd4c0d7c3b25878151dd19ac3f94 (diff) | |
parent | b3ffc78f3432344702e6f5232067ab624083cad2 (diff) | |
download | frameworks_base-48a862407dda482450bdfd5aa2a2cd8b3e8e38dd.zip frameworks_base-48a862407dda482450bdfd5aa2a2cd8b3e8e38dd.tar.gz frameworks_base-48a862407dda482450bdfd5aa2a2cd8b3e8e38dd.tar.bz2 |
am b3ffc78f: Merge "Add logging of various important graphics events" into gingerbread
Merge commit 'b3ffc78f3432344702e6f5232067ab624083cad2' into gingerbread-plus-aosp
* commit 'b3ffc78f3432344702e6f5232067ab624083cad2':
Add logging of various important graphics events
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r-- | services/surfaceflinger/DisplayHardware/DisplayHardware.cpp | 4 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/DisplayHardware.h | 3 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 19 |
3 files changed, 24 insertions, 2 deletions
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp index 2eac0a8..0515110 100644 --- a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp +++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp @@ -296,6 +296,10 @@ status_t DisplayHardware::compositionComplete() const { return mNativeWindow->compositionComplete(); } +int DisplayHardware::getCurrentBufferIndex() const { + return mNativeWindow->getCurrentBufferIndex(); +} + void DisplayHardware::flip(const Region& dirty) const { checkGLErrors(); diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.h b/services/surfaceflinger/DisplayHardware/DisplayHardware.h index 66bf521..2d7900c 100644 --- a/services/surfaceflinger/DisplayHardware/DisplayHardware.h +++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.h @@ -87,6 +87,9 @@ public: return Rect(mWidth, mHeight); } + // only for debugging + int getCurrentBufferIndex() const; + private: void init(uint32_t displayIndex) __attribute__((noinline)); void fini() __attribute__((noinline)); diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 637ae48..f199ca9 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -38,6 +38,7 @@ #include <utils/StopWatch.h> #include <ui/GraphicBufferAllocator.h> +#include <ui/GraphicLog.h> #include <ui/PixelFormat.h> #include <pixelflinger/pixelflinger.h> @@ -371,15 +372,25 @@ bool SurfaceFlinger::threadLoop() const DisplayHardware& hw(graphicPlane(0).displayHardware()); if (LIKELY(hw.canDraw() && !isFrozen())) { // repaint the framebuffer (if needed) + + const int index = hw.getCurrentBufferIndex(); + GraphicLog& logger(GraphicLog::getInstance()); + + logger.log(GraphicLog::SF_REPAINT, index); handleRepaint(); // inform the h/w that we're done compositing + logger.log(GraphicLog::SF_COMPOSITION_COMPLETE, index); hw.compositionComplete(); // release the clients before we flip ('cause flip might block) + logger.log(GraphicLog::SF_UNLOCK_CLIENTS, index); unlockClients(); + logger.log(GraphicLog::SF_SWAP_BUFFERS, index); postFramebuffer(); + + logger.log(GraphicLog::SF_REPAINT_DONE, index); } else { // pretend we did the post unlockClients(); @@ -1470,8 +1481,7 @@ status_t SurfaceFlinger::onTransact( int n; switch (code) { case 1000: // SHOW_CPU, NOT SUPPORTED ANYMORE - return NO_ERROR; - case 1001: // SHOW_FPS, NOT SUPPORTED ANYMORE + case 1001: // SHOW_FPS, NOT SUPPORTED ANYMORE return NO_ERROR; case 1002: // SHOW_UPDATES n = data.readInt32(); @@ -1492,6 +1502,11 @@ status_t SurfaceFlinger::onTransact( setTransactionFlags(eTransactionNeeded|eTraversalNeeded); return NO_ERROR; } + case 1006:{ // enable/disable GraphicLog + int enabled = data.readInt32(); + GraphicLog::getInstance().setEnabled(enabled); + return NO_ERROR; + } case 1007: // set mFreezeCount mFreezeCount = data.readInt32(); mFreezeDisplayTime = 0; |