From 5d8f6a1c4aad091434ebfc15110fee8a04502197 Mon Sep 17 00:00:00 2001 From: sky zhou Date: Mon, 04 Sep 2017 14:49:39 +0000 Subject: 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 --- 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) { -- cgit