From 549f3b19d71119137b54bed3ae63611779342d1d Mon Sep 17 00:00:00 2001 From: Saurabh Shah Date: Tue, 31 Jul 2012 10:49:02 -0700 Subject: [PATCH 1/5] hwc: video: Update destination x, y Update destination x, y after an out-of-bounds video's bounds are recalculated for crop and destination position. Change-Id: I5419f7ae054f709111c39d79ec721686f474ae53 --- libhwcomposer/hwc_video.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; } From 31dcb41d25471648752ac61573b39b8a1c97bd22 Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Sun, 15 Jul 2012 23:56:21 -0700 Subject: [PATCH 2/5] display: Fix warnings, make warnings as errors Change-Id: I61f22765b04112be48e62135db930c415c9c7d37 --- common.mk | 2 ++ libcopybit/copybit_c2d.cpp | 4 ++-- libgralloc/alloc_controller.cpp | 2 +- libhwcomposer/hwc_mdpcomp.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common.mk b/common.mk index a48476e..ecf5d66 100644 --- a/common.mk +++ b/common.mk @@ -16,6 +16,8 @@ common_libs := liblog libutils libcutils libhardware #Common C flags common_flags := -DDEBUG_CALC_FPS -Wno-missing-field-initializers +common_flags += -Werror + 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 5eec414..365be5f 100644 --- a/libcopybit/copybit_c2d.cpp +++ b/libcopybit/copybit_c2d.cpp @@ -446,7 +446,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__); @@ -701,7 +701,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/alloc_controller.cpp b/libgralloc/alloc_controller.cpp index 1802a75..e4d1d68 100644 --- a/libgralloc/alloc_controller.cpp +++ b/libgralloc/alloc_controller.cpp @@ -152,7 +152,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..35b7e7b 100644 --- a/libhwcomposer/hwc_mdpcomp.cpp +++ b/libhwcomposer/hwc_mdpcomp.cpp @@ -343,7 +343,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; } From 0b44443a34cedbad4aa02d18e7c1019348c36949 Mon Sep 17 00:00:00 2001 From: "Arun Kumar K.R" Date: Mon, 30 Jul 2012 18:24:30 -0700 Subject: [PATCH 3/5] hwcomposer: fix the bug in setting connected status to ext display the hdmi driver can send change uevent anytime, in which case, the connected state was getting set to 0, due to its default value. Change-Id: I22dc96acda0272661750277d62c5c11c5156fb3b --- libhwcomposer/hwc_uevents.cpp | 3 ++- libhwcomposer/hwc_uimirror.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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: From 2d0ecf80e6131b1e5799bd13d01c6c699c5db4b4 Mon Sep 17 00:00:00 2001 From: "Arun Kumar K.R" Date: Thu, 2 Aug 2012 19:52:20 -0700 Subject: [PATCH 4/5] libgralloc: include kernel headers Change-Id: If0a4983b7344e1ca58b316e0cb0cc964d1235946 --- libgralloc/Android.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgralloc/Android.mk b/libgralloc/Android.mk index ae745f2..8f4bda4 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\" From 7c86dfe139a930502d77b13cb55540014429ace2 Mon Sep 17 00:00:00 2001 From: Jeykumar Sankaran Date: Thu, 2 Aug 2012 17:41:40 -0700 Subject: [PATCH 5/5] libhwcomposer: Reset composition types on idle timeout. SurfaceFlinger re-creates HWC worklist only for new frame and on layer geometry change. Invalidate triggered by idle timeout refreshes the existing worklist retaining its previous composition type. So its MDP comp's responsibility to clear layer composition types to HWC_FRAMEBUFFER on timeout. Change-Id: Ibf11dd6c12c647c75d36d8cbad408c3ea70588bd --- libhwcomposer/hwc_mdpcomp.cpp | 13 +++++++++++-- libhwcomposer/hwc_mdpcomp.h | 5 +++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp index 35b7e7b..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) { @@ -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; };