Revert "display: Add BufferMirrorMode support for External"

This reverts commit 027d96511c.
This commit is contained in:
Ramkumar Radhakrishnan
2013-08-22 13:31:33 -07:00
parent c2f58ae4b3
commit dc4aeb53da
9 changed files with 16 additions and 95 deletions

View File

@@ -116,10 +116,6 @@ bool FBUpdateLowRes::configure(hwc_context_t *ctx, hwc_display_contents_1 *list,
ovutils::eTransform orient = ovutils::eTransform orient =
static_cast<ovutils::eTransform>(transform); static_cast<ovutils::eTransform>(transform);
// use ext orientation if any
int extOrient = ctx->mExtOrientation;
if(ctx->mBufferMirrorMode)
extOrient = getMirrorModeOrientation(ctx);
// Do not use getNonWormholeRegion() function to calculate the // Do not use getNonWormholeRegion() function to calculate the
// sourceCrop during animation on external display and // sourceCrop during animation on external display and
@@ -129,7 +125,7 @@ bool FBUpdateLowRes::configure(hwc_context_t *ctx, hwc_display_contents_1 *list,
sourceCrop = layer->displayFrame; sourceCrop = layer->displayFrame;
displayFrame = sourceCrop; displayFrame = sourceCrop;
} else if((!mDpy || } else if((!mDpy ||
(mDpy && !extOrient (mDpy && !ctx->mExtOrientation
&& !ctx->dpyAttr[mDpy].mDownScaleMode)) && !ctx->dpyAttr[mDpy].mDownScaleMode))
&& (extOnlyLayerIndex == -1)) { && (extOnlyLayerIndex == -1)) {
if(!qdutils::MDPVersion::getInstance().is8x26()) { if(!qdutils::MDPVersion::getInstance().is8x26()) {
@@ -138,12 +134,13 @@ bool FBUpdateLowRes::configure(hwc_context_t *ctx, hwc_display_contents_1 *list,
} }
} }
if(mDpy && !qdutils::MDPVersion::getInstance().is8x26()) { if(mDpy && !qdutils::MDPVersion::getInstance().is8x26()) {
if(extOrient || ctx->dpyAttr[mDpy].mDownScaleMode) { if(ctx->mExtOrientation || ctx->dpyAttr[mDpy].mDownScaleMode) {
calcExtDisplayPosition(ctx, mDpy, sourceCrop, displayFrame); calcExtDisplayPosition(ctx, mDpy, sourceCrop, displayFrame);
// If there is a external orientation set, use that // If there is a external orientation set, use that
if(extOrient) { if(ctx->mExtOrientation) {
transform = extOrient; transform = ctx->mExtOrientation;
orient = static_cast<ovutils::eTransform >(extOrient); orient =
static_cast<ovutils::eTransform >(ctx->mExtOrientation);
} }
} }
// Calculate the actionsafe dimensions for External(dpy = 1 or 2) // Calculate the actionsafe dimensions for External(dpy = 1 or 2)
@@ -151,7 +148,7 @@ bool FBUpdateLowRes::configure(hwc_context_t *ctx, hwc_display_contents_1 *list,
} }
setMdpFlags(layer, mdpFlags, 0, transform); setMdpFlags(layer, mdpFlags, 0, transform);
// For External use rotator if there is a rotation value set // For External use rotator if there is a rotation value set
if(mDpy && (extOrient & HWC_TRANSFORM_ROT_90)) { if(mDpy && (ctx->mExtOrientation & HWC_TRANSFORM_ROT_90)) {
mRot = ctx->mRotMgr->getNext(); mRot = ctx->mRotMgr->getNext();
if(mRot == NULL) return -1; if(mRot == NULL) return -1;
//Configure rotator for pre-rotation //Configure rotator for pre-rotation

View File

@@ -64,9 +64,6 @@ status_t QClient::notifyCallback(uint32_t msg, uint32_t value) {
case IQService::EXTERNAL_ORIENTATION: case IQService::EXTERNAL_ORIENTATION:
setExtOrientation(value); setExtOrientation(value);
break; break;
case IQService::BUFFER_MIRRORMODE:
setBufferMirrorMode(value);
break;
default: default:
return NO_ERROR; return NO_ERROR;
} }
@@ -121,8 +118,4 @@ void QClient::setExtOrientation(uint32_t orientation) {
mHwcContext->mExtOrientation = orientation; mHwcContext->mExtOrientation = orientation;
} }
void QClient::setBufferMirrorMode(uint32_t enable) {
mHwcContext->mBufferMirrorMode = enable;
}
} }

View File

@@ -61,7 +61,6 @@ private:
void unsecuring(uint32_t startEnd); void unsecuring(uint32_t startEnd);
android::status_t screenRefresh(); android::status_t screenRefresh();
void setExtOrientation(uint32_t orientation); void setExtOrientation(uint32_t orientation);
void setBufferMirrorMode(uint32_t enable);
hwc_context_t *mHwcContext; hwc_context_t *mHwcContext;
const android::sp<android::IMediaDeathNotifier> mMPDeathNotifier; const android::sp<android::IMediaDeathNotifier> mMPDeathNotifier;

View File

@@ -196,8 +196,6 @@ void initContext(hwc_context_t *ctx)
ctx->mPrevDestVideo.right = ctx->mPrevDestVideo.bottom = 0; ctx->mPrevDestVideo.right = ctx->mPrevDestVideo.bottom = 0;
ctx->mPrevTransformVideo = 0; ctx->mPrevTransformVideo = 0;
ctx->mBufferMirrorMode = false;
ALOGI("Initializing Qualcomm Hardware Composer"); ALOGI("Initializing Qualcomm Hardware Composer");
ALOGI("MDP version: %d", ctx->mMDP.version); ALOGI("MDP version: %d", ctx->mMDP.version);
} }
@@ -299,11 +297,7 @@ void getActionSafePosition(hwc_context_t *ctx, int dpy, hwc_rect_t& rect) {
float fbHeight = ctx->dpyAttr[dpy].yres; float fbHeight = ctx->dpyAttr[dpy].yres;
// Since external is rotated 90, need to swap width/height // Since external is rotated 90, need to swap width/height
int extOrient = ctx->mExtOrientation; if(ctx->mExtOrientation & HWC_TRANSFORM_ROT_90)
if(ctx->mBufferMirrorMode)
extOrient = getMirrorModeOrientation(ctx);
if(extOrient & HWC_TRANSFORM_ROT_90)
swap(fbWidth, fbHeight); swap(fbWidth, fbHeight);
float asX = 0; float asX = 0;
@@ -502,10 +496,7 @@ void calcExtDisplayPosition(hwc_context_t *ctx, int dpy,
hwc_rect_t& sourceCrop, hwc_rect_t& sourceCrop,
hwc_rect_t& displayFrame) { hwc_rect_t& displayFrame) {
// Swap width and height when there is a 90deg transform // Swap width and height when there is a 90deg transform
int extOrient = ctx->mExtOrientation; if(ctx->mExtOrientation & HWC_TRANSFORM_ROT_90) {
if(ctx->mBufferMirrorMode)
extOrient = getMirrorModeOrientation(ctx);
if(extOrient & HWC_TRANSFORM_ROT_90) {
int dstWidth = ctx->dpyAttr[dpy].xres; int dstWidth = ctx->dpyAttr[dpy].xres;
int dstHeight = ctx->dpyAttr[dpy].yres;; int dstHeight = ctx->dpyAttr[dpy].yres;;
int srcWidth = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres; int srcWidth = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
@@ -547,26 +538,7 @@ void calcExtDisplayPosition(hwc_context_t *ctx, int dpy,
displayFrame.right *= wRatio; displayFrame.right *= wRatio;
displayFrame.bottom *= hRatio; displayFrame.bottom *= hRatio;
} }
}
/* Returns the orientation which needs to be set on External for
* SideSync/Buffer Mirrormode
*/
int getMirrorModeOrientation(hwc_context_t *ctx) {
int extOrientation = 0;
int deviceOrientation = ctx->deviceOrientation;
if(!isPrimaryPortrait(ctx))
deviceOrientation = (deviceOrientation + 1) % 4;
if (deviceOrientation == 0)
extOrientation = HWC_TRANSFORM_ROT_270;
else if (deviceOrientation == 1)//90
extOrientation = 0;
else if (deviceOrientation == 2)//180
extOrientation = HWC_TRANSFORM_ROT_90;
else if (deviceOrientation == 3)//270
extOrientation = HWC_TRANSFORM_FLIP_V | HWC_TRANSFORM_FLIP_H;
return extOrientation;
} }
bool needsScaling(hwc_context_t* ctx, hwc_layer_1_t const* layer, bool needsScaling(hwc_context_t* ctx, hwc_layer_1_t const* layer,
@@ -691,10 +663,9 @@ void setListStats(hwc_context_t *ctx,
ctx->mExtOrientation = atoi(value); */ ctx->mExtOrientation = atoi(value); */
// Assuming the orientation value is in terms of HAL_TRANSFORM, // Assuming the orientation value is in terms of HAL_TRANSFORM,
// This needs mapping to HAL, if its in different convention // This needs mapping to HAL, if its in different convention
if(ctx->mExtOrientation || ctx->mBufferMirrorMode) { if(ctx->mExtOrientation) {
ALOGD_IF(HWC_UTILS_DEBUG, "%s: ext orientation = %d" ALOGD_IF(HWC_UTILS_DEBUG, "%s: ext orientation = %d",
"BufferMirrorMode = %d", __FUNCTION__, __FUNCTION__, ctx->mExtOrientation);
ctx->mExtOrientation, ctx->mBufferMirrorMode);
if(ctx->mOverlay->isPipeTypeAttached(OV_MDP_PIPE_DMA)) { if(ctx->mOverlay->isPipeTypeAttached(OV_MDP_PIPE_DMA)) {
ctx->isPaddingRound = true; ctx->isPaddingRound = true;
} }
@@ -1194,15 +1165,12 @@ int configureLowRes(hwc_context_t *ctx, hwc_layer_1_t *layer,
} }
} }
if(dpy) { if(dpy) {
int extOrient = ctx->mExtOrientation;
if(ctx->mBufferMirrorMode)
extOrient = getMirrorModeOrientation(ctx);
// Just need to set the position to portrait as the transformation // Just need to set the position to portrait as the transformation
// will already be set to required orientation on TV // will already be set to required orientation on TV
if(extOrient || ctx->dpyAttr[dpy].mDownScaleMode) { if(ctx->mExtOrientation || ctx->dpyAttr[dpy].mDownScaleMode) {
getAspectRatioPosition(ctx, dpy, extOrient, dst, dst); getAspectRatioPosition(ctx, dpy, ctx->mExtOrientation, dst, dst);
if(extOrient) { if(ctx->mExtOrientation) {
transform = extOrient; transform = ctx->mExtOrientation;
orient = static_cast<eTransform>(transform); orient = static_cast<eTransform>(transform);
} }
} }

View File

@@ -193,9 +193,6 @@ void calcExtDisplayPosition(hwc_context_t *ctx,
int dpy, int dpy,
hwc_rect_t& sourceCrop, hwc_rect_t& sourceCrop,
hwc_rect_t& displayFrame); hwc_rect_t& displayFrame);
// Returns the orientation that needs to be set on external for
// BufferMirrirMode(Sidesync)
int getMirrorModeOrientation(hwc_context_t *ctx);
//Close acquireFenceFds of all layers of incoming list //Close acquireFenceFds of all layers of incoming list
void closeAcquireFds(hwc_display_contents_1_t* list); void closeAcquireFds(hwc_display_contents_1_t* list);
@@ -374,11 +371,6 @@ struct hwc_context_t {
int mExtOrientation; int mExtOrientation;
//Flags the transition of a video session //Flags the transition of a video session
bool mVideoTransFlag; bool mVideoTransFlag;
//Used for SideSync feature
//which overrides the mExtOrientation
bool mBufferMirrorMode;
qhwc::LayerRotMap *mLayerRotMap[HWC_NUM_DISPLAY_TYPES]; qhwc::LayerRotMap *mLayerRotMap[HWC_NUM_DISPLAY_TYPES];
}; };

View File

@@ -78,13 +78,6 @@ public:
data.writeInt32(orientation); data.writeInt32(orientation);
remote()->transact(EXTERNAL_ORIENTATION, data, &reply); remote()->transact(EXTERNAL_ORIENTATION, data, &reply);
} }
virtual void setBufferMirrorMode(uint32_t enable) {
Parcel data, reply;
data.writeInterfaceToken(IQService::getInterfaceDescriptor());
data.writeInt32(enable);
remote()->transact(BUFFER_MIRRORMODE, data, &reply);
}
}; };
IMPLEMENT_META_INTERFACE(QService, "android.display.IQService"); IMPLEMENT_META_INTERFACE(QService, "android.display.IQService");
@@ -167,18 +160,6 @@ status_t BnQService::onTransact(
setExtOrientation(orientation); setExtOrientation(orientation);
return NO_ERROR; return NO_ERROR;
} break; } break;
case BUFFER_MIRRORMODE: {
CHECK_INTERFACE(IQService, data, reply);
if(callerUid != AID_SYSTEM) {
ALOGE("display.qservice BUFFER_MIRRORMODE access denied: \
pid=%d uid=%d process=%s",callerPid,
callerUid, callingProcName);
return PERMISSION_DENIED;
}
uint32_t enable = data.readInt32();
setBufferMirrorMode(enable);
return NO_ERROR;
} break;
default: default:
return BBinder::onTransact(code, data, reply, flags); return BBinder::onTransact(code, data, reply, flags);
} }

View File

@@ -42,7 +42,6 @@ public:
CONNECT, CONNECT,
SCREEN_REFRESH, SCREEN_REFRESH,
EXTERNAL_ORIENTATION, EXTERNAL_ORIENTATION,
BUFFER_MIRRORMODE,
}; };
enum { enum {
END = 0, END = 0,
@@ -53,7 +52,6 @@ public:
virtual void connect(const android::sp<qClient::IQClient>& client) = 0; virtual void connect(const android::sp<qClient::IQClient>& client) = 0;
virtual android::status_t screenRefresh() = 0; virtual android::status_t screenRefresh() = 0;
virtual void setExtOrientation(uint32_t orientation) = 0; virtual void setExtOrientation(uint32_t orientation) = 0;
virtual void setBufferMirrorMode(uint32_t enable) = 0;
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -77,12 +77,6 @@ void QService::setExtOrientation(uint32_t orientation) {
} }
} }
void QService::setBufferMirrorMode(uint32_t enable) {
if(mClient.get()) {
mClient->notifyCallback(BUFFER_MIRRORMODE, enable);
}
}
void QService::init() void QService::init()
{ {
if(!sQService) { if(!sQService) {

View File

@@ -50,7 +50,6 @@ public:
virtual void connect(const android::sp<qClient::IQClient>& client); virtual void connect(const android::sp<qClient::IQClient>& client);
virtual android::status_t screenRefresh(); virtual android::status_t screenRefresh();
virtual void setExtOrientation(uint32_t orientation); virtual void setExtOrientation(uint32_t orientation);
virtual void setBufferMirrorMode(uint32_t enable);
static void init(); static void init();
private: private:
QService(); QService();