summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--hwc2/common/devices/PhysicalDevice.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/hwc2/common/devices/PhysicalDevice.cpp b/hwc2/common/devices/PhysicalDevice.cpp
index f2125ef..699c4e2 100644
--- a/hwc2/common/devices/PhysicalDevice.cpp
+++ b/hwc2/common/devices/PhysicalDevice.cpp
@@ -667,6 +667,12 @@ int32_t PhysicalDevice::postFramebuffer(int32_t* outRetireFence, bool hasVideoOv
HwcLayer* layer = NULL;
void *cbuffer;
+#if PLATFORM_SDK_VERSION >= 26
+ bool bUseHwcPost = true;
+#else
+ bool bUseHwcPost = mIsContinuousBuf;
+#endif
+
// deal physical display's client target layer
framebuffer_info_t fbInfo = *(mFramebufferContext->getInfo());
framebuffer_info_t* cbInfo = mCursorContext->getInfo();
@@ -720,7 +726,7 @@ int32_t PhysicalDevice::postFramebuffer(int32_t* outRetireFence, bool hasVideoOv
if (hasVideoOverlay && (layerNum == 1 || (layerNum == 2 && haveCursorLayer)))
needBlankFb0 = true;
- if (mIsContinuousBuf) {
+ if (bUseHwcPost) {
// bit 0 is osd blank flag.
if (needBlankFb0) {
mFbSyncRequest.op |= OSD_BLANK_OP_BIT;
@@ -754,11 +760,6 @@ int32_t PhysicalDevice::postFramebuffer(int32_t* outRetireFence, bool hasVideoOv
*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
@@ -776,7 +777,7 @@ int32_t PhysicalDevice::postFramebuffer(int32_t* outRetireFence, bool hasVideoOv
mTargetAcquireFence = -1;
#endif
- if (!mIsContinuousBuf) {
+ if (!bUseHwcPost) {
mPriorFrameRetireFence = fb_post_with_fence_locked(&fbInfo, mClientTargetHnd, mTargetAcquireFence);
} else {
// acquire fence.
@@ -803,6 +804,14 @@ int32_t PhysicalDevice::postFramebuffer(int32_t* outRetireFence, bool hasVideoOv
DTRACE("UPDATE FB1 status to %d", !cursorShow);
ioctl(cbInfo->fd, FBIOBLANK, !cursorShow);
}
+
+#if PLATFORM_SDK_VERSION >= 26 //TEMP, will remove later.
+ if (*outRetireFence >= 0) {
+ HwcFenceControl::wait(*outRetireFence, -1);
+ HwcFenceControl::closeFd(*outRetireFence);
+ *outRetireFence = -1;
+ }
+#endif
}
if (mRenderMode != GE2D_COMPOSE_MODE) {