Revert "display: Add BufferMirrorMode support for External"
This reverts commit 027d96511c3c5794f200ef1e8c3ef8f264a80d33.
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index a0f5faa..7c2e643 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -116,10 +116,6 @@
ovutils::eTransform orient =
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
// sourceCrop during animation on external display and
@@ -129,7 +125,7 @@
sourceCrop = layer->displayFrame;
displayFrame = sourceCrop;
} else if((!mDpy ||
- (mDpy && !extOrient
+ (mDpy && !ctx->mExtOrientation
&& !ctx->dpyAttr[mDpy].mDownScaleMode))
&& (extOnlyLayerIndex == -1)) {
if(!qdutils::MDPVersion::getInstance().is8x26()) {
@@ -138,12 +134,13 @@
}
}
if(mDpy && !qdutils::MDPVersion::getInstance().is8x26()) {
- if(extOrient || ctx->dpyAttr[mDpy].mDownScaleMode) {
+ if(ctx->mExtOrientation || ctx->dpyAttr[mDpy].mDownScaleMode) {
calcExtDisplayPosition(ctx, mDpy, sourceCrop, displayFrame);
// If there is a external orientation set, use that
- if(extOrient) {
- transform = extOrient;
- orient = static_cast<ovutils::eTransform >(extOrient);
+ if(ctx->mExtOrientation) {
+ transform = ctx->mExtOrientation;
+ orient =
+ static_cast<ovutils::eTransform >(ctx->mExtOrientation);
}
}
// Calculate the actionsafe dimensions for External(dpy = 1 or 2)
@@ -151,7 +148,7 @@
}
setMdpFlags(layer, mdpFlags, 0, transform);
// 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();
if(mRot == NULL) return -1;
//Configure rotator for pre-rotation
diff --git a/libhwcomposer/hwc_qclient.cpp b/libhwcomposer/hwc_qclient.cpp
index 5d7d4d3..c20f5c1 100644
--- a/libhwcomposer/hwc_qclient.cpp
+++ b/libhwcomposer/hwc_qclient.cpp
@@ -64,9 +64,6 @@
case IQService::EXTERNAL_ORIENTATION:
setExtOrientation(value);
break;
- case IQService::BUFFER_MIRRORMODE:
- setBufferMirrorMode(value);
- break;
default:
return NO_ERROR;
}
@@ -121,8 +118,4 @@
mHwcContext->mExtOrientation = orientation;
}
-void QClient::setBufferMirrorMode(uint32_t enable) {
- mHwcContext->mBufferMirrorMode = enable;
-}
-
}
diff --git a/libhwcomposer/hwc_qclient.h b/libhwcomposer/hwc_qclient.h
index 848d8d2..4cbabef 100644
--- a/libhwcomposer/hwc_qclient.h
+++ b/libhwcomposer/hwc_qclient.h
@@ -61,7 +61,6 @@
void unsecuring(uint32_t startEnd);
android::status_t screenRefresh();
void setExtOrientation(uint32_t orientation);
- void setBufferMirrorMode(uint32_t enable);
hwc_context_t *mHwcContext;
const android::sp<android::IMediaDeathNotifier> mMPDeathNotifier;
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index fa3c15f..e013876 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -196,8 +196,6 @@
ctx->mPrevDestVideo.right = ctx->mPrevDestVideo.bottom = 0;
ctx->mPrevTransformVideo = 0;
- ctx->mBufferMirrorMode = false;
-
ALOGI("Initializing Qualcomm Hardware Composer");
ALOGI("MDP version: %d", ctx->mMDP.version);
}
@@ -299,11 +297,7 @@
float fbHeight = ctx->dpyAttr[dpy].yres;
// Since external is rotated 90, need to swap width/height
- int extOrient = ctx->mExtOrientation;
- if(ctx->mBufferMirrorMode)
- extOrient = getMirrorModeOrientation(ctx);
-
- if(extOrient & HWC_TRANSFORM_ROT_90)
+ if(ctx->mExtOrientation & HWC_TRANSFORM_ROT_90)
swap(fbWidth, fbHeight);
float asX = 0;
@@ -502,10 +496,7 @@
hwc_rect_t& sourceCrop,
hwc_rect_t& displayFrame) {
// Swap width and height when there is a 90deg transform
- int extOrient = ctx->mExtOrientation;
- if(ctx->mBufferMirrorMode)
- extOrient = getMirrorModeOrientation(ctx);
- if(extOrient & HWC_TRANSFORM_ROT_90) {
+ if(ctx->mExtOrientation & HWC_TRANSFORM_ROT_90) {
int dstWidth = ctx->dpyAttr[dpy].xres;
int dstHeight = ctx->dpyAttr[dpy].yres;;
int srcWidth = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
@@ -547,26 +538,7 @@
displayFrame.right *= wRatio;
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,
@@ -691,10 +663,9 @@
ctx->mExtOrientation = atoi(value); */
// Assuming the orientation value is in terms of HAL_TRANSFORM,
// This needs mapping to HAL, if its in different convention
- if(ctx->mExtOrientation || ctx->mBufferMirrorMode) {
- ALOGD_IF(HWC_UTILS_DEBUG, "%s: ext orientation = %d"
- "BufferMirrorMode = %d", __FUNCTION__,
- ctx->mExtOrientation, ctx->mBufferMirrorMode);
+ if(ctx->mExtOrientation) {
+ ALOGD_IF(HWC_UTILS_DEBUG, "%s: ext orientation = %d",
+ __FUNCTION__, ctx->mExtOrientation);
if(ctx->mOverlay->isPipeTypeAttached(OV_MDP_PIPE_DMA)) {
ctx->isPaddingRound = true;
}
@@ -1194,15 +1165,12 @@
}
}
if(dpy) {
- int extOrient = ctx->mExtOrientation;
- if(ctx->mBufferMirrorMode)
- extOrient = getMirrorModeOrientation(ctx);
// Just need to set the position to portrait as the transformation
// will already be set to required orientation on TV
- if(extOrient || ctx->dpyAttr[dpy].mDownScaleMode) {
- getAspectRatioPosition(ctx, dpy, extOrient, dst, dst);
- if(extOrient) {
- transform = extOrient;
+ if(ctx->mExtOrientation || ctx->dpyAttr[dpy].mDownScaleMode) {
+ getAspectRatioPosition(ctx, dpy, ctx->mExtOrientation, dst, dst);
+ if(ctx->mExtOrientation) {
+ transform = ctx->mExtOrientation;
orient = static_cast<eTransform>(transform);
}
}
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 71b51ab..8809493 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -193,9 +193,6 @@
int dpy,
hwc_rect_t& sourceCrop,
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
void closeAcquireFds(hwc_display_contents_1_t* list);
@@ -374,11 +371,6 @@
int mExtOrientation;
//Flags the transition of a video session
bool mVideoTransFlag;
-
- //Used for SideSync feature
- //which overrides the mExtOrientation
- bool mBufferMirrorMode;
-
qhwc::LayerRotMap *mLayerRotMap[HWC_NUM_DISPLAY_TYPES];
};
diff --git a/libqservice/IQService.cpp b/libqservice/IQService.cpp
index e45f42e..a3ff150 100644
--- a/libqservice/IQService.cpp
+++ b/libqservice/IQService.cpp
@@ -78,13 +78,6 @@
data.writeInt32(orientation);
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");
@@ -167,18 +160,6 @@
setExtOrientation(orientation);
return NO_ERROR;
} 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:
return BBinder::onTransact(code, data, reply, flags);
}
diff --git a/libqservice/IQService.h b/libqservice/IQService.h
index 149cd8b..ff034be 100644
--- a/libqservice/IQService.h
+++ b/libqservice/IQService.h
@@ -42,7 +42,6 @@
CONNECT,
SCREEN_REFRESH,
EXTERNAL_ORIENTATION,
- BUFFER_MIRRORMODE,
};
enum {
END = 0,
@@ -53,7 +52,6 @@
virtual void connect(const android::sp<qClient::IQClient>& client) = 0;
virtual android::status_t screenRefresh() = 0;
virtual void setExtOrientation(uint32_t orientation) = 0;
- virtual void setBufferMirrorMode(uint32_t enable) = 0;
};
// ----------------------------------------------------------------------------
diff --git a/libqservice/QService.cpp b/libqservice/QService.cpp
index a8c5dca..f780a75 100644
--- a/libqservice/QService.cpp
+++ b/libqservice/QService.cpp
@@ -77,12 +77,6 @@
}
}
-void QService::setBufferMirrorMode(uint32_t enable) {
- if(mClient.get()) {
- mClient->notifyCallback(BUFFER_MIRRORMODE, enable);
- }
-}
-
void QService::init()
{
if(!sQService) {
diff --git a/libqservice/QService.h b/libqservice/QService.h
index a241d44..8eefa21 100644
--- a/libqservice/QService.h
+++ b/libqservice/QService.h
@@ -50,7 +50,6 @@
virtual void connect(const android::sp<qClient::IQClient>& client);
virtual android::status_t screenRefresh();
virtual void setExtOrientation(uint32_t orientation);
- virtual void setBufferMirrorMode(uint32_t enable);
static void init();
private:
QService();