display: Fix warnings

Treat warnings as errors again

Change-Id: Ibd7f484d31ad420b85e82fd5183d70bf7dce4bfa
This commit is contained in:
Naseer Ahmed
2014-09-25 13:24:44 -04:00
parent b8173300fa
commit 9eb5e09577
14 changed files with 24 additions and 20 deletions

View File

@@ -19,8 +19,7 @@ common_libs := liblog libutils libcutils libhardware
#Common C flags #Common C flags
common_flags := -DDEBUG_CALC_FPS -Wno-missing-field-initializers common_flags := -DDEBUG_CALC_FPS -Wno-missing-field-initializers
#TODO: Add -Werror back once all the current warnings are fixed common_flags += -Wconversion -Wall -Werror
common_flags += -Wconversion -Wall
ifeq ($(ARCH_ARM_HAVE_NEON),true) ifeq ($(ARCH_ARM_HAVE_NEON),true)
common_flags += -D__ARM_HAVE_NEON common_flags += -D__ARM_HAVE_NEON

View File

@@ -503,7 +503,7 @@ static int set_image(copybit_context_t* ctx, uint32 surfaceId,
struct private_handle_t* handle = (struct private_handle_t*)rhs->handle; struct private_handle_t* handle = (struct private_handle_t*)rhs->handle;
C2D_SURFACE_TYPE surfaceType; C2D_SURFACE_TYPE surfaceType;
int status = COPYBIT_SUCCESS; int status = COPYBIT_SUCCESS;
uintptr_t gpuaddr = 0; uint64_t gpuaddr = 0;
int c2d_format; int c2d_format;
mapped_idx = -1; mapped_idx = -1;
@@ -1179,7 +1179,7 @@ static int stretch_copybit_internal(
return COPYBIT_FAILURE; return COPYBIT_FAILURE;
} }
if (need_temp_dst) { if (need_temp_dst) {
if (get_size(dst_info) != ctx->temp_dst_buffer.size) { if (get_size(dst_info) != (int) ctx->temp_dst_buffer.size) {
free_temp_buffer(ctx->temp_dst_buffer); free_temp_buffer(ctx->temp_dst_buffer);
// Create a temp buffer and set that as the destination. // Create a temp buffer and set that as the destination.
if (COPYBIT_FAILURE == get_temp_buffer(dst_info, ctx->temp_dst_buffer)) { if (COPYBIT_FAILURE == get_temp_buffer(dst_info, ctx->temp_dst_buffer)) {
@@ -1261,7 +1261,7 @@ static int stretch_copybit_internal(
return COPYBIT_FAILURE; return COPYBIT_FAILURE;
} }
if (need_temp_src) { if (need_temp_src) {
if (get_size(src_info) != ctx->temp_src_buffer.size) { if (get_size(src_info) != (int) ctx->temp_src_buffer.size) {
free_temp_buffer(ctx->temp_src_buffer); free_temp_buffer(ctx->temp_src_buffer);
// Create a temp buffer and set that as the destination. // Create a temp buffer and set that as the destination.
if (COPYBIT_SUCCESS != get_temp_buffer(src_info, if (COPYBIT_SUCCESS != get_temp_buffer(src_info,

View File

@@ -213,7 +213,7 @@ int convert_yuv_c2d_to_yuv_android(private_handle_t *hnd,
return COPYBIT_FAILURE; return COPYBIT_FAILURE;
} }
ret = copy_source_to_destination(hnd->base, dst_hnd->base, info); ret = copy_source_to_destination((uintptr_t) hnd->base, (uintptr_t) dst_hnd->base, info);
return ret; return ret;
} }
@@ -258,6 +258,6 @@ int convert_yuv_android_to_yuv_c2d(private_handle_t *hnd,
return -1; return -1;
} }
ret = copy_source_to_destination(hnd->base, dst_hnd->base, info); ret = copy_source_to_destination((uintptr_t) hnd->base, (uintptr_t) dst_hnd->base, info);
return ret; return ret;
} }

View File

@@ -28,6 +28,7 @@
*/ */
#define DEBUG 0 #define DEBUG 0
#define ATRACE_TAG (ATRACE_TAG_GRAPHICS | ATRACE_TAG_HAL)
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <stdlib.h> #include <stdlib.h>
@@ -41,7 +42,6 @@
using gralloc::IonAlloc; using gralloc::IonAlloc;
#define ION_DEVICE "/dev/ion" #define ION_DEVICE "/dev/ion"
#define ATRACE_TAG (ATRACE_TAG_GRAPHICS | ATRACE_TAG_HAL)
int IonAlloc::open_device() int IonAlloc::open_device()
{ {

View File

@@ -15,6 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
#define ATRACE_TAG (ATRACE_TAG_GRAPHICS | ATRACE_TAG_HAL)
#include <limits.h> #include <limits.h>
#include <errno.h> #include <errno.h>
#include <pthread.h> #include <pthread.h>
@@ -40,7 +41,6 @@
#include "memalloc.h" #include "memalloc.h"
#include <qdMetaData.h> #include <qdMetaData.h>
#define ATRACE_TAG (ATRACE_TAG_GRAPHICS | ATRACE_TAG_HAL)
using namespace gralloc; using namespace gralloc;
/*****************************************************************************/ /*****************************************************************************/

View File

@@ -135,7 +135,7 @@ void AssertiveDisplay::markDoable(hwc_context_t *ctx,
const hwc_layer_1_t* layer = &list->hwLayers[nYuvIndex]; const hwc_layer_1_t* layer = &list->hwLayers[nYuvIndex];
private_handle_t *hnd = (private_handle_t *)layer->handle; private_handle_t *hnd = (private_handle_t *)layer->handle;
qdutils::MDPVersion& mdpHw = qdutils::MDPVersion::getInstance(); qdutils::MDPVersion& mdpHw = qdutils::MDPVersion::getInstance();
if(hnd && hnd->width <= mdpHw.getMaxMixerWidth()) { if(hnd && hnd->width <= (int) mdpHw.getMaxMixerWidth()) {
mDoable = true; mDoable = true;
} }
} }

View File

@@ -37,8 +37,12 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <comptype.h> #include <comptype.h>
#ifdef QCOM_BSP #ifdef QCOM_BSP
// Ignore Wconversion errors for external headers
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#include <SkBitmap.h> #include <SkBitmap.h>
#include <SkImageEncoder.h> #include <SkImageEncoder.h>
#pragma GCC diagnostic pop
#endif #endif
#ifdef STDC_FORMAT_MACROS #ifdef STDC_FORMAT_MACROS
#include <inttypes.h> #include <inttypes.h>

View File

@@ -372,7 +372,7 @@ bool MDPComp::isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer) {
/* On targets that doesnt support Decimation (eg.,8x26) /* On targets that doesnt support Decimation (eg.,8x26)
* maximum downscale support is overlay pipe downscale. * maximum downscale support is overlay pipe downscale.
*/ */
if(crop_w > mdpHw.getMaxMixerWidth() || if(crop_w > (int) mdpHw.getMaxMixerWidth() ||
w_dscale > maxMDPDownscale || w_dscale > maxMDPDownscale ||
h_dscale > maxMDPDownscale) h_dscale > maxMDPDownscale)
return false; return false;
@@ -383,7 +383,7 @@ bool MDPComp::isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer) {
* 1. Src crop > Mixer limit on nonsplit MDPComp * 1. Src crop > Mixer limit on nonsplit MDPComp
* 2. exceeds maximum downscale limit * 2. exceeds maximum downscale limit
*/ */
if(((crop_w > mdpHw.getMaxMixerWidth()) && if(((crop_w > (int) mdpHw.getMaxMixerWidth()) &&
!sSrcSplitEnabled) || !sSrcSplitEnabled) ||
w_dscale > maxMDPDownscale || w_dscale > maxMDPDownscale ||
h_dscale > maxMDPDownscale) { h_dscale > maxMDPDownscale) {
@@ -712,7 +712,7 @@ bool MDPComp::tryFullFrame(hwc_context_t *ctx,
MDPVersion& mdpHw = MDPVersion::getInstance(); MDPVersion& mdpHw = MDPVersion::getInstance();
if(mDpy > HWC_DISPLAY_PRIMARY && if(mDpy > HWC_DISPLAY_PRIMARY &&
(priDispW > mdpHw.getMaxMixerWidth()) && (priDispW > (int) mdpHw.getMaxMixerWidth()) &&
(ctx->dpyAttr[mDpy].xres < mdpHw.getMaxMixerWidth())) { (ctx->dpyAttr[mDpy].xres < mdpHw.getMaxMixerWidth())) {
// Disable MDP comp on Secondary when the primary is highres panel and // Disable MDP comp on Secondary when the primary is highres panel and
// the secondary is a normal 1080p, because, MDP comp on secondary under // the secondary is a normal 1080p, because, MDP comp on secondary under
@@ -2475,8 +2475,8 @@ bool MDPCompSrcSplit::acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
//pipe line length, we are still using 2 pipes. This is fine just because //pipe line length, we are still using 2 pipes. This is fine just because
//this is source split where destination doesn't matter. Evaluate later to //this is source split where destination doesn't matter. Evaluate later to
//see if going through all the calcs to save a pipe is worth it //see if going through all the calcs to save a pipe is worth it
if(dstWidth > mdpHw.getMaxMixerWidth() or if(dstWidth > (int) mdpHw.getMaxMixerWidth() or
cropWidth > mdpHw.getMaxMixerWidth() or cropWidth > (int) mdpHw.getMaxMixerWidth() or
(primarySplitAlways and (cropWidth > lSplit))) { (primarySplitAlways and (cropWidth > lSplit))) {
pipe_info.rIndex = ctx->mOverlay->getPipe(pipeSpecs); pipe_info.rIndex = ctx->mOverlay->getPipe(pipeSpecs);
if(pipe_info.rIndex == ovutils::OV_INVALID) { if(pipe_info.rIndex == ovutils::OV_INVALID) {

View File

@@ -2309,7 +2309,7 @@ void BwcPM::setBwc(const hwc_rect_t& crop, const hwc_rect_t& dst,
swap(src_w, src_h); swap(src_w, src_h);
} }
//src width > MAX mixer supported dim //src width > MAX mixer supported dim
if(src_w > qdutils::MDPVersion::getInstance().getMaxMixerWidth()) { if(src_w > (int) qdutils::MDPVersion::getInstance().getMaxMixerWidth()) {
return; return;
} }
//Decimation necessary, cannot use BWC. H/W requirement. //Decimation necessary, cannot use BWC. H/W requirement.

View File

@@ -21,7 +21,6 @@
#include <errno.h> #include <errno.h>
#include <cutils/log.h> #include <cutils/log.h>
#include <utils/Trace.h>
#include <overlayWriteback.h> #include <overlayWriteback.h>
#include "hwc_utils.h" #include "hwc_utils.h"
#include "hwc_fbupdate.h" #include "hwc_fbupdate.h"
@@ -30,6 +29,7 @@
#include "hwc_copybit.h" #include "hwc_copybit.h"
#include "hwc_virtual.h" #include "hwc_virtual.h"
#include "sync/sync.h" #include "sync/sync.h"
#include <utils/Trace.h>
#define HWCVIRTUAL_LOG 0 #define HWCVIRTUAL_LOG 0

View File

@@ -20,6 +20,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_C_INCLUDES += hardware/libhardware/include LOCAL_C_INCLUDES += hardware/libhardware/include
LOCAL_CFAGS := -Wconversion -Wall -Werror
LOCAL_SHARED_LIBRARIES := liblog LOCAL_SHARED_LIBRARIES := liblog
LOCAL_SRC_FILES := memtrack_msm.c kgsl.c LOCAL_SRC_FILES := memtrack_msm.c kgsl.c
LOCAL_MODULE := memtrack.$(TARGET_BOARD_PLATFORM) LOCAL_MODULE := memtrack.$(TARGET_BOARD_PLATFORM)

View File

@@ -99,7 +99,7 @@ int kgsl_memtrack_get_memory(pid_t pid, enum memtrack_type type,
* gpuaddr useraddr size id flags type usage sglen * gpuaddr useraddr size id flags type usage sglen
* 545ba000 545ba000 4096 1 ----pY gpumem arraybuffer 1 * 545ba000 545ba000 4096 1 ----pY gpumem arraybuffer 1
*/ */
ret = sscanf(line, "%*x %*lx %lu %*d %6s %6s %18s %*d\n", ret = sscanf(line, "%*x %*x %lu %*d %6s %6s %18s %*d\n",
&size, flags, line_type, line_usage); &size, flags, line_type, line_usage);
if (ret != 4) { if (ret != 4) {
continue; continue;

View File

@@ -272,7 +272,7 @@ void getDecimationFactor(const int& src_w, const int& src_h,
if((int)verDscale) if((int)verDscale)
vertDeci = (uint8_t)log2f(verDscale); vertDeci = (uint8_t)log2f(verDscale);
if(src_w > mdpHw.getMaxMixerWidth()) { if(src_w > (int) mdpHw.getMaxMixerWidth()) {
//If the client sends us something > what a layer mixer supports //If the client sends us something > what a layer mixer supports
//then it means it doesn't want to use split-pipe but wants us to //then it means it doesn't want to use split-pipe but wants us to
//decimate. A minimum decimation of 2 will ensure that the width is //decimate. A minimum decimation of 2 will ensure that the width is

View File

@@ -137,7 +137,7 @@ public:
bool isDynFpsSupported() { return mPanelInfo.mDynFpsSupported; } bool isDynFpsSupported() { return mPanelInfo.mDynFpsSupported; }
uint32_t getMinFpsSupported() { return mPanelInfo.mMinFps; } uint32_t getMinFpsSupported() { return mPanelInfo.mMinFps; }
uint32_t getMaxFpsSupported() { return mPanelInfo.mMaxFps; } uint32_t getMaxFpsSupported() { return mPanelInfo.mMaxFps; }
int getMaxMixerWidth() const { return mMaxMixerWidth; } uint32_t getMaxMixerWidth() const { return mMaxMixerWidth; }
bool isSrcSplit() const; bool isSrcSplit() const;
bool isSrcSplitAlways() const; bool isSrcSplitAlways() const;
bool isRGBScalarSupported() const; bool isRGBScalarSupported() const;