diff options
author | Steve Kondik <steve@cyngn.com> | 2016-04-30 21:34:33 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-05-01 01:10:05 -0700 |
commit | cedd62af6303983c7e61f2f188c25b2d28bd7b5b (patch) | |
tree | 426eee3cf09f5141e1bce3013a0cc6ea429c1d9f | |
parent | 148e6da44f598f30775ca6fbfb9e0731bddd9308 (diff) | |
download | android_hardware_qcom_display-stable/cm-13.0-caf-8994-ZNH5Y.tar.gz android_hardware_qcom_display-stable/cm-13.0-caf-8994-ZNH5Y.tar.bz2 android_hardware_qcom_display-stable/cm-13.0-caf-8994-ZNH5Y.zip |
display: Fix warnings on 64-bit clangstable/cm-13.0-caf-8994-ZNH5Ycm-13.0-caf-8994
Change-Id: I40a2daa8b22baf5863c75778ac312dd1316183f0
-rw-r--r-- | common.mk | 2 | ||||
-rw-r--r-- | libcopybit/copybit_c2d.cpp | 20 | ||||
-rw-r--r-- | libgralloc/Android.mk | 1 | ||||
-rw-r--r-- | libgralloc/framebuffer.cpp | 7 | ||||
-rw-r--r-- | libgralloc/mapper.cpp | 4 | ||||
-rw-r--r-- | libhwcomposer/Android.mk | 1 | ||||
-rw-r--r-- | libhwcomposer/hwc.cpp | 2 | ||||
-rw-r--r-- | libhwcomposer/hwc_dump_layers.cpp | 44 | ||||
-rw-r--r-- | libhwcomposer/hwc_mdpcomp.cpp | 20 | ||||
-rw-r--r-- | libhwcomposer/hwc_qclient.cpp | 1 | ||||
-rw-r--r-- | libhwcomposer/hwc_utils.cpp | 4 | ||||
-rw-r--r-- | libhwcomposer/hwc_utils.h | 8 | ||||
-rw-r--r-- | libqdutils/Android.mk | 2 |
13 files changed, 55 insertions, 61 deletions
@@ -14,7 +14,7 @@ common_libs := liblog libutils libcutils libhardware #Common C flags common_flags := -DDEBUG_CALC_FPS -Wno-missing-field-initializers -common_flags += -Wconversion -Wall -Werror +common_flags += -Wconversion -Wall ifeq ($(TARGET_USES_POST_PROCESSING),true) common_flags += -DUSES_POST_PROCESSING diff --git a/libcopybit/copybit_c2d.cpp b/libcopybit/copybit_c2d.cpp index 3807f33ac..4e7199702 100644 --- a/libcopybit/copybit_c2d.cpp +++ b/libcopybit/copybit_c2d.cpp @@ -191,22 +191,22 @@ static int open_copybit(const struct hw_module_t* module, const char* name, struct hw_device_t** device); static struct hw_module_methods_t copybit_module_methods = { -open: open_copybit + .open = open_copybit }; /* * The COPYBIT Module */ struct copybit_module_t HAL_MODULE_INFO_SYM = { -common: { -tag: HARDWARE_MODULE_TAG, - version_major: 1, - version_minor: 0, - id: COPYBIT_HARDWARE_MODULE_ID, - name: "QCT COPYBIT C2D 2.0 Module", - author: "Qualcomm", - methods: ©bit_module_methods - } + .common = { + .tag = HARDWARE_MODULE_TAG, + .version_major = 1, + .version_minor = 0, + .id = COPYBIT_HARDWARE_MODULE_ID, + .name = "QCT COPYBIT C2D 2.0 Module", + .author = "Qualcomm", + .methods = ©bit_module_methods + } }; diff --git a/libgralloc/Android.mk b/libgralloc/Android.mk index 412f1bee7..e2956eb1f 100644 --- a/libgralloc/Android.mk +++ b/libgralloc/Android.mk @@ -28,6 +28,7 @@ LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps) $(kernel_deps) LOCAL_SRC_FILES := gpu.cpp gralloc.cpp framebuffer.cpp mapper.cpp LOCAL_COPY_HEADERS_TO := $(common_header_export_path) LOCAL_COPY_HEADERS := gralloc_priv.h gr.h +LOCAL_CLANG_CFLAGS += -Wno-gnu-designator include $(BUILD_SHARED_LIBRARY) diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp index 0ebc3dbad..6ed2de481 100644 --- a/libgralloc/framebuffer.cpp +++ b/libgralloc/framebuffer.cpp @@ -44,13 +44,6 @@ #define EVEN_OUT(x) if (x & 0x0001) {x--;} /** min of int a, b */ -static inline int min(int a, int b) { - return (a<b) ? a : b; -} -/** max of int a, b */ -static inline int max(int a, int b) { - return (a>b) ? a : b; -} enum { PAGE_FLIP = 0x00000001, diff --git a/libgralloc/mapper.cpp b/libgralloc/mapper.cpp index b49ffb05b..e20a919d0 100644 --- a/libgralloc/mapper.cpp +++ b/libgralloc/mapper.cpp @@ -118,7 +118,7 @@ static int gralloc_unmap(gralloc_module_t const* module, if(hnd->base) { err = memalloc->unmap_buffer((void*)hnd->base, hnd->size, hnd->offset); if (err) { - ALOGE("Could not unmap memory at address %p, %s", hnd->base, + ALOGE("Could not unmap memory at address %" PRId64 ", %s", hnd->base, strerror(errno)); return -errno; } @@ -130,7 +130,7 @@ static int gralloc_unmap(gralloc_module_t const* module, err = memalloc->unmap_buffer((void*)hnd->base_metadata, size, hnd->offset_metadata); if (err) { - ALOGE("Could not unmap memory at address %p, %s", + ALOGE("Could not unmap memory at address %" PRId64 ", %s", hnd->base_metadata, strerror(errno)); return -errno; } diff --git a/libhwcomposer/Android.mk b/libhwcomposer/Android.mk index df3e4643b..bc09f7118 100644 --- a/libhwcomposer/Android.mk +++ b/libhwcomposer/Android.mk @@ -12,6 +12,7 @@ LOCAL_SHARED_LIBRARIES := $(common_libs) libEGL liboverlay \ libhdmi libqdutils libhardware_legacy \ libdl libmemalloc libqservice libsync \ libbinder libmedia +LOCAL_CLANG_CFLAGS += -Wno-gnu-designator -Wno-sign-conversion ifeq ($(TARGET_USES_QCOM_BSP),true) LOCAL_SHARED_LIBRARIES += libskia diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp index 5f1c72a33..6ccc65bbd 100644 --- a/libhwcomposer/hwc.cpp +++ b/libhwcomposer/hwc.cpp @@ -842,7 +842,7 @@ int hwc_getDisplayConfigs(struct hwc_composer_device_1* dev, int disp, } if (*numConfigs <= 0) { - ALOGE("%s Invalid number of configs (%d)", __FUNCTION__, *numConfigs); + ALOGE("%s Invalid number of configs (%zu)", __FUNCTION__, *numConfigs); return -EINVAL; } diff --git a/libhwcomposer/hwc_dump_layers.cpp b/libhwcomposer/hwc_dump_layers.cpp index f9d8d294a..9b0f2c9d1 100644 --- a/libhwcomposer/hwc_dump_layers.cpp +++ b/libhwcomposer/hwc_dump_layers.cpp @@ -294,71 +294,71 @@ void HwcDebug::getHalPixelFormatStr(int format, char pixFormatStr[]) switch(format) { case HAL_PIXEL_FORMAT_RGBA_8888: - strlcpy(pixFormatStr, "RGBA_8888", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "RGBA_8888", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_RGBX_8888: - strlcpy(pixFormatStr, "RGBX_8888", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "RGBX_8888", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_RGB_888: - strlcpy(pixFormatStr, "RGB_888", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "RGB_888", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_RGB_565: - strlcpy(pixFormatStr, "RGB_565", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "RGB_565", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_BGRA_8888: - strlcpy(pixFormatStr, "BGRA_8888", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "BGRA_8888", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_RGBA_5551: - strlcpy(pixFormatStr, "RGBA_5551", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "RGBA_5551", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_RGBA_4444: - strlcpy(pixFormatStr, "RGBA_4444", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "RGBA_4444", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_YV12: - strlcpy(pixFormatStr, "YV12", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "YV12", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_YCbCr_422_SP: - strlcpy(pixFormatStr, "YCbCr_422_SP_NV16", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "YCbCr_422_SP_NV16", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_YCrCb_420_SP: - strlcpy(pixFormatStr, "YCrCb_420_SP_NV21", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "YCrCb_420_SP_NV21", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_YCbCr_422_I: - strlcpy(pixFormatStr, "YCbCr_422_I_YUY2", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "YCbCr_422_I_YUY2", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_YCrCb_422_I: - strlcpy(pixFormatStr, "YCrCb_422_I_YVYU", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "YCrCb_422_I_YVYU", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_NV12_ENCODEABLE: - strlcpy(pixFormatStr, "NV12_ENCODEABLE", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "NV12_ENCODEABLE", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED: strlcpy(pixFormatStr, "YCbCr_420_SP_TILED_TILE_4x2", - sizeof(pixFormatStr)); + strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_YCbCr_420_SP: - strlcpy(pixFormatStr, "YCbCr_420_SP", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "YCbCr_420_SP", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO: - strlcpy(pixFormatStr, "YCrCb_420_SP_ADRENO", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "YCrCb_420_SP_ADRENO", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_YCrCb_422_SP: - strlcpy(pixFormatStr, "YCrCb_422_SP", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "YCrCb_422_SP", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_R_8: - strlcpy(pixFormatStr, "R_8", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "R_8", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_RG_88: - strlcpy(pixFormatStr, "RG_88", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "RG_88", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_INTERLACE: - strlcpy(pixFormatStr, "INTERLACE", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "INTERLACE", strlen(pixFormatStr)); break; case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS: - strlcpy(pixFormatStr, "YCbCr_420_SP_VENUS", sizeof(pixFormatStr)); + strlcpy(pixFormatStr, "YCbCr_420_SP_VENUS", strlen(pixFormatStr)); break; default: - size_t len = sizeof(pixFormatStr); + size_t len = strlen(pixFormatStr); snprintf(pixFormatStr, len, "Unknown0x%X", format); break; } diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp index beeb4e9d6..681ed6c7c 100644 --- a/libhwcomposer/hwc_mdpcomp.cpp +++ b/libhwcomposer/hwc_mdpcomp.cpp @@ -28,6 +28,7 @@ #include <overlayCursor.h> #include "hwc_copybit.h" #include "qd_utils.h" +#include <utils/Vector.h> using namespace overlay; using namespace qdutils; @@ -1095,7 +1096,7 @@ bool MDPComp::fullMDPCompWithPTOR(hwc_context_t *ctx, return false; } private_handle_t *renderBuf = ctx->mCopyBit[mDpy]->getCurrentRenderBuffer(); - Whf layerWhf[numPTORLayersFound]; // To store w,h,f of PTOR layers + Vector<Whf> layerWhf; // To store w,h,f of PTOR layers // Store the blending mode, planeAlpha, and transform of PTOR layers int32_t blending[numPTORLayersFound]; @@ -1115,7 +1116,7 @@ bool MDPComp::fullMDPCompWithPTOR(hwc_context_t *ctx, // Store & update w, h, format of PTOR layer private_handle_t *hnd = (private_handle_t *)layer->handle; Whf whf(hnd->width, hnd->height, hnd->format, hnd->size); - layerWhf[j] = whf; + layerWhf.insertAt(whf, j); hnd->width = renderBuf->width; hnd->height = renderBuf->height; hnd->format = renderBuf->format; @@ -1178,9 +1179,10 @@ bool MDPComp::fullMDPCompWithPTOR(hwc_context_t *ctx, int idx = ctx->mPtorInfo.layerIndex[i]; hwc_layer_1_t* layer = &list->hwLayers[idx]; private_handle_t *hnd = (private_handle_t *)list->hwLayers[idx].handle; - hnd->width = layerWhf[i].w; - hnd->height = layerWhf[i].h; - hnd->format = layerWhf[i].format; + Whf whf = layerWhf.itemAt(i); + hnd->width = whf.w; + hnd->height = whf.h; + hnd->format = whf.format; layer->blending = blending[i]; layer->planeAlpha = planeAlpha[i]; layer->transform = transform[i]; @@ -1252,8 +1254,6 @@ bool MDPComp::cacheBasedComp(hwc_context_t *ctx, return false; } - int mdpCount = mCurrentFrame.mdpCount; - if(sEnableYUVsplit){ adjustForSourceSplit(ctx, list); } @@ -1472,7 +1472,7 @@ bool MDPComp::mdpOnlyLayersComp(hwc_context_t *ctx, /* Bail out if we are processing only secured video/ui layers * and we dont have any */ if(secureOnly) { - ALOGD_IF(isDebug(), "%s: No secure video/ui layers"); + ALOGD_IF(isDebug(), "%s: No secure video/ui layers", __FUNCTION__); return false; } /* No Idle fall back for secure video/ui layers and if there is only @@ -2032,16 +2032,12 @@ bool MDPComp::hwLimitationsCheck(hwc_context_t* ctx, static bool validForCursor(hwc_context_t* ctx, int dpy, hwc_layer_1_t* layer) { private_handle_t *hnd = (private_handle_t *)layer->handle; - hwc_rect dst = layer->displayFrame; hwc_rect src = integerizeSourceCrop(layer->sourceCropf); int srcW = src.right - src.left; int srcH = src.bottom - src.top; - int dstW = dst.right - dst.left; - int dstH = dst.bottom - dst.top; qdutils::MDPVersion &mdpVersion = qdutils::MDPVersion::getInstance(); uint32_t maxCursorSize = mdpVersion.getMaxCursorSize(); uint32_t numHwCursors = mdpVersion.getCursorPipes(); - bool primarySplit = isDisplaySplit(ctx, HWC_DISPLAY_PRIMARY); uint32_t cursorPipesNeeded = 1; // One cursor pipe needed(default) bool ret = false; diff --git a/libhwcomposer/hwc_qclient.cpp b/libhwcomposer/hwc_qclient.cpp index 9b1f81de6..ae321fe81 100644 --- a/libhwcomposer/hwc_qclient.cpp +++ b/libhwcomposer/hwc_qclient.cpp @@ -352,6 +352,7 @@ static void setS3DMode(hwc_context_t* ctx, int mode) { static status_t setActiveConfig(hwc_context_t* ctx, const Parcel *inParcel, Parcel *outParcel) { + (void)outParcel; uint32_t index = inParcel->readInt32(); int dpy = inParcel->readInt32(); //Currently only primary supported diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp index 175a332e6..42e25a9fc 100644 --- a/libhwcomposer/hwc_utils.cpp +++ b/libhwcomposer/hwc_utils.cpp @@ -480,7 +480,7 @@ uint32_t roundOff(uint32_t refreshRate) { int count = (int) (sizeof(stdRefreshRates)/sizeof(stdRefreshRates[0])); uint32_t rate = refreshRate; for(int i=0; i< count; i++) { - if(abs(stdRefreshRates[i] - refreshRate) < 2) { + if((stdRefreshRates[i] - refreshRate) < 2) { // Most likely used for video, the fps can fluctuate // Ex: b/w 29 and 30 for 30 fps clip rate = stdRefreshRates[i]; @@ -1220,7 +1220,7 @@ bool isRotationDoable(hwc_context_t *ctx, private_handle_t *hnd) { // Rotate layers, if it is not secure display buffer and not // for the MDP versions below MDP5 if((!isSecureDisplayBuffer(hnd) && isRotatorSupportedFormat(hnd) && - !ctx->mMDP.version < qdutils::MDSS_V5) + !(ctx->mMDP.version < qdutils::MDSS_V5)) || isYuvBuffer(hnd)) { return true; } diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h index 465dad71c..fad27ed6a 100644 --- a/libhwcomposer/hwc_utils.h +++ b/libhwcomposer/hwc_utils.h @@ -272,10 +272,10 @@ inline hwc_rect_t integerizeSourceCrop(const hwc_frect_t& cropF) { } inline bool isNonIntegralSourceCrop(const hwc_frect_t& cropF) { - if(cropF.left - roundf(cropF.left) || - cropF.top - roundf(cropF.top) || - cropF.right - roundf(cropF.right) || - cropF.bottom - roundf(cropF.bottom)) + if((cropF.left - roundf(cropF.left)) > 0 || + (cropF.top - roundf(cropF.top)) > 0 || + (cropF.right - roundf(cropF.right)) > 0 || + (cropF.bottom - roundf(cropF.bottom)) > 0) return true; else return false; diff --git a/libqdutils/Android.mk b/libqdutils/Android.mk index 212c8d892..7fffc68df 100644 --- a/libqdutils/Android.mk +++ b/libqdutils/Android.mk @@ -15,6 +15,8 @@ LOCAL_SRC_FILES := profiler.cpp mdp_version.cpp \ comptype.cpp qd_utils.cpp \ cb_utils.cpp display_config.cpp \ cb_swap_rect.cpp +LOCAL_CLANG_CFLAGS += -Wno-sign-conversion + include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) |