summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--hwc2/common/devices/PhysicalDevice.cpp18
-rw-r--r--hwc2/platforms/Android.mk2
2 files changed, 20 insertions, 0 deletions
diff --git a/hwc2/common/devices/PhysicalDevice.cpp b/hwc2/common/devices/PhysicalDevice.cpp
index 7311796..cf4babd 100644
--- a/hwc2/common/devices/PhysicalDevice.cpp
+++ b/hwc2/common/devices/PhysicalDevice.cpp
@@ -740,10 +740,20 @@ int32_t PhysicalDevice::postFramebuffer(int32_t* outRetireFence, bool hasVideoOv
mFbSyncRequest.op |= OSD_BLANK_OP_BIT;
mFramebufferContext->setStatus(true);
mPriorFrameRetireFence = hwc_fb_post_with_fence_locked(&fbInfo, &mFbSyncRequest, NULL);
+#if PLATFORM_SDK_VERSION >= 26 //TEMP, will remove later.
+ HwcFenceControl::wait(*outRetireFence, -1);
+ HwcFenceControl::closeFd(*outRetireFence);
+ *outRetireFence = -1;
+#endif
} else {
*outRetireFence = HwcFenceControl::dupFence(mPriorFrameRetireFence);
if (*outRetireFence >= 0) {
DTRACE("Get prior frame's retire fence %d", *outRetireFence);
+#if PLATFORM_SDK_VERSION >= 26 //TEMP, will remove later.
+ HwcFenceControl::wait(*outRetireFence, -1);
+ HwcFenceControl::closeFd(*outRetireFence);
+ *outRetireFence = -1;
+#endif
} else {
ETRACE("No valid prior frame's retire returned. %d ", *outRetireFence);
// -1 means no fence, less than -1 is some error
@@ -754,6 +764,13 @@ int32_t PhysicalDevice::postFramebuffer(int32_t* outRetireFence, bool hasVideoOv
// real post framebuffer here.
DTRACE("render type: %d", mFbSyncRequest.type);
+
+#if PLATFORM_SDK_VERSION >= 26 //TEMP, will remove later.
+ HwcFenceControl::wait(mTargetAcquireFence, -1);
+ HwcFenceControl::closeFd(mTargetAcquireFence);
+ mTargetAcquireFence = -1;
+#endif
+
if (!mIsContinuousBuf) {
mPriorFrameRetireFence = fb_post_with_fence_locked(&fbInfo, mClientTargetHnd, mTargetAcquireFence);
} else {
@@ -841,6 +858,7 @@ int32_t PhysicalDevice::presentDisplay(int32_t* outRetireFence) {
mClientTargetHnd = NULL;
+ ALOGE("presentDisplay return err %d", err);
return err;
}
diff --git a/hwc2/platforms/Android.mk b/hwc2/platforms/Android.mk
index 518d88f..31b6698 100644
--- a/hwc2/platforms/Android.mk
+++ b/hwc2/platforms/Android.mk
@@ -119,5 +119,7 @@ ifneq ($(TARGET_BUILD_VARIANT),user)
LOCAL_CFLAGS += -DHWC_TRACE_FPS
endif
+LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
+
include $(BUILD_SHARED_LIBRARY)