Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Overlay: Close channels on s3d format change
Browse files Browse the repository at this point in the history
Fix 3d to 2d video switch, make sure params are cleared and pipes closed.
Fix other 3D regressions coming out of external connect-disconnect.

CRs-fixed: 349421
(cherry picked from commit 2ec3805)

Change-Id: Ie6ba0aca2acf580081bcd6d293ddecef4143c6b3
  • Loading branch information
Saurabh Shah authored and Gopal G Goberu committed Jun 3, 2012
1 parent b4dfe2d commit 38e9300
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions liboverlay/overlayLib.cpp
Expand Up @@ -673,16 +673,14 @@ bool Overlay::setSource(const overlay_buffer_info& info, int orientation,
}

if (stateChange) {
if (mState != -1) {
if ((mState == OV_3D_VIDEO_3D_PANEL) ||
(mState == OV_3D_VIDEO_3D_TV) ||
(newState == OV_3D_VIDEO_3D_PANEL) ||
(newState == OV_3D_VIDEO_3D_TV)) {
LOGI("S3D state transition: closing the channels");
closeChannel();
isHDMIStateChange = false;
isS3DFormatChange = false;
}
if (isS3DFormatChange ||
(mState == OV_3D_VIDEO_3D_PANEL) ||
(mState == OV_3D_VIDEO_3D_TV) ||
(newState == OV_3D_VIDEO_3D_PANEL) ||
(newState == OV_3D_VIDEO_3D_TV)) {
LOGI("S3D state transition: closing the channels");
closeChannel();
isHDMIStateChange = false;
}
mExternalDisplay = hdmiConnected;
mState = newState;
Expand All @@ -703,10 +701,8 @@ bool Overlay::setSource(const overlay_buffer_info& info, int orientation,
closeExternalChannel();
break;
}
else if(!isS3DFormatChange)
return startChannel(info, FRAMEBUFFER_0, noRot, false,
mS3DFormat, VG0_PIPE, flags, num_buffers);
break;
return startChannel(info, FRAMEBUFFER_0, noRot, false,
mS3DFormat, VG0_PIPE, flags, num_buffers);
case OV_3D_VIDEO_3D_PANEL:
if (sHDMIAsPrimary) {
noRot = true;
Expand Down Expand Up @@ -737,7 +733,7 @@ bool Overlay::setSource(const overlay_buffer_info& info, int orientation,
LOGE("%s:failed to open channel %d", __func__, VG1_PIPE);
return false;
}
} else if (!isS3DFormatChange) {
} else {
for (int i=0; i<NUM_CHANNELS; i++) {
fbnum = i;
//start two channels for one for primary and external.
Expand Down Expand Up @@ -1483,6 +1479,16 @@ bool OverlayControlChannel::closeControlChannel() {

mOVInfo.z_order = NO_PIPE;
mFD = -1;
mNoRot = false;
mFBNum = -1;
mFBWidth = 0;
mFBHeight = 0;
mFBbpp = 0;
mFBystride = 0;
mFormat = 0;
mSize = 0;
mOrientation = 0;
mFormat3D = 0;

return true;
}
Expand Down Expand Up @@ -1913,6 +1919,13 @@ bool OverlayDataChannel::closeDataChannel() {

mNumBuffers = 0;
mCurrentItem = 0;
mNoRot = false;
mSecure = false;
mPmemAddr = 0;
mPmemOffset = 0;
mNewPmemOffset = 0;
mUpdateDataChannel = false;
mBufferType = 0;

return true;
}
Expand Down

0 comments on commit 38e9300

Please sign in to comment.