diff options
author | Arun Kumar K.R <akumarkr@codeaurora.org> | 2013-06-06 19:43:53 -0700 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-10-27 15:22:36 -0700 |
commit | 18e0ddd40d4f4140b7b4fc2224095ed1145f510c (patch) | |
tree | 477fee607bf561baaffa143cfcfcc8e82b4bdf16 | |
parent | 9a5a87e98daff3e3b552eb8c131ad6253bfefdf9 (diff) | |
download | display-android-cts-6.0_r30.tar.gz |
hwc: Move max app layer check outside isFrameDoable routine.android-cts-6.0_r9android-cts-6.0_r8android-cts-6.0_r7android-cts-6.0_r6android-cts-6.0_r5android-cts-6.0_r4android-cts-6.0_r32android-cts-6.0_r31android-cts-6.0_r30android-cts-6.0_r3android-cts-6.0_r29android-cts-6.0_r28android-cts-6.0_r27android-cts-6.0_r26android-cts-6.0_r25android-cts-6.0_r24android-cts-6.0_r23android-cts-6.0_r22android-cts-6.0_r21android-cts-6.0_r20android-cts-6.0_r19android-cts-6.0_r18android-cts-6.0_r17android-cts-6.0_r16android-cts-6.0_r15android-cts-6.0_r14android-cts-6.0_r13android-cts-6.0_r12android-6.0.0_r7marshmallow-releasemarshmallow-cts-release
Move the condition for checking maximum number of app layers
ourside the isFrameDoable function to avoid heap corruption while
updating hnd array in cacheAll function.
Bug: 24163261
Acked-by: Ramkumar Radhakrishnan <ramkumar@codeaurora.org>
Change-Id: Id4458fcadc7775a2d78b1849de6782857c6ac17f
-rw-r--r-- | msm8960/libhwcomposer/hwc_mdpcomp.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/msm8960/libhwcomposer/hwc_mdpcomp.cpp b/msm8960/libhwcomposer/hwc_mdpcomp.cpp index b302943a..939a7869 100644 --- a/msm8960/libhwcomposer/hwc_mdpcomp.cpp +++ b/msm8960/libhwcomposer/hwc_mdpcomp.cpp @@ -355,10 +355,6 @@ bool MDPComp::isFrameDoable(hwc_context_t *ctx) { } else if(ctx->mVideoTransFlag) { ALOGD_IF(isDebug(), "%s: MDP Comp. video transition padding round", __FUNCTION__); - } else if(numAppLayers > MAX_NUM_APP_LAYERS) { - ALOGD_IF(isDebug(), "%s: Number of App layers exceeded the limit ", - __FUNCTION__); - ret = false; } return ret; } @@ -730,10 +726,19 @@ bool MDPComp::programYUV(hwc_context_t *ctx, hwc_display_contents_1_t* list) { int MDPComp::prepare(hwc_context_t *ctx, hwc_display_contents_1_t* list) { - //reset old data const int numLayers = ctx->listStats[mDpy].numAppLayers; + + //reset old data mCurrentFrame.reset(numLayers); + //number of app layers exceeds MAX_NUM_APP_LAYERS fall back to GPU + //do not cache the information for next draw cycle. + if(numLayers > MAX_NUM_APP_LAYERS) { + ALOGD_IF(isDebug(), "%s: Number of App layers exceeded the limit ", + __FUNCTION__); + return 0; + } + //Hard conditions, if not met, cannot do MDP comp if(!isFrameDoable(ctx)) { ALOGD_IF( isDebug(),"%s: MDP Comp not possible for this frame", |