summaryrefslogtreecommitdiff
authorJiyu Yang <Jiyu.Yang@amlogic.com>2017-09-01 10:45:56 (GMT)
committer Jiyu Yang <Jiyu.Yang@amlogic.com>2017-09-01 13:46:41 (GMT)
commit9426f3d6aad3b9ce919a22aaa80f9d062cfcf2d1 (patch)
tree82a8edc53b49a06e6709b9f9e3a7b31a89c7d942
parentd2294215d6c4ec73f40a9fa7d9a2eb21c2c9d10f (diff)
downloadhwcomposer-9426f3d6aad3b9ce919a22aaa80f9d062cfcf2d1.zip
hwcomposer-9426f3d6aad3b9ce919a22aaa80f9d062cfcf2d1.tar.gz
hwcomposer-9426f3d6aad3b9ce919a22aaa80f9d062cfcf2d1.tar.bz2
hwc2: sync_wait in hwcomposer [5/7]
PD#149525 Change-Id: Ifcc791bb9cf4ca95496d0f3abf22aa8460d9e655
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)