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
This commit is contained in:
Ramakant Singh
2017-09-13 10:40:22 +05:30
committed by Gerrit - the friendly Code Review server
parent 40853a8793
commit fae5989ff0
7 changed files with 918 additions and 20 deletions

View File

@@ -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 @@ static int getExternalNode(const char *type) {
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 @@ static int getExternalNode(const char *type) {
}
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 @@ int getEdidRawData(char *buffer)
}
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 @@ bool isDPConnected() {
}
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 @@ int getDPTestConfig(uint32_t *panelBpp, uint32_t *patternType) {
}
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;
}