am 04eeb288: am 50be1df7: Merge "SF: Track missed frames and optionally drop them" into mnc-dr-dev
* commit '04eeb2882567412cdcec5981b50c9e7c024b03cc': SF: Track missed frames and optionally drop them
This commit is contained in:
commit
2121b93725
|
@ -163,6 +163,9 @@ SurfaceFlinger::SurfaceFlinger()
|
||||||
property_get("ro.bq.gpu_to_cpu_unsupported", value, "0");
|
property_get("ro.bq.gpu_to_cpu_unsupported", value, "0");
|
||||||
mGpuToCpuSupported = !atoi(value);
|
mGpuToCpuSupported = !atoi(value);
|
||||||
|
|
||||||
|
property_get("debug.sf.drop_missed_frames", value, "0");
|
||||||
|
mDropMissedFrames = atoi(value);
|
||||||
|
|
||||||
property_get("debug.sf.showupdates", value, "0");
|
property_get("debug.sf.showupdates", value, "0");
|
||||||
mDebugRegion = atoi(value);
|
mDebugRegion = atoi(value);
|
||||||
|
|
||||||
|
@ -919,12 +922,31 @@ bool SurfaceFlinger::handleMessageInvalidate() {
|
||||||
|
|
||||||
void SurfaceFlinger::handleMessageRefresh() {
|
void SurfaceFlinger::handleMessageRefresh() {
|
||||||
ATRACE_CALL();
|
ATRACE_CALL();
|
||||||
preComposition();
|
|
||||||
rebuildLayerStacks();
|
static nsecs_t previousExpectedPresent = 0;
|
||||||
setUpHWComposer();
|
nsecs_t expectedPresent = mPrimaryDispSync.computeNextRefresh(0);
|
||||||
doDebugFlashRegions();
|
static bool previousFrameMissed = false;
|
||||||
doComposition();
|
bool frameMissed = (expectedPresent == previousExpectedPresent);
|
||||||
postComposition();
|
if (frameMissed != previousFrameMissed) {
|
||||||
|
ATRACE_INT("FrameMissed", static_cast<int>(frameMissed));
|
||||||
|
}
|
||||||
|
previousFrameMissed = frameMissed;
|
||||||
|
|
||||||
|
if (CC_UNLIKELY(mDropMissedFrames && frameMissed)) {
|
||||||
|
// Latch buffers, but don't send anything to HWC, then signal another
|
||||||
|
// wakeup for the next vsync
|
||||||
|
preComposition();
|
||||||
|
repaintEverything();
|
||||||
|
} else {
|
||||||
|
preComposition();
|
||||||
|
rebuildLayerStacks();
|
||||||
|
setUpHWComposer();
|
||||||
|
doDebugFlashRegions();
|
||||||
|
doComposition();
|
||||||
|
postComposition();
|
||||||
|
}
|
||||||
|
|
||||||
|
previousExpectedPresent = mPrimaryDispSync.computeNextRefresh(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceFlinger::doDebugFlashRegions()
|
void SurfaceFlinger::doDebugFlashRegions()
|
||||||
|
|
|
@ -445,6 +445,7 @@ private:
|
||||||
RenderEngine* mRenderEngine;
|
RenderEngine* mRenderEngine;
|
||||||
nsecs_t mBootTime;
|
nsecs_t mBootTime;
|
||||||
bool mGpuToCpuSupported;
|
bool mGpuToCpuSupported;
|
||||||
|
bool mDropMissedFrames;
|
||||||
sp<EventThread> mEventThread;
|
sp<EventThread> mEventThread;
|
||||||
sp<EventThread> mSFEventThread;
|
sp<EventThread> mSFEventThread;
|
||||||
sp<EventControlThread> mEventControlThread;
|
sp<EventControlThread> mEventControlThread;
|
||||||
|
|
Loading…
Reference in New Issue