sdm: Remove unused libraries, files and functions
1. Remove unused libraries libhdmi, liboverlay and libhwcomposer.
2. Remove unused functions and files from libqdutils.
2. Add querySDEInfo() function in qdutisl to query SDE capability.
Change-Id: Ibea2dd2d22fecb420079e3b7cbbcc57d10f75d49
diff --git a/libqdutils/display_config.cpp b/libqdutils/display_config.cpp
index 0c62ffe..087ef0b 100644
--- a/libqdutils/display_config.cpp
+++ b/libqdutils/display_config.cpp
@@ -280,172 +280,4 @@
return err;
}
-//=============================================================================
-// The functions/methods below run in the context of HWC and
-// are called in response to binder calls from clients
-
-Configs* Configs::getInstance() {
- if(sConfigs == NULL) {
- sConfigs = new Configs();
- if(sConfigs->init() == false) {
- ALOGE("%s(): Configs initialization failed", __FUNCTION__);
- delete sConfigs;
- sConfigs = NULL;
- }
- }
- return sConfigs;
-}
-
-Configs::Configs() : mActiveConfig(0), mConfigsSupported(0) {}
-
-bool Configs::init() {
- DisplayAttributes dpyAttr;
- if(not getCurrentMode(dpyAttr)) {
- ALOGE("%s(): Mode switch is disabled", __FUNCTION__);
- return false;
- }
-
- FILE *fHnd;
- size_t len = PAGE_SIZE;
- ssize_t read = 0;
- uint32_t configCount = 0;
- char sysfsPath[MAX_SYSFS_FILE_PATH];
-
- memset(sysfsPath, '\0', sizeof(sysfsPath));
- snprintf(sysfsPath , sizeof(sysfsPath),
- "/sys/class/graphics/fb0/modes");
-
- fHnd = fopen(sysfsPath, "r");
- if (fHnd == NULL) {
- ALOGE("%s(): Opening file %s failed with error %s", __FUNCTION__,
- sysfsPath, strerror(errno));
- return false;
- }
-
- memset(mModeStr, 0, sizeof(mModeStr));
- while((configCount < CONFIGS_MAX) and
- ((read = getline(&mModeStr[configCount], &len, fHnd)) > 0)) {
- //String is of form "U:1600x2560p-0". Documentation/fb/modedb.txt in the
- //kernel has more info on the format.
- char *xptr = strcasestr(mModeStr[configCount], ":");
- char *yptr = strcasestr(mModeStr[configCount], "x");
- if(xptr && yptr) {
- mConfigs[configCount].xres = atoi(xptr + 1);
- mConfigs[configCount].yres = atoi(yptr + 1);
- ALOGI("%s(): Parsed Config %s", __FUNCTION__,
- mModeStr[configCount]);
- ALOGI("%s(): Config %u: %u x %u", __FUNCTION__, configCount,
- mConfigs[configCount].xres, mConfigs[configCount].yres);
- if(mConfigs[configCount].xres == dpyAttr.xres and
- mConfigs[configCount].yres == dpyAttr.yres) {
- mActiveConfig = configCount;
- }
- } else {
- ALOGE("%s(): Tokenizing str %s failed", __FUNCTION__,
- mModeStr[configCount]);
- //Free memory allocated internally by getline()
- for(uint32_t i = 0; i <= configCount; i++) {
- free(mModeStr[i]);
- }
- fclose(fHnd);
- return false;
- }
- configCount++;
- }
-
- fclose(fHnd);
-
- if(configCount == 0) {
- ALOGE("%s No configs found", __FUNCTION__);
- return false;
- }
- mConfigsSupported = configCount;
- return true;
-}
-
-bool Configs::getCurrentMode(DisplayAttributes& dpyAttr) {
- bool ret = false;
- FILE *fHnd = fopen("/sys/class/graphics/fb0/mode", "r");
- if(fHnd) {
- char *buffer = NULL; //getline will allocate
- size_t len = PAGE_SIZE;
- if(getline(&buffer, &len, fHnd) > 0) {
- //String is of form "U:1600x2560p-0". Documentation/fb/modedb.txt in
- //kernel has more info on the format.
- char *xptr = strcasestr(buffer, ":");
- char *yptr = strcasestr(buffer, "x");
- if(xptr && yptr) {
- dpyAttr.xres = atoi(xptr + 1);
- dpyAttr.yres = atoi(yptr + 1);
- ALOGI("%s(): Parsed Current Config Str %s", __FUNCTION__,
- buffer);
- ALOGI("%s(): Current Config: %u x %u", __FUNCTION__,
- dpyAttr.xres, dpyAttr.yres);
- ret = true;
- }
- }
-
- if(buffer)
- free(buffer);
-
- fclose(fHnd);
- }
- return ret;
-}
-
-bool Configs::setActiveConfig(const uint32_t& index) {
- if(index >= mConfigsSupported) {
- ALOGE("%s(): Invalid Index %u", __FUNCTION__, index);
- return false;
- }
-
- bool ret = true;
- int fd = -1;
- size_t len = PAGE_SIZE;
- char sysfsPath[MAX_SYSFS_FILE_PATH];
- memset(sysfsPath, '\0', sizeof(sysfsPath));
- snprintf(sysfsPath , sizeof(sysfsPath),
- "/sys/class/graphics/fb0/mode");
-
- fd = open(sysfsPath, O_WRONLY);
- if (fd < 0) {
- ALOGE("%s(): Opening file %s failed", __FUNCTION__, sysfsPath);
- return false;
- }
-
- ssize_t written = pwrite(fd, mModeStr[index], strlen(mModeStr[index]), 0);
- if(written <= 0) {
- ALOGE("%s(): Writing config %s to %s failed with error: %s",
- __FUNCTION__, mModeStr[index], sysfsPath, strerror(errno));
- close(fd);
- return false;
- }
-
- ALOGI("%s(): Successfully set config %u", __FUNCTION__, index);
- mActiveConfig = index;
- MDPVersion::getInstance().updateSplitInfo();
- close(fd);
- return true;
-}
-
-Configs* Configs::sConfigs = NULL;
-
-}; //namespace
-
-// ----------------------------------------------------------------------------
-// Screen refresh for native daemons linking dynamically to libqdutils
-// ----------------------------------------------------------------------------
-extern "C" int refreshScreen() {
- int ret = 0;
- ret = screenRefresh();
- return ret;
-}
-
-// ----------------------------------------------------------------------------
-// Native daemons needs to send enable partial update ack for PU to enable
-// ----------------------------------------------------------------------------
-extern "C" int setPartialUpdateState() {
- int ret = 0;
- ret = setPartialUpdate(IQService::ENABLE_PARTIAL_UPDATE);
- return ret;
-}
+}// namespace