overlay: Remove OVASSERT from getFormatString utility
Remove OVASSERT from getFormatString utility. OVASSERTS should happen only from
critically wrong states of overlay.
Just failing in this utility method would allow a fall back to GPU.
Change-Id: I4467a750574ee90aee4fa2e0fbb041e7f386a63b
diff --git a/liboverlay/overlayUtils.h b/liboverlay/overlayUtils.h
index eebf5ac..172e8c3 100644
--- a/liboverlay/overlayUtils.h
+++ b/liboverlay/overlayUtils.h
@@ -457,7 +457,7 @@
* rotation is 90, 180 etc
* It returns MDP related enum/define that match rot+flip*/
int getMdpOrient(eTransform rotation);
-const char* getFormatString(uint32_t format);
+const char* getFormatString(int format);
const char* getStateString(eOverlayState state);
// Cannot use HW_OVERLAY_MAGNIFICATION_LIMIT, since at the time
@@ -558,7 +558,7 @@
return false;
}
-inline const char* getFormatString(uint32_t format){
+inline const char* getFormatString(int format){
static const char* const formats[] = {
"MDP_RGB_565",
"MDP_XRGB_8888",
@@ -590,8 +590,10 @@
"MDP_FB_FORMAT",
"MDP_IMGTYPE_LIMIT2"
};
- OVASSERT(format < sizeof(formats) / sizeof(formats[0]),
- "getFormatString wrong fmt %d", format);
+ if(format < 0 || format >= (int)(sizeof(formats) / sizeof(formats[0]))) {
+ ALOGE("%s wrong fmt %d", __FUNCTION__, format);
+ return "Unsupported format";
+ }
return formats[format];
}