hwc: Don't permit rotator use under certain conditions

These include constrained targets, with external connected which could
lead to a scarcity of pipes. Furthermore owing to a scarcity of writeback
interfaces, even if pipes are available, we may not be able to still
use rotator.

Change-Id: Ie2fb4c1726f32addcace89c268a126abe0cddbe0
This commit is contained in:
Saurabh Shah
2013-05-15 16:32:13 -07:00
parent 4314d96ed6
commit e247408f06
6 changed files with 38 additions and 10 deletions

View File

@@ -382,7 +382,8 @@ void setListStats(hwc_context_t *ctx,
ctx->listStats[dpy].yuvIndices[yuvCount] = i;
yuvCount++;
if(layer->transform & HWC_TRANSFORM_ROT_90) {
if((layer->transform & HWC_TRANSFORM_ROT_90) &&
canUseRotator(ctx)) {
if(ctx->mOverlay->isPipeTypeAttached(OV_MDP_PIPE_DMA)) {
ctx->isPaddingRound = true;
}
@@ -436,7 +437,7 @@ void setListStats(hwc_context_t *ctx,
}
static inline void calc_cut(float& leftCutRatio, float& topCutRatio,
static void calc_cut(float& leftCutRatio, float& topCutRatio,
float& rightCutRatio, float& bottomCutRatio, int orient) {
if(orient & HAL_TRANSFORM_FLIP_H) {
swap(leftCutRatio, rightCutRatio);
@@ -753,7 +754,7 @@ void setMdpFlags(hwc_layer_1_t *layer,
}
}
inline int configRotator(Rotator *rot, const Whf& whf,
int configRotator(Rotator *rot, const Whf& whf,
hwc_rect_t& crop, const eMdpFlags& mdpFlags,
const eTransform& orient, const int& downscale) {
@@ -778,7 +779,7 @@ inline int configRotator(Rotator *rot, const Whf& whf,
return 0;
}
inline int configMdp(Overlay *ov, const PipeArgs& parg,
int configMdp(Overlay *ov, const PipeArgs& parg,
const eTransform& orient, const hwc_rect_t& crop,
const hwc_rect_t& pos, const MetaData_t *metadata,
const eDest& dest) {
@@ -804,7 +805,7 @@ inline int configMdp(Overlay *ov, const PipeArgs& parg,
return 0;
}
inline void updateSource(eTransform& orient, Whf& whf,
void updateSource(eTransform& orient, Whf& whf,
hwc_rect_t& crop) {
Dim srcCrop(crop.left, crop.top,
crop.right - crop.left,
@@ -1059,4 +1060,12 @@ int configureHighRes(hwc_context_t *ctx, hwc_layer_1_t *layer,
return 0;
}
bool canUseRotator(hwc_context_t *ctx) {
if(qdutils::MDPVersion::getInstance().is8x26() &&
ctx->mExtDisplay->isExternalConnected()) {
return false;
}
return true;
}
};//namespace qhwc