summaryrefslogtreecommitdiff
authorsky zhou <sky.zhou@amlogic.com>2017-09-04 14:49:39 (GMT)
committer sky zhou <sky.zhou@amlogic.com>2017-09-04 14:51:16 (GMT)
commit5d8f6a1c4aad091434ebfc15110fee8a04502197 (patch)
treeef70903b67e15e3f00c7fbd9c6d12bd54de57fc1
parentf1ac07f320abbb28366e070fd1829ecbe680bb70 (diff)
downloadhwcomposer-5d8f6a1c4aad091434ebfc15110fee8a04502197.zip
hwcomposer-5d8f6a1c4aad091434ebfc15110fee8a04502197.tar.gz
hwcomposer-5d8f6a1c4aad091434ebfc15110fee8a04502197.tar.bz2
hwcomposer: use hwc_fb_post_xxx instead of fb_post_xxx api. [3/3]
PD#148907 Post buffer hnd to osd instead of buffer offset, after we change to ion framebuffer. Change-Id: Ia61f1f6669c25204e334ec012e316af6be749f15
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) {