sdm: Add support for compliance test mode for DP

1. Add functionality in qdutils to get the DP test config from the
   sysfs node.
2. Add support to generate ColorRamp, ColorSquare and Black and White
   vertical line test pattern for 18/24/30 bpp DP display
3. Create layer stack with test layer and ignore all layers from
   the SF framework.
4. Generate the pattern with 18/24/30 bpp based on pattern type
   and bpp read from sysfs node and send it to DP interface.
5. Add support to calculate CRC to validate the color
   pattern.
CRs-Fixed: 1107663
Change-Id: I49469d94a96ada729d24d7cc03a7e79f2af6edc0
diff --git a/libqdutils/qd_utils.cpp b/libqdutils/qd_utils.cpp
index 10ac90b..2cce39c 100644
--- a/libqdutils/qd_utils.cpp
+++ b/libqdutils/qd_utils.cpp
@@ -31,6 +31,7 @@
 #include <gralloc_priv.h>
 #include "qd_utils.h"
 
+static const int kFBNodeMax = 4;
 namespace qdutils {
 
 static int parseLine(char *input, char *tokens[], const uint32_t maxToken, uint32_t *count) {
@@ -57,9 +58,9 @@
     char msmFbTypePath[MAX_FRAME_BUFFER_NAME_SIZE];
     int j = 0;
 
-    for(j = 0; j < HWC_NUM_DISPLAY_TYPES; j++) {
+    for(j = 0; j < kFBNodeMax; j++) {
         snprintf (msmFbTypePath, sizeof(msmFbTypePath),
-                  "/sys/class/graphics/fb%d/msm_fb_type", j);
+                  "/sys/devices/virtual/graphics/fb%d/msm_fb_type", j);
         displayDeviceFP = fopen(msmFbTypePath, "r");
         if(displayDeviceFP) {
             fread(fbType, sizeof(char), MAX_FRAME_BUFFER_NAME_SIZE,
@@ -71,11 +72,11 @@
             }
             fclose(displayDeviceFP);
         } else {
-            ALOGE("%s: Failed to open fb node %d", __func__, j);
+            ALOGE("%s: Failed to open fb node %s", __func__, msmFbTypePath);
         }
     }
 
-    if (j < HWC_NUM_DISPLAY_TYPES)
+    if (j < kFBNodeMax)
         return j;
     else
         ALOGE("%s: Failed to find %s node", __func__, type);
@@ -186,12 +187,12 @@
     }
 
     snprintf(msmFbTypePath, sizeof(msmFbTypePath),
-                 "/sys/class/graphics/fb%d/edid_raw_data", node_id);
+                 "/sys/devices/virtual/graphics/fb%d/edid_raw_data", node_id);
 
     edidFile = open(msmFbTypePath, O_RDONLY, 0);
 
     if (edidFile < 0) {
-        ALOGE("%s no edid raw data found", __func__);
+        ALOGE("%s no edid raw data found %s", __func__,msmFbTypePath);
         return 0;
     }
 
@@ -214,11 +215,11 @@
     }
 
     snprintf(connectPath, sizeof(connectPath),
-             "/sys/class/graphics/fb%d/connected", nodeId);
+             "/sys/devices/virtual/graphics/fb%d/connected", nodeId);
 
     connectFile = fopen(connectPath, "rb");
     if (!connectFile) {
-        ALOGW("Failed to open connect node for device node %d", nodeId);
+        ALOGW("Failed to open connect node for device node %s", connectPath);
         return false;
     }
 
@@ -253,11 +254,11 @@
     }
 
     snprintf(configPath, sizeof(configPath),
-             "/sys/class/graphics/fb%d/config", nodeId);
+             "/sys/devices/virtual/graphics/fb%d/config", nodeId);
 
     configFile = fopen(configPath, "rb");
     if (!configFile) {
-        ALOGW("Failed to open config node for device node %d", nodeId);
+        ALOGW("Failed to open config node for device node %s", configPath);
         return -EINVAL;
     }