diff --git a/common.mk b/common.mk index 287da3e..79d8e27 100644 --- a/common.mk +++ b/common.mk @@ -16,9 +16,12 @@ common_libs := liblog libutils libcutils libhardware #Common C flags common_flags := -DDEBUG_CALC_FPS -Wno-missing-field-initializers +common_flags += -Werror + ifeq ($(TARGET_USES_ION),true) common_flags += -DUSE_ION endif + ifeq ($(ARCH_ARM_HAVE_NEON),true) common_flags += -D__ARM_HAVE_NEON endif diff --git a/libcopybit/copybit_c2d.cpp b/libcopybit/copybit_c2d.cpp index 1f6b74c..4697238 100644 --- a/libcopybit/copybit_c2d.cpp +++ b/libcopybit/copybit_c2d.cpp @@ -450,7 +450,7 @@ static int set_image( uint32 surfaceId, const struct copybit_image_t *rhs, info.height = rhs->h; info.format = rhs->format; - yuvPlaneInfo yuvInfo; + yuvPlaneInfo yuvInfo = {0}; status = calculate_yuv_offset_and_stride(info, yuvInfo); if(status != COPYBIT_SUCCESS) { ALOGE("%s: calculate_yuv_offset_and_stride error", __FUNCTION__); @@ -705,7 +705,7 @@ static void set_rects(struct copybit_context_t *ctx, /** copy the bits */ static int msm_copybit(struct copybit_context_t *dev, blitlist *list, uint32 target) { - int objects; + unsigned int objects; for(objects = 0; objects < list->count; objects++) { list->blitObjects[objects].next = &(list->blitObjects[objects+1]); diff --git a/libgralloc/Android.mk b/libgralloc/Android.mk index d87af79..dfc80c0 100644 --- a/libgralloc/Android.mk +++ b/libgralloc/Android.mk @@ -20,7 +20,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := gralloc.$(TARGET_BOARD_PLATFORM) LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES := $(common_includes) +LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes) LOCAL_SHARED_LIBRARIES := $(common_libs) libmemalloc libgenlock LOCAL_SHARED_LIBRARIES += libqdutils libGLESv1_CM LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"gralloc\" diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp index 4b4675b..a807420 100644 --- a/libgralloc/alloc_controller.cpp +++ b/libgralloc/alloc_controller.cpp @@ -165,7 +165,7 @@ int IonController::allocate(alloc_data& data, int usage) IMemAlloc* IonController::getAllocator(int flags) { - IMemAlloc* memalloc; + IMemAlloc* memalloc = NULL; if (flags & private_handle_t::PRIV_FLAGS_USES_ION) { memalloc = mIonAlloc; } else { diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp index 8107400..d292ea4 100644 --- a/libhwcomposer/hwc_mdpcomp.cpp +++ b/libhwcomposer/hwc_mdpcomp.cpp @@ -125,6 +125,15 @@ void MDPComp::timeout_handler(void *udata) { proc->invalidate(proc); } +void MDPComp::reset_comp_type(hwc_layer_list_t* list) { + for(uint32_t i = 0 ; i < list->numHwLayers; i++ ) { + hwc_layer_t* l = &list->hwLayers[i]; + + if(l->compositionType == HWC_OVERLAY) + l->compositionType = HWC_FRAMEBUFFER; + } +} + void MDPComp::reset( hwc_context_t *ctx, hwc_layer_list_t* list ) { sCurrentFrame.count = 0; free(sCurrentFrame.pipe_layer); @@ -333,8 +342,7 @@ int MDPComp::prepare(hwc_context_t *ctx, hwc_layer_t *layer, * 5. Overlay in use */ -bool MDPComp::is_doable(hwc_composer_device_t *dev, - const hwc_layer_list_t* list) { +bool MDPComp::is_doable(hwc_composer_device_t *dev, hwc_layer_list_t* list) { hwc_context_t* ctx = (hwc_context_t*)(dev); if(!ctx) { @@ -343,7 +351,7 @@ bool MDPComp::is_doable(hwc_composer_device_t *dev, } //Number of layers - if(list->numHwLayers < 1 || list->numHwLayers > sMaxLayers) { + if(list->numHwLayers < 1 || list->numHwLayers > (uint32_t) sMaxLayers) { ALOGD_IF(isDebug(), "%s: Unsupported number of layers",__FUNCTION__); return false; } @@ -355,6 +363,7 @@ bool MDPComp::is_doable(hwc_composer_device_t *dev, //FB composition on idle timeout if(sIdleFallBack) { + reset_comp_type(list); ALOGD_IF(isDebug(), "%s: idle fallback",__FUNCTION__); return false; } diff --git a/libhwcomposer/hwc_mdpcomp.h b/libhwcomposer/hwc_mdpcomp.h index 199204c..2c50cd1 100644 --- a/libhwcomposer/hwc_mdpcomp.h +++ b/libhwcomposer/hwc_mdpcomp.h @@ -180,8 +180,7 @@ private: mdp_pipe_info& mdp_info); /* checks for conditions where mdpcomp is not possible */ - static bool is_doable(hwc_composer_device_t *dev, - const hwc_layer_list_t* list); + static bool is_doable(hwc_composer_device_t *dev, hwc_layer_list_t* list); static bool setup(hwc_context_t* ctx, hwc_layer_list_t* list); @@ -210,6 +209,8 @@ private: /* reset state */ static void reset( hwc_context_t *ctx, hwc_layer_list_t* list ); + /* reset compostiion type to default */ + static void reset_comp_type(hwc_layer_list_t* list); /* Is feature enabled */ static bool isEnabled() { return sMaxLayers ? true : false; }; diff --git a/libhwcomposer/hwc_uevents.cpp b/libhwcomposer/hwc_uevents.cpp index f58fbd3..1953c8a 100644 --- a/libhwcomposer/hwc_uevents.cpp +++ b/libhwcomposer/hwc_uevents.cpp @@ -79,10 +79,11 @@ static void handle_uevent(hwc_context_t* ctx, const char* udata, int len) int connected = 0; if(!(strncmp(str,"online@",strlen("online@")))) { connected = 1; + ctx->mExtDisplay->setExternalDisplay(connected); } else if(!(strncmp(str,"offline@",strlen("offline@")))) { connected = 0; + ctx->mExtDisplay->setExternalDisplay(connected); } - ctx->mExtDisplay->setExternalDisplay(connected); } } diff --git a/libhwcomposer/hwc_uimirror.cpp b/libhwcomposer/hwc_uimirror.cpp index d2b766d..fde69d0 100644 --- a/libhwcomposer/hwc_uimirror.cpp +++ b/libhwcomposer/hwc_uimirror.cpp @@ -160,6 +160,7 @@ bool UIMirrorOverlay::draw(hwc_context_t *ctx) while(m->fbPostDone == false) { pthread_cond_wait(&(m->fbPostCond), &(m->fbPostLock)); } + m->fbPostDone = false; pthread_mutex_unlock(&m->fbPostLock); switch (state) { case ovutils::OV_UI_MIRROR: diff --git a/libhwcomposer/hwc_video.cpp b/libhwcomposer/hwc_video.cpp index e2d9be2..4e7bc5f 100644 --- a/libhwcomposer/hwc_video.cpp +++ b/libhwcomposer/hwc_video.cpp @@ -160,6 +160,8 @@ bool configPrimVid(hwc_context_t *ctx, hwc_layer_t *layer) { dcrop.w = sourceCrop.right - sourceCrop.left; dcrop.h = sourceCrop.bottom - sourceCrop.top; + dpos.x = displayFrame.left; + dpos.y = displayFrame.top; dpos.w = displayFrame.right - displayFrame.left; dpos.h = displayFrame.bottom - displayFrame.top; }