hwc: Avoid MDP draw if prepare is not successful.
If #AppLayers are 0 or exceed MAX_NUM_APP_LAYERS
return early from MDP draw.
Change-Id: I834c7b04a295fbd9b98374cade880992d995ad1f
diff --git a/libhwcomposer/hwc_mdpcomp.h b/libhwcomposer/hwc_mdpcomp.h
index 520c176..850e242 100644
--- a/libhwcomposer/hwc_mdpcomp.h
+++ b/libhwcomposer/hwc_mdpcomp.h
@@ -43,6 +43,8 @@
int prepare(hwc_context_t *ctx, hwc_display_contents_1_t* list);
/* draw */
virtual bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list) = 0;
+ //Reset values
+ void reset();
/* dumpsys */
void dump(android::String8& buf, hwc_context_t *ctx);
bool isGLESOnlyComp() { return (mCurrentFrame.mdpCount == 0); }
@@ -54,7 +56,6 @@
/* Initialize MDP comp*/
static bool init(hwc_context_t *ctx);
static void resetIdleFallBack() { sIdleFallBack = false; }
- static void reset() { sHandleTimeout = false; };
static bool isIdleFallback() { return sIdleFallBack; }
protected:
@@ -250,6 +251,7 @@
static bool sEnable4k2kYUVSplit;
/* Overlap layer index */
int mOverlapIndex;
+ bool mModeOn; // if prepare happened
bool allocSplitVGPipesfor4k2k(hwc_context_t *ctx, int index);
};