summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/DisplayHardware/DisplayHardware.cpp4
-rw-r--r--services/surfaceflinger/DisplayHardware/DisplayHardware.h3
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp19
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;