Skip to content
Browse files

libhwcomposer: Update dynamic composition for non-overlay targets

* If one or more YUV buffers are present, always use COPYBIT for
  composition.
* Do this only for targets with MDP 3.x
* Update qcomuiClearRegion function with DYN composition check

Change-Id: I09da6a057f227c4f379546164359ce59be7e54e9
CRs-fixed: 359107
  • Loading branch information...
1 parent 81fd358 commit 6ca49412a5c3a41aca12ba4702a09217239657bb Neti Ravi Kumar committed
View
6 libgralloc/Android.mk
@@ -63,11 +63,9 @@ endif
ifeq ($(call is-board-platform,msm7627_surf msm7627_6x),true)
LOCAL_CFLAGS += -DTARGET_MSM7x27
endif
-
-ifeq ($(call is-board-platform,msm7627a),true)
- LOCAL_CFLAGS += -DMDPVERSION_31
+ifeq ($(TARGET_USES_MDP3), true)
+ LOCAL_CFLAGS += -DUSE_MDP3
endif
-
ifeq ($(TARGET_HAVE_HDMI_OUT),true)
LOCAL_CFLAGS += -DHDMI_DUAL_DISPLAY
LOCAL_SHARED_LIBRARIES += liboverlay
View
2 libgralloc/a-family/framebuffer.cpp
@@ -947,7 +947,7 @@ int mapFrameBufferLocked(struct private_module_t* module)
if (strncmp(property, "mdp", 3) == 0) {
module->fbFormat = HAL_PIXEL_FORMAT_RGBX_8888;
} else if (strncmp(property, "dyn", 3) == 0) {
-#ifdef MDPVERSION_31
+#ifdef USE_MDP3
module->fbFormat = HAL_PIXEL_FORMAT_RGBX_8888;
#else
module->fbFormat = HAL_PIXEL_FORMAT_RGBA_8888;
View
3 libhwcomposer/a-family/Android.mk
@@ -24,6 +24,9 @@ LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
ifeq ($(TARGET_HAVE_HDMI_OUT),true)
LOCAL_CFLAGS += -DHDMI_DUAL_DISPLAY
endif
+ifeq ($(TARGET_USES_MDP3), true)
+LOCAL_CFLAGS += -DUSE_MDP3
+endif
ifeq ($(TARGET_USES_OVERLAY),true)
LOCAL_CFLAGS += -DUSE_OVERLAY
endif
View
9 libhwcomposer/a-family/hwcomposer.cpp
@@ -1189,7 +1189,7 @@ inline void getLayerResolution(const hwc_layer_t* layer, int& width, int& height
height = displayFrame.bottom - displayFrame.top;
}
-static bool canUseCopybit(const framebuffer_device_t* fbDev, const hwc_layer_list_t* list) {
+static bool canUseCopybit(const framebuffer_device_t* fbDev, const hwc_layer_list_t* list, const int numYUVBuffers) {
if(!fbDev) {
LOGE("ERROR: %s : fb device is invalid",__func__);
@@ -1199,6 +1199,11 @@ static bool canUseCopybit(const framebuffer_device_t* fbDev, const hwc_layer_lis
if (!list)
return false;
+#ifdef USE_MDP3
+ if (numYUVBuffers)
+ return true;
+#endif
+
int fb_w = fbDev->width;
int fb_h = fbDev->height;
@@ -1471,7 +1476,7 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) {
bool skipComposition = false;
if (list) {
- useCopybit = canUseCopybit(hwcModule->fbDevice, list);
+ useCopybit = canUseCopybit(hwcModule->fbDevice, list, ctx->yuvBufferCount);
// cache the number of layer(like YUV, SecureBuffer, notupdating etc.,)
statCount(ctx, list);
skipComposition = canSkipComposition(ctx, ctx->yuvBufferCount,
View
4 libqcomui/Android.mk
@@ -39,6 +39,10 @@ else
LOCAL_SHARED_LIBRARIES += libmemalloc
endif
+ifeq ($(TARGET_USES_MDP3), true)
+ LOCAL_CFLAGS += -DUSE_MDP3
+endif
+
LOCAL_CFLAGS += -DDEBUG_CALC_FPS
LOCAL_MODULE := libQcomUI
View
3 libqcomui/qcom_ui.cpp
@@ -404,6 +404,9 @@ int qcomuiClearRegion(Region region, EGLDisplay dpy, EGLSurface sur)
if ((COMPOSITION_TYPE_MDP != sCompositionType) &&
(COMPOSITION_TYPE_C2D != sCompositionType) &&
+#ifdef USE_MDP3
+ (COMPOSITION_TYPE_DYN != sCompositionType) &&
+#endif
(COMPOSITION_TYPE_CPU != sCompositionType)) {
// For non CPU/C2D/MDP composition, return an error, so that SF can use
// the GPU to draw the wormhole.

0 comments on commit 6ca4941

Please sign in to comment.
Something went wrong with that request. Please try again.