hwc: 8x26: Composition policy when WFD connected

When WFD is connected to 8x26
1) On Video transition, have 1 padding round if external connected.
Required to shift pipes across mixers.
2) Request DMA pipe always for FB on WFD.
Necessary for rotation + writeback
3) Disable non-worm-hole calcs on external (because of 2)
4) Disable action-safe calcs on external (because of 2)

Change-Id: I63b50b2477db443f9ea1d3fa610b59295c9359b7
This commit is contained in:
Saurabh Shah
2013-06-17 11:33:53 -07:00
parent a168617b59
commit d4e6585258
5 changed files with 30 additions and 7 deletions

View File

@@ -88,7 +88,6 @@ static void hwc_registerProcs(struct hwc_composer_device_1* dev,
//Helper //Helper
static void reset(hwc_context_t *ctx, int numDisplays, static void reset(hwc_context_t *ctx, int numDisplays,
hwc_display_contents_1_t** displays) { hwc_display_contents_1_t** displays) {
memset(ctx->listStats, 0, sizeof(ctx->listStats));
for(int i = 0; i < MAX_DISPLAYS; i++) { for(int i = 0; i < MAX_DISPLAYS; i++) {
hwc_display_contents_1_t *list = displays[i]; hwc_display_contents_1_t *list = displays[i];
// XXX:SurfaceFlinger no longer guarantees that this // XXX:SurfaceFlinger no longer guarantees that this
@@ -497,6 +496,7 @@ static int hwc_set(hwc_composer_device_1 *dev,
// frames to the display. // frames to the display.
CALC_FPS(); CALC_FPS();
MDPComp::resetIdleFallBack(); MDPComp::resetIdleFallBack();
ctx->mVideoTransFlag = false;
return ret; return ret;
} }

View File

@@ -82,8 +82,13 @@ bool FBUpdateLowRes::configure(hwc_context_t *ctx, hwc_display_contents_1 *list,
ovutils::Whf info(hnd->width, hnd->height, ovutils::Whf info(hnd->width, hnd->height,
ovutils::getMdpFormat(hnd->format), hnd->size); ovutils::getMdpFormat(hnd->format), hnd->size);
//Request an RGB pipe //Request a pipe
ovutils::eDest dest = ov.nextPipe(ovutils::OV_MDP_PIPE_ANY, mDpy); ovutils::eMdpPipeType type = ovutils::OV_MDP_PIPE_ANY;
if(qdutils::MDPVersion::getInstance().is8x26() && mDpy) {
//For 8x26 external always use DMA pipe
type = ovutils::OV_MDP_PIPE_DMA;
}
ovutils::eDest dest = ov.nextPipe(type, mDpy);
if(dest == ovutils::OV_INVALID) { //None available if(dest == ovutils::OV_INVALID) { //None available
ALOGE("%s: No pipes available to configure fb for dpy %d", ALOGE("%s: No pipes available to configure fb for dpy %d",
__FUNCTION__, mDpy); __FUNCTION__, mDpy);
@@ -119,15 +124,17 @@ bool FBUpdateLowRes::configure(hwc_context_t *ctx, hwc_display_contents_1 *list,
displayFrame = sourceCrop; displayFrame = sourceCrop;
} else if((!mDpy || (mDpy && !ctx->mExtOrientation)) } else if((!mDpy || (mDpy && !ctx->mExtOrientation))
&& extOnlyLayerIndex == -1) { && extOnlyLayerIndex == -1) {
if(!qdutils::MDPVersion::getInstance().is8x26()) {
getNonWormholeRegion(list, sourceCrop); getNonWormholeRegion(list, sourceCrop);
displayFrame = sourceCrop; displayFrame = sourceCrop;
} }
}
ovutils::Dim dpos(displayFrame.left, ovutils::Dim dpos(displayFrame.left,
displayFrame.top, displayFrame.top,
displayFrame.right - displayFrame.left, displayFrame.right - displayFrame.left,
displayFrame.bottom - displayFrame.top); displayFrame.bottom - displayFrame.top);
if(mDpy) { if(mDpy && !qdutils::MDPVersion::getInstance().is8x26()) {
// Get Aspect Ratio for external // Get Aspect Ratio for external
getAspectRatioPosition(ctx, mDpy, ctx->mExtOrientation, dpos.x, getAspectRatioPosition(ctx, mDpy, ctx->mExtOrientation, dpos.x,
dpos.y, dpos.w, dpos.h); dpos.y, dpos.w, dpos.h);

View File

@@ -366,6 +366,13 @@ bool MDPComp::isFrameDoable(hwc_context_t *ctx) {
if(!isEnabled()) { if(!isEnabled()) {
ALOGD_IF(isDebug(),"%s: MDP Comp. not enabled.", __FUNCTION__); ALOGD_IF(isDebug(),"%s: MDP Comp. not enabled.", __FUNCTION__);
ret = false; ret = false;
} else if(qdutils::MDPVersion::getInstance().is8x26() &&
ctx->mVideoTransFlag &&
ctx->mExtDisplay->isExternalConnected()) {
//1 Padding round to shift pipes across mixers
ALOGD_IF(isDebug(),"%s: MDP Comp. video transition padding round",
__FUNCTION__);
ret = false;
} else if(ctx->mExtDispConfiguring) { } else if(ctx->mExtDispConfiguring) {
ALOGD_IF( isDebug(),"%s: External Display connection is pending", ALOGD_IF( isDebug(),"%s: External Display connection is pending",
__FUNCTION__); __FUNCTION__);

View File

@@ -368,7 +368,8 @@ bool isAlphaPresent(hwc_layer_1_t const* layer) {
void setListStats(hwc_context_t *ctx, void setListStats(hwc_context_t *ctx,
const hwc_display_contents_1_t *list, int dpy) { const hwc_display_contents_1_t *list, int dpy) {
const int prevYuvCount = ctx->listStats[dpy].yuvCount;
memset(&ctx->listStats[dpy], 0, sizeof(ListStats));
ctx->listStats[dpy].numAppLayers = list->numHwLayers - 1; ctx->listStats[dpy].numAppLayers = list->numHwLayers - 1;
ctx->listStats[dpy].fbLayerIndex = list->numHwLayers - 1; ctx->listStats[dpy].fbLayerIndex = list->numHwLayers - 1;
ctx->listStats[dpy].skipCount = 0; ctx->listStats[dpy].skipCount = 0;
@@ -457,6 +458,12 @@ void setListStats(hwc_context_t *ctx,
Overlay::setDMAMode(Overlay::DMA_BLOCK_MODE); Overlay::setDMAMode(Overlay::DMA_BLOCK_MODE);
} }
} }
//The marking of video begin/end is useful on some targets where we need
//to have a padding round to be able to shift pipes across mixers.
if(prevYuvCount != ctx->listStats[dpy].yuvCount) {
ctx->mVideoTransFlag = true;
}
} }

View File

@@ -316,6 +316,8 @@ struct hwc_context_t {
bool isPaddingRound; bool isPaddingRound;
// External Orientation // External Orientation
int mExtOrientation; int mExtOrientation;
//Flags the transition of a video session
bool mVideoTransFlag;
}; };
namespace qhwc { namespace qhwc {