hwc: resolve compiler warnings
- remove unused variables.
- fix incorrect castings.
Change-Id: I7661edb4539a3ffc7d4aedbb9f633bc5ba1dc149
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index dbd05ae..6adf5e5 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2013, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2012-2014, The Linux Foundation. All rights reserved.
* Not a Contribution, Apache license notifications and license are retained
* for attribution purposes only.
*
@@ -300,7 +300,6 @@
}
bool MDPComp::isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer) {
- const int dpy = HWC_DISPLAY_PRIMARY;
private_handle_t *hnd = (private_handle_t *)layer->handle;
if(!hnd) {
@@ -316,9 +315,6 @@
if(!isSecureBuffer(hnd) && isNonIntegralSourceCrop(layer->sourceCropf))
return false;
- int hw_w = ctx->dpyAttr[mDpy].xres;
- int hw_h = ctx->dpyAttr[mDpy].yres;
-
hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
hwc_rect_t dst = layer->displayFrame;
int crop_w = crop.right - crop.left;
@@ -407,7 +403,6 @@
bool MDPComp::isFrameDoable(hwc_context_t *ctx) {
bool ret = true;
- const int numAppLayers = ctx->listStats[mDpy].numAppLayers;
if(!isEnabled()) {
ALOGD_IF(isDebug(),"%s: MDP Comp. not enabled.", __FUNCTION__);
@@ -458,7 +453,6 @@
hwc_rect_t dstRect = layer->displayFrame;
hwc_rect_t srcRect = integerizeSourceCrop(layer->sourceCropf);
- int transform = layer->transform;
hwc_rect_t res = getIntersection(visibleRect, dstRect);
@@ -515,7 +509,6 @@
hwc_rect_t dstRect = list->hwLayers[index].displayFrame;
hwc_rect_t srcRect = integerizeSourceCrop(
list->hwLayers[index].sourceCropf);
- int transform = list->hwLayers[index].transform;
/* Intersect against display boundaries */
roi = getUnion(roi, dstRect);
@@ -729,7 +722,7 @@
bool MDPComp::loadBasedCompPreferGPU(hwc_context_t *ctx,
hwc_display_contents_1_t* list) {
- if(not isLoadBasedCompDoable(ctx, list)) {
+ if(not isLoadBasedCompDoable(ctx)) {
return false;
}
@@ -840,7 +833,7 @@
bool MDPComp::loadBasedCompPreferMDP(hwc_context_t *ctx,
hwc_display_contents_1_t* list) {
- if(not isLoadBasedCompDoable(ctx, list)) {
+ if(not isLoadBasedCompDoable(ctx)) {
return false;
}
@@ -919,8 +912,7 @@
return true;
}
-bool MDPComp::isLoadBasedCompDoable(hwc_context_t *ctx,
- hwc_display_contents_1_t* list) {
+bool MDPComp::isLoadBasedCompDoable(hwc_context_t *ctx) {
if(mDpy or isSecurePresent(ctx, mDpy) or
isYuvPresent(ctx, mDpy)) {
return false;
@@ -1174,7 +1166,6 @@
int fbCount = 0;
for(int i = 0; i < numAppLayers; i++) {
- hwc_layer_1_t* layer = &list->hwLayers[i];
if (mCachedFrame.hnd[i] == list->hwLayers[i].handle) {
if(!mCurrentFrame.drop[i])
fbCount++;
@@ -1484,12 +1475,9 @@
return ret;
}
-bool MDPComp::allocSplitVGPipesfor4k2k(hwc_context_t *ctx,
- hwc_display_contents_1_t* list, int index) {
+bool MDPComp::allocSplitVGPipesfor4k2k(hwc_context_t *ctx, int index) {
bool bRet = true;
- hwc_layer_1_t* layer = &list->hwLayers[index];
- private_handle_t *hnd = (private_handle_t *)layer->handle;
int mdpIndex = mCurrentFrame.layerToMDP[index];
PipeLayerPair& info = mCurrentFrame.mdpToLayer[mdpIndex];
info.pipeInfo = new MdpYUVPipeInfo;
@@ -1514,10 +1502,10 @@
}
return bRet;
}
-//=============MDPCompNonSplit===================================================
+//=============MDPCompNonSplit==================================================
void MDPCompNonSplit::adjustForSourceSplit(hwc_context_t *ctx,
- hwc_display_contents_1_t* list){
+ hwc_display_contents_1_t*) {
//As we split 4kx2k yuv layer and program to 2 VG pipes
//(if available) increase mdpcount accordingly
mCurrentFrame.mdpCount += ctx->listStats[mDpy].yuv4k2kCount;
@@ -1618,7 +1606,7 @@
hwc_layer_1_t* layer = &list->hwLayers[index];
private_handle_t *hnd = (private_handle_t *)layer->handle;
if(is4kx2kYuvBuffer(hnd) && sEnable4k2kYUVSplit){
- if(allocSplitVGPipesfor4k2k(ctx, list, index)){
+ if(allocSplitVGPipesfor4k2k(ctx, index)){
continue;
}
}
@@ -1810,7 +1798,6 @@
hwc_display_contents_1_t* list,
int mixer) {
int pipesNeeded = 0;
- const int xres = ctx->dpyAttr[mDpy].xres;
const int lSplit = getLeftSplit(ctx, mDpy);
@@ -1909,7 +1896,6 @@
bool MDPCompSplit::acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
MdpPipeInfoSplit& pipe_info,
ePipeType type) {
- const int xres = ctx->dpyAttr[mDpy].xres;
const int lSplit = getLeftSplit(ctx, mDpy);
hwc_rect_t dst = layer->displayFrame;
@@ -1943,7 +1929,7 @@
const int lSplit = getLeftSplit(ctx, mDpy);
if(is4kx2kYuvBuffer(hnd) && sEnable4k2kYUVSplit){
if((dst.left > lSplit)||(dst.right < lSplit)){
- if(allocSplitVGPipesfor4k2k(ctx, list, index)){
+ if(allocSplitVGPipesfor4k2k(ctx, index)){
continue;
}
}
@@ -2104,8 +2090,8 @@
if(ctx->mAD->isModeOn()) {
if(ctx->mAD->draw(ctx, fd, offset)) {
- fd = ctx->mAD->getDstFd(ctx);
- offset = ctx->mAD->getDstOffset(ctx);
+ fd = ctx->mAD->getDstFd();
+ offset = ctx->mAD->getDstOffset();
}
}