diff --git a/patch/ics_strawberry/hardware/qcom/display/0001-hwc-Framework-should-honor-MDP-Copybit-usage-limitat.patch b/patch/ics_strawberry/hardware/qcom/display/0001-hwc-Framework-should-honor-MDP-Copybit-usage-limitat.patch new file mode 100644 index 0000000000000000000000000000000000000000..61bcbf62b7a7e0ac11d5f845a9a52bcac57e4d9d --- /dev/null +++ b/patch/ics_strawberry/hardware/qcom/display/0001-hwc-Framework-should-honor-MDP-Copybit-usage-limitat.patch @@ -0,0 +1,73 @@ +From 990e0b8cbbae3b61226bbe7bec077814b229bea0 Mon Sep 17 00:00:00 2001 +From: Sushil Chauhan <sushilchauhan@codeaurora.org> +Date: Mon, 11 Nov 2013 10:19:39 -0800 +Subject: [PATCH] hwc: Framework should honor MDP Copybit usage limitation. + +MDP PPP is not efficient when render area of RGB layers is too large +as compared to FrameBuffer area, which can lead to issue like Copybit +source image data cannot be fetched for few BLIT requests leading to +fuzziness on display contents. So framework should honor MDP Copybit +usage limitation especially on high resolution targets (> WVGA) with +default Dynamic Composition. + +Change-Id: I084e9b61ab1619d718b59c1a7acbe14fca2cb089 +--- + libhwcomposer/a-family/hwcomposer.cpp | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/libhwcomposer/a-family/hwcomposer.cpp b/libhwcomposer/a-family/hwcomposer.cpp +index 35fb2a6..a3e609c 100644 +--- a/libhwcomposer/a-family/hwcomposer.cpp ++++ b/libhwcomposer/a-family/hwcomposer.cpp +@@ -1000,19 +1000,21 @@ static bool canUseCopybit(const framebuffer_device_t* fbDev, const hwc_layer_lis + /* + * Use copybit only when we need to blit + * max 2 full screen sized regions + */ + + unsigned int renderArea = 0; + + for(int i = 0; i < list->numHwLayers; i++ ) { +- int w, h; +- getLayerResolution(&list->hwLayers[i], w, h); +- renderArea += w*h; ++ if (list->hwLayers[i].handle) { // Non-color layer ++ int w, h; ++ getLayerResolution(&list->hwLayers[i], w, h); ++ renderArea += w*h; ++ } + } + + return (renderArea <= (2 * fb_w * fb_h)); + } + + static void handleHDMIStateChange(hwc_composer_device_t *dev, int externaltype) { + #if defined HDMI_DUAL_DISPLAY + private_hwc_module_t* hwcModule = reinterpret_cast<private_hwc_module_t*>( +@@ -1807,16 +1809,23 @@ static int hwc_set(hwc_composer_device_t *dev, + ctx->nPipesUsed = 0; + } + closeExtraPipes(ctx); + #endif + + + int ret = 0; + if (list) { ++ if (hwcModule->compositionType & COMPOSITION_TYPE_DYN) { ++ statCount(ctx, list); ++ if (!canUseCopybit(hwcModule->fbDevice, list, ctx->yuvBufferCount)) { ++ LOGD("%s: Cannot use copybit for current frame", __FUNCTION__); ++ return -1; ++ } ++ } + bool bDumpLayers = needToDumpLayers(); // Check need for debugging dumps + for (size_t i=0; i<list->numHwLayers; i++) { + if (bDumpLayers) + dumpLayer(hwcModule->compositionType, list->flags, i, list->hwLayers); + if (list->hwLayers[i].flags & HWC_SKIP_LAYER) { + continue; + } else if(list->hwLayers[i].flags & HWC_USE_EXT_ONLY) { + continue; +-- +1.8.2.1 +