summaryrefslogtreecommitdiff
authorStark Li <stark.li@amlogic.com>2017-03-16 10:43:07 (GMT)
committer wenbiao.zhang <wenbiao.zhang@amlogic.com>2017-03-17 05:31:39 (GMT)
commitd99e8b6315e3af3a76218ea5b6ddc9bf6a4b887b (patch)
treea25410efb70d652a7705987033b59f5358966a4f
parent983bc2816b40b0d10f9652f05894a1033d182e91 (diff)
downloadhwcomposer-d99e8b6315e3af3a76218ea5b6ddc9bf6a4b887b.zip
hwcomposer-d99e8b6315e3af3a76218ea5b6ddc9bf6a4b887b.tar.gz
hwcomposer-d99e8b6315e3af3a76218ea5b6ddc9bf6a4b887b.tar.bz2
PD#140795: fix video is blanked by cursor layer
Change-Id: Id067ef5d1a94bb491a2f56be59c783ac82ca790a
Diffstat
-rw-r--r--hwc2/common/devices/PhysicalDevice.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/hwc2/common/devices/PhysicalDevice.cpp b/hwc2/common/devices/PhysicalDevice.cpp
index 0a6b903..fda3773 100644
--- a/hwc2/common/devices/PhysicalDevice.cpp
+++ b/hwc2/common/devices/PhysicalDevice.cpp
@@ -647,6 +647,7 @@ int32_t PhysicalDevice::postFramebuffer(int32_t* outRetireFence, bool hasVideoOv
framebuffer_info_t fbInfo = *(mFramebufferContext->getInfo());
framebuffer_info_t* cbInfo = mCursorContext->getInfo();
bool cursorShow = false;
+ bool haveCursorLayer = false;
for (uint32_t i=0; i<mHwcLayers.size(); i++) {
hwc2_layer_t layerId = mHwcLayers.keyAt(i);
layer = mHwcLayers.valueAt(i);
@@ -656,6 +657,7 @@ int32_t PhysicalDevice::postFramebuffer(int32_t* outRetireFence, bool hasVideoOv
ETRACE("invalid cursor layer handle.");
break;
}
+ haveCursorLayer = true;
DTRACE("This is a Sprite, hnd->stride is %d, hnd->height is %d", hnd->stride, hnd->height);
if (cbInfo->info.xres != (uint32_t)hnd->stride || cbInfo->info.yres != (uint32_t)hnd->height) {
ETRACE("disp: %d cursor need to redrew", mId);
@@ -691,18 +693,19 @@ int32_t PhysicalDevice::postFramebuffer(int32_t* outRetireFence, bool hasVideoOv
#endif
fbInfo.renderMode = mRenderMode;
- bool onlyOneVideoLayer = false;
- if (hasVideoOverlay && mHwcLayers.size() == 1) onlyOneVideoLayer = true;
+ bool needBlankFb0 = false;
+ uint32_t layerNum = mHwcLayers.size();
+ if (hasVideoOverlay && (layerNum == 1 || (layerNum == 2 && haveCursorLayer))) needBlankFb0 = true;
if (mIsContinuousBuf) {
// bit 0 is osd blank flag.
fbInfo.op &= ~0x00000001;
- if (onlyOneVideoLayer) {
+ if (needBlankFb0) {
fbInfo.op |= 0x00000001;
}
- mFramebufferContext->setStatus(onlyOneVideoLayer);
+ mFramebufferContext->setStatus(needBlankFb0);
} else {
- setOSD0Blank(onlyOneVideoLayer);
+ setOSD0Blank(needBlankFb0);
}
if (!mClientTargetHnd || private_handle_t::validate(mClientTargetHnd) < 0 || mPowerMode == HWC2_POWER_MODE_OFF) {