Initialize DisplayData fences to NO_FENCE, not NULL
Also fix another place that was checking for NULL fence rather than
Fence::isValid().
Bug 8283950
Change-Id: Ie06db327eb416828d8dac139171d96d4470b2e35
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 09a1c59..ee3e93b 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -892,7 +892,7 @@
const HWComposer& hwc = getHwComposer();
sp<Fence> presentFence = hwc.getDisplayFence(HWC_DISPLAY_PRIMARY);
- if (presentFence != NULL) {
+ if (presentFence->isValid()) {
mAnimFrameTracker.setActualPresentFence(presentFence);
} else {
// The HWC doesn't support present fences, so use the refresh