hwc: Remove external only feature related code
External only feature is completely handled in surfaceflinger, remove
unwanted code churn related to external only feature from display HAL.
Change-Id: If4f4f3fa8e91a5b8387e426b9e190abd2b06d793
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 3c224ca..3d3d138 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -674,18 +674,12 @@
ret = -1;
}
- int extOnlyLayerIndex =
- ctx->listStats[dpy].extOnlyLayerIndex;
-
private_handle_t *hnd = (private_handle_t *)fbLayer->handle;
- if(extOnlyLayerIndex!= -1) {
- hwc_layer_1_t *extLayer = &list->hwLayers[extOnlyLayerIndex];
- hnd = (private_handle_t *)extLayer->handle;
- } else if(copybitDone) {
+ if(copybitDone) {
hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer();
}
- if(hnd && !isYuvBuffer(hnd)) {
+ if(hnd) {
if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) {
ALOGE("%s: FBUpdate::draw fail!", __FUNCTION__);
ret = -1;
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index 5014af9..904279a 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -132,12 +132,6 @@
bool ret = false;
hwc_layer_1_t *layer = &list->hwLayers[list->numHwLayers - 1];
if (LIKELY(ctx->mOverlay)) {
- int extOnlyLayerIndex = ctx->listStats[mDpy].extOnlyLayerIndex;
- // ext only layer present..
- if(extOnlyLayerIndex != -1) {
- layer = &list->hwLayers[extOnlyLayerIndex];
- layer->compositionType = HWC_OVERLAY;
- }
overlay::Overlay& ov = *(ctx->mOverlay);
ovutils::Whf info(mAlignedFBWidth, mAlignedFBHeight,
@@ -195,8 +189,7 @@
sourceCrop = layer->displayFrame;
} else if((!mDpy ||
(mDpy && !extOrient
- && !ctx->dpyAttr[mDpy].mDownScaleMode))
- && (extOnlyLayerIndex == -1)) {
+ && !ctx->dpyAttr[mDpy].mDownScaleMode))) {
if(ctx->mOverlay->isUIScalingOnExternalSupported() &&
!ctx->dpyAttr[mDpy].customFBSize) {
getNonWormholeRegion(list, sourceCrop);
@@ -285,12 +278,6 @@
bool ret = false;
hwc_layer_1_t *layer = &list->hwLayers[list->numHwLayers - 1];
if (LIKELY(ctx->mOverlay)) {
- /* External only layer present */
- int extOnlyLayerIndex = ctx->listStats[mDpy].extOnlyLayerIndex;
- if(extOnlyLayerIndex != -1) {
- layer = &list->hwLayers[extOnlyLayerIndex];
- layer->compositionType = HWC_OVERLAY;
- }
ovutils::Whf info(mAlignedFBWidth, mAlignedFBHeight,
ovutils::getMdpFormat(HAL_PIXEL_FORMAT_RGBA_8888,
mTileEnabled));
@@ -424,13 +411,6 @@
bool FBSrcSplit::configure(hwc_context_t *ctx, hwc_display_contents_1 *list,
hwc_rect_t fbUpdatingRect, int fbZorder) {
hwc_layer_1_t *layer = &list->hwLayers[list->numHwLayers - 1];
- int extOnlyLayerIndex = ctx->listStats[mDpy].extOnlyLayerIndex;
- // ext only layer present..
- if(extOnlyLayerIndex != -1) {
- layer = &list->hwLayers[extOnlyLayerIndex];
- layer->compositionType = HWC_OVERLAY;
- }
-
overlay::Overlay& ov = *(ctx->mOverlay);
ovutils::Whf info(mAlignedFBWidth,
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index f3243fc..8afaeab 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -835,7 +835,6 @@
ctx->listStats[dpy].isSecurePresent = false;
ctx->listStats[dpy].yuvCount = 0;
char property[PROPERTY_VALUE_MAX];
- ctx->listStats[dpy].extOnlyLayerIndex = -1;
ctx->listStats[dpy].isDisplayAnimating = false;
ctx->listStats[dpy].secureUI = false;
ctx->listStats[dpy].yuv4k2kCount = 0;
@@ -888,10 +887,6 @@
if(layer->blending == HWC_BLENDING_PREMULT)
ctx->listStats[dpy].preMultipliedAlpha = true;
-
- if(UNLIKELY(isExtOnly(hnd))){
- ctx->listStats[dpy].extOnlyLayerIndex = (int)i;
- }
}
if(ctx->listStats[dpy].yuvCount > 0) {
if (property_get("hw.cabl.yuv", property, NULL) > 0) {
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index ad71919..aa859dd 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -120,7 +120,6 @@
//Video specific
int yuvCount;
int yuvIndices[MAX_NUM_APP_LAYERS];
- int extOnlyLayerIndex;
bool preMultipliedAlpha;
int yuv4k2kIndices[MAX_NUM_APP_LAYERS];
int yuv4k2kCount;
@@ -434,11 +433,6 @@
return (hnd && (private_handle_t::PRIV_FLAGS_HWC_LOCK & hnd->flags));
}
-//Return true if buffer is for external display only
-static inline bool isExtOnly(const private_handle_t* hnd) {
- return (hnd && (hnd->flags & private_handle_t::PRIV_FLAGS_EXTERNAL_ONLY));
-}
-
//Return true if the buffer is intended for Secure Display
static inline bool isSecureDisplayBuffer(const private_handle_t* hnd) {
return (hnd && (hnd->flags & private_handle_t::PRIV_FLAGS_SECURE_DISPLAY));
diff --git a/libhwcomposer/hwc_virtual.cpp b/libhwcomposer/hwc_virtual.cpp
index f8f3b45..db43435 100644
--- a/libhwcomposer/hwc_virtual.cpp
+++ b/libhwcomposer/hwc_virtual.cpp
@@ -351,18 +351,12 @@
ret = -1;
}
- int extOnlyLayerIndex =
- ctx->listStats[dpy].extOnlyLayerIndex;
-
private_handle_t *hnd = (private_handle_t *)fbLayer->handle;
- if(extOnlyLayerIndex!= -1) {
- hwc_layer_1_t *extLayer = &list->hwLayers[extOnlyLayerIndex];
- hnd = (private_handle_t *)extLayer->handle;
- } else if(copybitDone) {
+ if(copybitDone) {
hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer();
}
- if(hnd && !isYuvBuffer(hnd)) {
+ if(hnd) {
if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) {
ALOGE("%s: FBUpdate::draw fail!", __FUNCTION__);
ret = -1;