qdutils: Parse panel type dynamically from panel info

Parse the panel type from the panel info string using string operations
rather than relying on constant offset (which would have to be update for
any changes in length to the preceding MDP/MDSS version string). Assumes
that panel type is the first character after the first '_' in the panel
info string.

Change-Id: I33178e7219c26e0e0361e53941f15a3d38f99b71
diff --git a/libqdutils/mdp_version.cpp b/libqdutils/mdp_version.cpp
index e3e78ca..46112e3 100644
--- a/libqdutils/mdp_version.cpp
+++ b/libqdutils/mdp_version.cpp
@@ -90,10 +90,14 @@
         } else {
             mdp_version = MDP_V_UNKNOWN;
         }
-        int len = strlen("msmfbXX_");
-        if (mdp_version == MDP_V3_0_3)
-            len++;
-        panel_type = fb_finfo.id[len];
+
+        /* Assumes panel type is 2nd element in '_' delimited id string */
+        char * ptype = strstr(fb_finfo.id, "_");
+        if (!ptype || (*(++ptype) == '\0')) {
+            ALOGE("Invalid framebuffer info string: %s", fb_finfo.id);
+            ptype = fb_finfo.id;
+        }
+        panel_type = *ptype;
 
     }
     close(fb_fd);