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/Android.mk b/libqdutils/Android.mk
index 212c8d8..475fa3b 100644
--- a/libqdutils/Android.mk
+++ b/libqdutils/Android.mk
@@ -9,12 +9,10 @@
LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdutils\"
LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
LOCAL_COPY_HEADERS_TO := $(common_header_export_path)
-LOCAL_COPY_HEADERS := display_config.h mdp_version.h
-LOCAL_SRC_FILES := profiler.cpp mdp_version.cpp \
- idle_invalidator.cpp \
- comptype.cpp qd_utils.cpp \
- cb_utils.cpp display_config.cpp \
- cb_swap_rect.cpp
+LOCAL_COPY_HEADERS := display_config.h
+LOCAL_SRC_FILES := profiler.cpp \
+ qd_utils.cpp \
+ display_config.cpp
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
diff --git a/libqdutils/cb_swap_rect.cpp b/libqdutils/cb_swap_rect.cpp
deleted file mode 100644
index 8c8efec..0000000
--- a/libqdutils/cb_swap_rect.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation or the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "cb_swap_rect.h"
-
-ANDROID_SINGLETON_STATIC_INSTANCE(qdutils::cb_swap_rect);
-
-namespace qdutils {
-
-cb_swap_rect:: cb_swap_rect(){
- swap_rect_feature_on = false ;
-}
-void cb_swap_rect::setSwapRectFeature_on( bool value){
- swap_rect_feature_on = value ;
-}
-bool cb_swap_rect::checkSwapRectFeature_on(){
- return swap_rect_feature_on;
-}
-
-};
diff --git a/libqdutils/cb_swap_rect.h b/libqdutils/cb_swap_rect.h
deleted file mode 100644
index daaeb37..0000000
--- a/libqdutils/cb_swap_rect.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
-* Redistribution and use in source and binary forms, with or without
-* * modification, are permitted provided that the following conditions are
-* met:
-* * Redistributions of source code must retain the above copyrigh
-* notice, this list of conditions and the following disclaimer
-* * Redistributions in binary form must reproduce the above
-* copyright notice, this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided
-* with the distribution.
-* * Neither the name of The Linux Foundation nor the names of its
-* contributors may be used to endorse or promote products derived
-* from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-* * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-#ifndef CB_SWAP_RECT
-#define CB_SWAP_RECT
-
-#include <stdint.h>
-#include <utils/Singleton.h>
-#include <cutils/log.h>
-
-using namespace android;
-namespace qdutils {
-enum {
-HWC_SKIP_HWC_COMPOSITION = 0x00040000,
-};
-
-class cb_swap_rect : public Singleton <cb_swap_rect>
-{
- bool swap_rect_feature_on;
- public :
- cb_swap_rect();
- void setSwapRectFeature_on( bool value);
- bool checkSwapRectFeature_on();
-};
-} // namespace qdutils
-#endif
diff --git a/libqdutils/cb_utils.cpp b/libqdutils/cb_utils.cpp
deleted file mode 100644
index b85b901..0000000
--- a/libqdutils/cb_utils.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
-* Redistribution and use in source and binary forms, with or without
-* * modification, are permitted provided that the following conditions are
-* met:
-* * Redistributions of source code must retain the above copyrigh
-* notice, this list of conditions and the following disclaimer
-* * Redistributions in binary form must reproduce the above
-* copyright notice, this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided
-* with the distribution.
-* * Neither the name of The Linux Foundation nor the names of its
-* contributors may be used to endorse or promote products derived
-* from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-* * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "cb_utils.h"
-#include "cb_swap_rect.h"
-/* get union of two rects into 3rd rect */
-void getUnion(hwc_rect_t& rect1,hwc_rect_t& rect2, hwc_rect_t& irect) {
-
- irect.left = min(rect1.left, rect2.left);
- irect.top = min(rect1.top, rect2.top);
- irect.right = max(rect1.right, rect2.right);
- irect.bottom = max(rect1.bottom, rect2.bottom);
-}
-
-int clear (copybit_device_t *copybit, private_handle_t* hnd, hwc_rect_t& rect)
-{
- int ret = 0;
- copybit_rect_t clear_rect = {rect.left, rect.top,rect.right,rect.bottom};
-
- copybit_image_t buf;
- buf.w = ALIGN(getWidth(hnd),32);
- buf.h = getHeight(hnd);
- buf.format = hnd->format;
- buf.base = (void *)hnd->base;
- buf.handle = (native_handle_t *)hnd;
-
- ret = copybit->clear(copybit, &buf, &clear_rect);
- return ret;
-}
-using namespace android;
-using namespace qhwc;
-namespace qdutils {
-
-int CBUtils::uiClearRegion(hwc_display_contents_1_t* list,
- int version, LayerProp *layerProp, hwc_rect_t dirtyRect,
- copybit_device_t *copybit, private_handle_t *renderBuffer) {
-
- size_t last = list->numHwLayers - 1;
- hwc_rect_t fbFrame = list->hwLayers[last].displayFrame;
- Rect fbFrameRect(fbFrame.left,fbFrame.top,fbFrame.right,fbFrame.bottom);
- Region wormholeRegion(fbFrameRect);
-
- if ((dirtyRect.right - dirtyRect.left > 0) &&
- (dirtyRect.bottom - dirtyRect.top > 0)) {
-#ifdef QCOM_BSP
- Rect tmpRect(dirtyRect.left,dirtyRect.top,dirtyRect.right,
- dirtyRect.bottom);
- Region tmpRegion(tmpRect);
- wormholeRegion = wormholeRegion.intersect(tmpRegion);
-#endif
- }
- if(cb_swap_rect::getInstance().checkSwapRectFeature_on() == true){
- wormholeRegion.set(0,0);
- for(size_t i = 0 ; i < last; i++) {
- if(((list->hwLayers[i].blending == HWC_BLENDING_NONE) &&
- (list->hwLayers[i].planeAlpha == 0xFF)) ||
- !(layerProp[i].mFlags & HWC_COPYBIT) ||
- (list->hwLayers[i].flags & HWC_SKIP_HWC_COMPOSITION))
- continue ;
- hwc_rect_t displayFrame = list->hwLayers[i].displayFrame;
- Rect tmpRect(displayFrame.left,displayFrame.top,
- displayFrame.right,displayFrame.bottom);
- wormholeRegion.set(tmpRect);
- }
- }else{
- for (size_t i = 0 ; i < last; i++) {
- // need to take care only in per pixel blending.
- // Restrict calculation only for copybit layers.
- if((list->hwLayers[i].blending != HWC_BLENDING_NONE) ||
- (list->hwLayers[i].planeAlpha != 0xFF) ||
- !(layerProp[i].mFlags & HWC_COPYBIT))
- continue ;
- hwc_rect_t displayFrame = list->hwLayers[i].displayFrame;
- Rect tmpRect(displayFrame.left,displayFrame.top,displayFrame.right,
- displayFrame.bottom);
- Region tmpRegion(tmpRect);
- wormholeRegion.subtractSelf(wormholeRegion.intersect(tmpRegion));
- }
- }
- if(wormholeRegion.isEmpty()){
- return 1;
- }
- //TO DO :- 1. remove union and call clear for each rect.
- Region::const_iterator it = wormholeRegion.begin();
- Region::const_iterator const end = wormholeRegion.end();
- while (it != end) {
- const Rect& r = *it++;
- hwc_rect_t tmpWormRect = {r.left,r.top,r.right,r.bottom};
- if (version == qdutils::MDP_V3_0_4 ||
- version == qdutils::MDP_V3_0_5) {
- int clear_w = tmpWormRect.right - tmpWormRect.left;
- int clear_h = tmpWormRect.bottom - tmpWormRect.top;
- //mdp can't handle solid fill for one line
- //making solid fill as full in this case
- //disable swap rect if presents
- if ((clear_w == 1) || (clear_h ==1)) {
- clear(copybit, renderBuffer, fbFrame);
- return 0;
- } else {
- clear(copybit, renderBuffer, tmpWormRect);
- }
- } else {
- clear(copybit, renderBuffer, tmpWormRect);
- }
- }
- return 1;
-}
-
-}//namespace qdutils
diff --git a/libqdutils/cb_utils.h b/libqdutils/cb_utils.h
deleted file mode 100644
index 55225b6..0000000
--- a/libqdutils/cb_utils.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
-* Redistribution and use in source and binary forms, with or without
-* * modification, are permitted provided that the following conditions are
-* met:
-* * Redistributions of source code must retain the above copyrigh
-* notice, this list of conditions and the following disclaimer
-* * Redistributions in binary form must reproduce the above
-* copyright notice, this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided
-* with the distribution.
-* * Neither the name of The Linux Foundation nor the names of its
-* contributors may be used to endorse or promote products derived
-* from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-* * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-#ifndef CB_UTIL_H
-#define CB_UTIL_H
-
-#include <ui/Region.h>
-#include "hwc_utils.h"
-#include "copybit.h"
-
-using namespace qhwc;
-namespace qdutils {
-class CBUtils {
-public:
- static int uiClearRegion(hwc_display_contents_1_t* list,
- int version, LayerProp *layerProp, hwc_rect_t dirtyIndex,
- copybit_device_t *copybit, private_handle_t *renderBuffer);
-};
-}//namespace qdutils
-#endif /* end of include guard: CB_UTIL_H*/
-
diff --git a/libqdutils/comptype.cpp b/libqdutils/comptype.cpp
deleted file mode 100644
index a29158a..0000000
--- a/libqdutils/comptype.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2013, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation or the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include<comptype.h>
-
-//Instanticate the QCCompositionType Singleton
-ANDROID_SINGLETON_STATIC_INSTANCE(qdutils::QCCompositionType);
diff --git a/libqdutils/comptype.h b/libqdutils/comptype.h
deleted file mode 100644
index 71f4871..0000000
--- a/libqdutils/comptype.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2012-2013, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation or the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef INCLUDE_LIBQCOM_COMPTYPES
-#define INCLUDE_LIBQCOM_COMPTYPES
-
-#include <stdint.h>
-#include <utils/Singleton.h>
-#include <cutils/properties.h>
-
-using namespace android;
-namespace qdutils {
-// Enum containing the supported composition types
-enum {
- COMPOSITION_TYPE_GPU = 0,
- COMPOSITION_TYPE_MDP = 0x1,
- COMPOSITION_TYPE_C2D = 0x2,
- COMPOSITION_TYPE_CPU = 0x4,
- COMPOSITION_TYPE_DYN = 0x8
-};
-
-/* This class caches the composition type
- */
-class QCCompositionType : public Singleton <QCCompositionType>
-{
- public:
- QCCompositionType();
- ~QCCompositionType() { }
- int getCompositionType() {return mCompositionType;}
- private:
- int mCompositionType;
-
-};
-
-inline QCCompositionType::QCCompositionType()
-{
- char property[PROPERTY_VALUE_MAX];
- mCompositionType = COMPOSITION_TYPE_GPU;
- if (property_get("debug.composition.type", property, "gpu") > 0) {
- if ((strncmp(property, "mdp", 3)) == 0) {
- mCompositionType = COMPOSITION_TYPE_MDP;
- } else if ((strncmp(property, "c2d", 3)) == 0) {
- mCompositionType = COMPOSITION_TYPE_C2D;
- } else if ((strncmp(property, "dyn", 3)) == 0) {
-#ifdef USE_MDP3
- mCompositionType = COMPOSITION_TYPE_DYN | COMPOSITION_TYPE_MDP;
-#else
- mCompositionType = COMPOSITION_TYPE_DYN | COMPOSITION_TYPE_C2D;
-#endif
- }
- }
-}
-
-}; //namespace qdutils
-#endif //INCLUDE_LIBQCOM_COMPTYPES
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
diff --git a/libqdutils/display_config.h b/libqdutils/display_config.h
index 5ff0862..768fe6c 100644
--- a/libqdutils/display_config.h
+++ b/libqdutils/display_config.h
@@ -28,7 +28,6 @@
*/
#include <gralloc_priv.h>
#include <qdMetaData.h>
-#include <mdp_version.h>
#include <hardware/hwcomposer.h>
// This header is for clients to use to set/get global display configuration.
diff --git a/libqdutils/idle_invalidator.cpp b/libqdutils/idle_invalidator.cpp
deleted file mode 100644
index b8db0bf..0000000
--- a/libqdutils/idle_invalidator.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2012, The Linux Foundation. All rights reserved.
-
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "idle_invalidator.h"
-#include <unistd.h>
-#include <poll.h>
-#include <string.h>
-#include <fcntl.h>
-#include <cutils/properties.h>
-
-#define II_DEBUG 0
-#define IDLE_NOTIFY_PATH "/sys/devices/virtual/graphics/fb0/idle_notify"
-#define IDLE_TIME_PATH "/sys/devices/virtual/graphics/fb0/idle_time"
-
-
-static const char *threadName = "IdleInvalidator";
-InvalidatorHandler IdleInvalidator::mHandler = NULL;
-android::sp<IdleInvalidator> IdleInvalidator::sInstance(0);
-
-IdleInvalidator::IdleInvalidator(): Thread(false), mHwcContext(0),
- mTimeoutEventFd(-1) {
- ALOGD_IF(II_DEBUG, "IdleInvalidator::%s", __FUNCTION__);
-}
-
-IdleInvalidator::~IdleInvalidator() {
- if(mTimeoutEventFd >= 0) {
- close(mTimeoutEventFd);
- }
-}
-
-int IdleInvalidator::init(InvalidatorHandler reg_handler, void* user_data) {
- mHandler = reg_handler;
- mHwcContext = user_data;
-
- // Open a sysfs node to receive the timeout notification from driver.
- mTimeoutEventFd = open(IDLE_NOTIFY_PATH, O_RDONLY);
- if (mTimeoutEventFd < 0) {
- ALOGE ("%s:not able to open %s node %s",
- __FUNCTION__, IDLE_NOTIFY_PATH, strerror(errno));
- return -1;
- }
-
- int defaultIdleTime = 70; //ms
- char property[PROPERTY_VALUE_MAX] = {0};
- if((property_get("debug.mdpcomp.idletime", property, NULL) > 0)) {
- defaultIdleTime = atoi(property);
- }
- if(not setIdleTimeout(defaultIdleTime)) {
- close(mTimeoutEventFd);
- mTimeoutEventFd = -1;
- return -1;
- }
-
- //Triggers the threadLoop to run, if not already running.
- run(threadName, android::PRIORITY_LOWEST);
- return 0;
-}
-
-bool IdleInvalidator::setIdleTimeout(const uint32_t& timeout) {
- ALOGD_IF(II_DEBUG, "IdleInvalidator::%s timeout %d",
- __FUNCTION__, timeout);
-
- // Open a sysfs node to send the timeout value to driver.
- int fd = open(IDLE_TIME_PATH, O_WRONLY);
-
- if (fd < 0) {
- ALOGE ("%s:Unable to open %s node %s",
- __FUNCTION__, IDLE_TIME_PATH, strerror(errno));
- return false;
- }
-
- char strSleepTime[64];
- snprintf(strSleepTime, sizeof(strSleepTime), "%d", timeout);
-
- // Notify driver about the timeout value
- ssize_t len = pwrite(fd, strSleepTime, strlen(strSleepTime), 0);
- if(len < -1) {
- ALOGE ("%s:Unable to write into %s node %s",
- __FUNCTION__, IDLE_TIME_PATH, strerror(errno));
- close(fd);
- return false;
- }
-
- close(fd);
- return true;
-}
-
-bool IdleInvalidator::threadLoop() {
- ALOGD_IF(II_DEBUG, "IdleInvalidator::%s", __FUNCTION__);
- struct pollfd pFd;
- pFd.fd = mTimeoutEventFd;
- if (pFd.fd >= 0)
- pFd.events = POLLPRI | POLLERR;
- // Poll for an timeout event from driver
- int err = poll(&pFd, 1, -1);
- if(err > 0) {
- if (pFd.revents & POLLPRI) {
- char data[64];
- // Consume the node by reading it
- ssize_t len = pread(pFd.fd, data, 64, 0);
- ALOGD_IF(II_DEBUG, "IdleInvalidator::%s Idle Timeout fired len %zd",
- __FUNCTION__, len);
- mHandler((void*)mHwcContext);
- }
- }
- return true;
-}
-
-int IdleInvalidator::readyToRun() {
- ALOGD_IF(II_DEBUG, "IdleInvalidator::%s", __FUNCTION__);
- return 0; /*NO_ERROR*/
-}
-
-void IdleInvalidator::onFirstRef() {
- ALOGD_IF(II_DEBUG, "IdleInvalidator::%s", __FUNCTION__);
-}
-
-IdleInvalidator *IdleInvalidator::getInstance() {
- ALOGD_IF(II_DEBUG, "IdleInvalidator::%s", __FUNCTION__);
- if(sInstance.get() == NULL)
- sInstance = new IdleInvalidator();
- return sInstance.get();
-}
diff --git a/libqdutils/idle_invalidator.h b/libqdutils/idle_invalidator.h
deleted file mode 100644
index 52334a0..0000000
--- a/libqdutils/idle_invalidator.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2012, The Linux Foundation. All rights reserved.
-
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef INCLUDE_IDLEINVALIDATOR
-#define INCLUDE_IDLEINVALIDATOR
-
-#include <cutils/log.h>
-#include <utils/threads.h>
-#include <gr.h>
-
-typedef void (*InvalidatorHandler)(void*);
-
-class IdleInvalidator : public android::Thread {
- IdleInvalidator();
- void *mHwcContext;
- int mTimeoutEventFd;
- static InvalidatorHandler mHandler;
- static android::sp<IdleInvalidator> sInstance;
-
-public:
- ~IdleInvalidator();
- /* init timer obj */
- int init(InvalidatorHandler reg_handler, void* user_data);
- bool setIdleTimeout(const uint32_t& timeout);
-
- /*Overrides*/
- virtual bool threadLoop();
- virtual int readyToRun();
- virtual void onFirstRef();
- static IdleInvalidator *getInstance();
-};
-
-#endif // INCLUDE_IDLEINVALIDATOR
diff --git a/libqdutils/mdp_version.cpp b/libqdutils/mdp_version.cpp
deleted file mode 100644
index f62f3d0..0000000
--- a/libqdutils/mdp_version.cpp
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
-
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include <cutils/log.h>
-#include <linux/msm_mdp.h>
-#include "mdp_version.h"
-#include "qd_utils.h"
-
-#define DEBUG 0
-
-ANDROID_SINGLETON_STATIC_INSTANCE(qdutils::MDPVersion);
-namespace qdutils {
-
-#define TOKEN_PARAMS_DELIM "="
-
-// chip variants have same major number and minor numbers usually vary
-// for e.g., MDSS_MDP_HW_REV_101 is 0x10010000
-// 1001 - major number
-// 0000 - minor number
-// 8x26 v1 minor number is 0000
-// v2 minor number is 0001 etc..
-#ifndef MDSS_MDP_HW_REV_100
-#define MDSS_MDP_HW_REV_100 0x10000000 //8974 v1
-#endif
-#ifndef MDSS_MDP_HW_REV_101
-#define MDSS_MDP_HW_REV_101 0x10010000 //8x26
-#endif
-#ifndef MDSS_MDP_HW_REV_102
-#define MDSS_MDP_HW_REV_102 0x10020000 //8974 v2
-#endif
-#ifndef MDSS_MDP_HW_REV_103
-#define MDSS_MDP_HW_REV_103 0x10030000 //8084
-#endif
-#ifndef MDSS_MDP_HW_REV_104
-#define MDSS_MDP_HW_REV_104 0x10040000 //Unused
-#endif
-#ifndef MDSS_MDP_HW_REV_105
-#define MDSS_MDP_HW_REV_105 0x10050000 //8994
-#endif
-#ifndef MDSS_MDP_HW_REV_106
-#define MDSS_MDP_HW_REV_106 0x10060000 //8x16
-#endif
-#ifndef MDSS_MDP_HW_REV_107
-#define MDSS_MDP_HW_REV_107 0x10070000 //Unused
-#endif
-#ifndef MDSS_MDP_HW_REV_108
-#define MDSS_MDP_HW_REV_108 0x10080000 //8x39 & 8x36
-#endif
-#ifndef MDSS_MDP_HW_REV_109
-#define MDSS_MDP_HW_REV_109 0x10090000 //8994 v2
-#endif
-#ifndef MDSS_MDP_HW_REV_110
-#define MDSS_MDP_HW_REV_110 0x100a0000 //8992
-#endif
-#ifndef MDSS_MDP_HW_REV_111
-#define MDSS_MDP_HW_REV_111 0x100b0000 //Unused or Next version
-#endif
-#ifndef MDSS_MDP_HW_REV_112
-#define MDSS_MDP_HW_REV_112 0x100c0000 // 8x52
-#endif
-#ifndef MDSS_MDP_HW_REV_113
-#define MDSS_MDP_HW_REV_113 0x100d0000 //Unused Next version
-#endif
-#ifndef MDSS_MDP_HW_REV_200
-#define MDSS_MDP_HW_REV_200 0x20000000 //8092
-#endif
-#ifndef MDSS_MDP_HW_REV_206
-#define MDSS_MDP_HW_REV_206 0x20060000 //Future
-#endif
-
-MDPVersion::MDPVersion()
-{
- mMDPVersion = MDSS_V5;
- mMdpRev = 0;
- mRGBPipes = 0;
- mVGPipes = 0;
- mDMAPipes = 0;
- mCursorPipes = 0;
- mFeatures = 0;
- mMDPUpscale = 1;
- mMDPDownscale = 1;
- mMacroTileEnabled = false;
- mLowBw = 0;
- mHighBw = 0;
- mSourceSplit = false;
- mSourceSplitAlways = false;
- mRGBHasNoScalar = false;
- mRotDownscale = false;
- mBlendStages = 4; //min no. of stages supported by MDP.
-
- // this is the default limit of mixer unless driver reports it.
- // For resolutions beyond this, we use dual mixer/ping pong split.
- mMaxMixerWidth = 2048;
-
- // Default width of MDSS SSPP. For layer resolutions beyond this, we drive
- // using two SSPP's.
- mMaxPipeWidth = 2048;
- mMaxCursorSize = 0;
-
- updatePanelInfo();
-
- if(!updateSysFsInfo()) {
- ALOGE("Unable to read display sysfs node");
- }
- if (mMdpRev == MDP_V3_0_4){
- mMDPVersion = MDP_V3_0_4;
- }
- else if (mMdpRev == MDP_V3_0_5){
- mMDPVersion = MDP_V3_0_5;
- }
-
- mHasOverlay = false;
- if((mMDPVersion >= MDP_V4_0) ||
- (mMDPVersion == MDP_V_UNKNOWN) ||
- (mMDPVersion == MDP_V3_0_4) ||
- (mMDPVersion == MDP_V3_0_5))
- mHasOverlay = true;
- if(!updateSplitInfo()) {
- ALOGE("Unable to read display split node");
- }
-}
-
-MDPVersion::~MDPVersion() {
- close(mFd);
-}
-
-int MDPVersion::tokenizeParams(char *inputParams, const char *delim,
- char* tokenStr[], int *idx) {
- char *tmp_token = NULL;
- char *temp_ptr;
- int index = 0;
- if (!inputParams) {
- return -1;
- }
- tmp_token = strtok_r(inputParams, delim, &temp_ptr);
- while (tmp_token != NULL) {
- tokenStr[index++] = tmp_token;
- tmp_token = strtok_r(NULL, " ", &temp_ptr);
- }
- *idx = index;
- return 0;
-}
-// This function reads the sysfs node to read the primary panel type
-// and updates information accordingly
-void MDPVersion::updatePanelInfo() {
- FILE *displayDeviceFP = NULL;
- FILE *panelInfoNodeFP = NULL;
- char fbType[MAX_FRAME_BUFFER_NAME_SIZE];
- const char *strCmdPanel = "mipi dsi cmd panel";
- const char *strVideoPanel = "mipi dsi video panel";
- const char *strLVDSPanel = "lvds panel";
- const char *strEDPPanel = "edp panel";
-
- displayDeviceFP = fopen("/sys/class/graphics/fb0/msm_fb_type", "r");
- if(displayDeviceFP){
- fread(fbType, sizeof(char), MAX_FRAME_BUFFER_NAME_SIZE,
- displayDeviceFP);
- if(strncmp(fbType, strCmdPanel, strlen(strCmdPanel)) == 0) {
- mPanelInfo.mType = MIPI_CMD_PANEL;
- }
- else if(strncmp(fbType, strVideoPanel, strlen(strVideoPanel)) == 0) {
- mPanelInfo.mType = MIPI_VIDEO_PANEL;
- }
- else if(strncmp(fbType, strLVDSPanel, strlen(strLVDSPanel)) == 0) {
- mPanelInfo.mType = LVDS_PANEL;
- }
- else if(strncmp(fbType, strEDPPanel, strlen(strEDPPanel)) == 0) {
- mPanelInfo.mType = EDP_PANEL;
- }
- fclose(displayDeviceFP);
- } else {
- ALOGE("Unable to read Primary Panel Information");
- }
-
- panelInfoNodeFP = fopen("/sys/class/graphics/fb0/msm_fb_panel_info", "r");
- if(panelInfoNodeFP){
- size_t len = PAGE_SIZE;
- ssize_t read;
- char *readLine = (char *) malloc (len);
- char property[PROPERTY_VALUE_MAX];
- while((read = getline((char **)&readLine, &len,
- panelInfoNodeFP)) != -1) {
- int token_ct=0;
- char *tokens[10];
- memset(tokens, 0, sizeof(tokens));
-
- if(!tokenizeParams(readLine, TOKEN_PARAMS_DELIM, tokens,
- &token_ct)) {
- if(!strncmp(tokens[0], "pu_en", strlen("pu_en"))) {
- mPanelInfo.mPartialUpdateEnable = atoi(tokens[1]);
- ALOGI("PartialUpdate status: %s",
- mPanelInfo.mPartialUpdateEnable? "Enabled" :
- "Disabled");
- }
- if(!strncmp(tokens[0], "xstart", strlen("xstart"))) {
- mPanelInfo.mLeftAlign = atoi(tokens[1]);
- ALOGI("Left Align: %d", mPanelInfo.mLeftAlign);
- }
- if(!strncmp(tokens[0], "walign", strlen("walign"))) {
- mPanelInfo.mWidthAlign = atoi(tokens[1]);
- ALOGI("Width Align: %d", mPanelInfo.mWidthAlign);
- }
- if(!strncmp(tokens[0], "ystart", strlen("ystart"))) {
- mPanelInfo.mTopAlign = atoi(tokens[1]);
- ALOGI("Top Align: %d", mPanelInfo.mTopAlign);
- }
- if(!strncmp(tokens[0], "halign", strlen("halign"))) {
- mPanelInfo.mHeightAlign = atoi(tokens[1]);
- ALOGI("Height Align: %d", mPanelInfo.mHeightAlign);
- }
- if(!strncmp(tokens[0], "min_w", strlen("min_w"))) {
- mPanelInfo.mMinROIWidth = atoi(tokens[1]);
- ALOGI("Min ROI Width: %d", mPanelInfo.mMinROIWidth);
- }
- if(!strncmp(tokens[0], "min_h", strlen("min_h"))) {
- mPanelInfo.mMinROIHeight = atoi(tokens[1]);
- ALOGI("Min ROI Height: %d", mPanelInfo.mMinROIHeight);
- }
- if(!strncmp(tokens[0], "roi_merge", strlen("roi_merge"))) {
- mPanelInfo.mNeedsROIMerge = atoi(tokens[1]);
- ALOGI("Needs ROI Merge: %d", mPanelInfo.mNeedsROIMerge);
- }
- if(!strncmp(tokens[0], "dyn_fps_en", strlen("dyn_fps_en"))) {
- mPanelInfo.mDynFpsSupported = atoi(tokens[1]);
- ALOGI("Dynamic Fps: %s", mPanelInfo.mDynFpsSupported ?
- "Enabled" : "Disabled");
- }
- if(!strncmp(tokens[0], "min_fps", strlen("min_fps"))) {
- mPanelInfo.mMinFps = atoi(tokens[1]);
- ALOGI("Min Panel fps: %d", mPanelInfo.mMinFps);
- }
- if(!strncmp(tokens[0], "max_fps", strlen("max_fps"))) {
- mPanelInfo.mMaxFps = atoi(tokens[1]);
- ALOGI("Max Panel fps: %d", mPanelInfo.mMaxFps);
- }
- }
- }
- if((property_get("persist.hwc.pubypass", property, 0) > 0) &&
- (!strncmp(property, "1", PROPERTY_VALUE_MAX ) ||
- (!strncasecmp(property,"true", PROPERTY_VALUE_MAX )))) {
- mPanelInfo.mPartialUpdateEnable = 0;
- ALOGI("PartialUpdate disabled by property");
- }
- fclose(panelInfoNodeFP);
- free(readLine);
- } else {
- ALOGE("Failed to open msm_fb_panel_info node");
- }
-}
-
-// This function reads the sysfs node to read MDP capabilities
-// and parses and updates information accordingly.
-bool MDPVersion::updateSysFsInfo() {
- FILE *sysfsFd;
- size_t len = PAGE_SIZE;
- ssize_t read;
- char *line = NULL;
- char sysfsPath[255];
- memset(sysfsPath, 0, sizeof(sysfsPath));
- snprintf(sysfsPath , sizeof(sysfsPath),
- "/sys/class/graphics/fb0/mdp/caps");
- char property[PROPERTY_VALUE_MAX];
- bool enableMacroTile = false;
-
- if((property_get("persist.hwc.macro_tile_enable", property, NULL) > 0) &&
- (!strncmp(property, "1", PROPERTY_VALUE_MAX ) ||
- (!strncasecmp(property,"true", PROPERTY_VALUE_MAX )))) {
- enableMacroTile = true;
- }
-
- sysfsFd = fopen(sysfsPath, "rb");
-
- if (sysfsFd == NULL) {
- ALOGE("%s: sysFsFile file '%s' not found",
- __FUNCTION__, sysfsPath);
- return false;
- } else {
- line = (char *) malloc(len);
- while((read = getline(&line, &len, sysfsFd)) != -1) {
- int index=0;
- char *tokens[10];
- memset(tokens, 0, sizeof(tokens));
-
- // parse the line and update information accordingly
- if(!tokenizeParams(line, TOKEN_PARAMS_DELIM, tokens, &index)) {
- if(!strncmp(tokens[0], "hw_rev", strlen("hw_rev"))) {
- mMdpRev = atoi(tokens[1]);
- }
- else if(!strncmp(tokens[0], "rgb_pipes", strlen("rgb_pipes"))) {
- mRGBPipes = (uint8_t)atoi(tokens[1]);
- }
- else if(!strncmp(tokens[0], "vig_pipes", strlen("vig_pipes"))) {
- mVGPipes = (uint8_t)atoi(tokens[1]);
- }
- else if(!strncmp(tokens[0], "dma_pipes", strlen("dma_pipes"))) {
- mDMAPipes = (uint8_t)atoi(tokens[1]);
- }
- else if(!strncmp(tokens[0], "cursor_pipes",
- strlen("cursor_pipes"))) {
- mCursorPipes = (uint8_t)atoi(tokens[1]);
- }
- else if(!strncmp(tokens[0], "blending_stages",
- strlen("blending_stages"))) {
- mBlendStages = (uint8_t)atoi(tokens[1]);
- }
- else if(!strncmp(tokens[0], "max_downscale_ratio",
- strlen("max_downscale_ratio"))) {
- mMDPDownscale = atoi(tokens[1]);
- }
- else if(!strncmp(tokens[0], "max_upscale_ratio",
- strlen("max_upscale_ratio"))) {
- mMDPUpscale = atoi(tokens[1]);
- } else if(!strncmp(tokens[0], "max_bandwidth_low",
- strlen("max_bandwidth_low"))) {
- mLowBw = atol(tokens[1]);
- } else if(!strncmp(tokens[0], "max_bandwidth_high",
- strlen("max_bandwidth_high"))) {
- mHighBw = atol(tokens[1]);
- } else if(!strncmp(tokens[0], "max_mixer_width",
- strlen("max_mixer_width"))) {
- mMaxMixerWidth = atoi(tokens[1]);
- } else if(!strncmp(tokens[0], "max_pipe_width",
- strlen("max_pipe_width"))) {
- mMaxPipeWidth = atoi(tokens[1]);
- } else if(!strncmp(tokens[0], "features", strlen("features"))) {
- for(int i=1; i<index;i++) {
- if(!strncmp(tokens[i], "bwc", strlen("bwc"))) {
- mFeatures |= MDP_BWC_EN;
- } else if(!strncmp(tokens[i], "decimation",
- strlen("decimation"))) {
- mFeatures |= MDP_DECIMATION_EN;
- } else if(!strncmp(tokens[i], "tile_format",
- strlen("tile_format"))) {
- if(enableMacroTile)
- mMacroTileEnabled = true;
- } else if(!strncmp(tokens[i], "src_split",
- strlen("src_split"))) {
- mSourceSplit = true;
- } else if(!strncmp(tokens[i], "non_scalar_rgb",
- strlen("non_scalar_rgb"))) {
- mRGBHasNoScalar = true;
- } else if(!strncmp(tokens[i], "rotator_downscale",
- strlen("rotator_downscale"))) {
- mRotDownscale = true;
- }
- }
- } else if(!strncmp(tokens[0], "max_cursor_size",
- strlen("max_cursor_size"))) {
- mMaxCursorSize = atoi(tokens[1]);
- }
- }
- }
- free(line);
- fclose(sysfsFd);
- }
-
- if(mMDPVersion >= qdutils::MDP_V4_2 and mMDPVersion < qdutils::MDSS_V5) {
- mRotDownscale = true;
- }
-
- if(mSourceSplit) {
- memset(sysfsPath, 0, sizeof(sysfsPath));
- snprintf(sysfsPath , sizeof(sysfsPath),
- "/sys/class/graphics/fb0/msm_fb_src_split_info");
-
- sysfsFd = fopen(sysfsPath, "rb");
- if (sysfsFd == NULL) {
- ALOGE("%s: Opening file %s failed with error %s", __FUNCTION__,
- sysfsPath, strerror(errno));
- return false;
- } else {
- line = (char *) malloc(len);
- if((read = getline(&line, &len, sysfsFd)) != -1) {
- if(!strncmp(line, "src_split_always",
- strlen("src_split_always"))) {
- mSourceSplitAlways = true;
- }
- }
- free(line);
- fclose(sysfsFd);
- }
- }
-
- ALOGD_IF(DEBUG, "%s: mMDPVersion: %d mMdpRev: %x mRGBPipes:%d,"
- "mVGPipes:%d mCursorPipes:%d", __FUNCTION__, mMDPVersion,
- mMdpRev, mRGBPipes, mVGPipes, mCursorPipes);
- ALOGD_IF(DEBUG, "%s:mDMAPipes:%d \t mMDPDownscale:%d, mFeatures:%d",
- __FUNCTION__, mDMAPipes, mMDPDownscale, mFeatures);
- ALOGD_IF(DEBUG, "%s:mLowBw: %lu mHighBw: %lu", __FUNCTION__, mLowBw,
- mHighBw);
-
- return true;
-}
-
-// This function reads the sysfs node to read MDP capabilities
-// and parses and updates information accordingly.
-bool MDPVersion::updateSplitInfo() {
- if(mMDPVersion >= MDSS_V5) {
- char split[64] = {0};
- FILE* fp = fopen("/sys/class/graphics/fb0/msm_fb_split", "r");
- if(fp){
- //Format "left right" space as delimiter
- if(fread(split, sizeof(char), 64, fp)) {
- split[sizeof(split) - 1] = '\0';
- mSplit.mLeft = atoi(split);
- ALOGI_IF(mSplit.mLeft, "Left Split=%d", mSplit.mLeft);
- char *rght = strpbrk(split, " ");
- if(rght)
- mSplit.mRight = atoi(rght + 1);
- ALOGI_IF(mSplit.mRight, "Right Split=%d", mSplit.mRight);
- }
- } else {
- ALOGE("Failed to open mdss_fb_split node");
- return false;
- }
- if(fp)
- fclose(fp);
- }
- return true;
-}
-
-
-bool MDPVersion::hasMinCropWidthLimitation() const {
- return mMdpRev <= MDSS_MDP_HW_REV_102;
-}
-
-bool MDPVersion::supportsDecimation() {
- return mFeatures & MDP_DECIMATION_EN;
-}
-
-uint32_t MDPVersion::getMaxMDPDownscale() {
- return mMDPDownscale;
-}
-
-uint32_t MDPVersion::getMaxMDPUpscale() {
- return mMDPUpscale;
-}
-
-bool MDPVersion::supportsBWC() {
- // BWC - Bandwidth Compression
- return (mFeatures & MDP_BWC_EN);
-}
-
-bool MDPVersion::supportsMacroTile() {
- // MACRO TILE support
- return mMacroTileEnabled;
-}
-
-bool MDPVersion::isSrcSplit() const {
- return mSourceSplit;
-}
-
-bool MDPVersion::isSrcSplitAlways() const {
- return mSourceSplitAlways;
-}
-
-bool MDPVersion::isRGBScalarSupported() const {
- return (!mRGBHasNoScalar);
-}
-
-bool MDPVersion::is8x26() {
- return (mMdpRev >= MDSS_MDP_HW_REV_101 and
- mMdpRev < MDSS_MDP_HW_REV_102);
-}
-
-bool MDPVersion::is8x74v2() {
- return (mMdpRev >= MDSS_MDP_HW_REV_102 and
- mMdpRev < MDSS_MDP_HW_REV_103);
-}
-
-bool MDPVersion::is8084() {
- return (mMdpRev >= MDSS_MDP_HW_REV_103 and
- mMdpRev < MDSS_MDP_HW_REV_104);
-}
-
-bool MDPVersion::is8092() {
- return (mMdpRev >= MDSS_MDP_HW_REV_200 and
- mMdpRev < MDSS_MDP_HW_REV_206);
-}
-
-bool MDPVersion::is8994() {
- return ((mMdpRev >= MDSS_MDP_HW_REV_105 and
- mMdpRev < MDSS_MDP_HW_REV_106) or
- (mMdpRev >= MDSS_MDP_HW_REV_109 and
- mMdpRev < MDSS_MDP_HW_REV_110));
-}
-
-bool MDPVersion::is8x16() {
- return (mMdpRev >= MDSS_MDP_HW_REV_106 and
- mMdpRev < MDSS_MDP_HW_REV_107);
-}
-
-bool MDPVersion::is8x39() {
- return (mMdpRev >= MDSS_MDP_HW_REV_108 and
- mMdpRev < MDSS_MDP_HW_REV_109);
-}
-
-bool MDPVersion::is8992() {
- return ((mMdpRev >= MDSS_MDP_HW_REV_110 and
- mMdpRev < MDSS_MDP_HW_REV_200));
-}
-
-bool MDPVersion::is8x52() {
- return (mMdpRev >= MDSS_MDP_HW_REV_112 and
- mMdpRev < MDSS_MDP_HW_REV_113);
-}
-
-}; //namespace qdutils
-
diff --git a/libqdutils/mdp_version.h b/libqdutils/mdp_version.h
deleted file mode 100644
index 25356f8..0000000
--- a/libqdutils/mdp_version.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
-
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef INCLUDE_LIBQCOMUTILS_MDPVER
-#define INCLUDE_LIBQCOMUTILS_MDPVER
-
-#include <stdint.h>
-#include <utils/Singleton.h>
-#include <cutils/properties.h>
-
-/* This class gets the MSM type from the soc info
-*/
-using namespace android;
-namespace qdutils {
-// These panel definitions are available at mdss_mdp.h which is internal header
-// file and is not available at <linux/mdss_mdp.h>.
-// ToDo: once it is available at linux/mdss_mdp.h, these below definitions can
-// be removed.
-enum mdp_version {
- MDP_V_UNKNOWN = 0,
- MDP_V2_2 = 220,
- MDP_V3_0 = 300,
- MDP_V3_0_3 = 303,
- MDP_V3_0_4 = 304,
- MDP_V3_0_5 = 305,
- MDP_V3_1 = 310,
- MDP_V4_0 = 400,
- MDP_V4_1 = 410,
- MDP_V4_2 = 420,
- MDP_V4_3 = 430,
- MDP_V4_4 = 440,
- MDSS_V5 = 500,
-};
-
-#define NO_PANEL '0'
-#define MDDI_PANEL '1'
-#define EBI2_PANEL '2'
-#define LCDC_PANEL '3'
-#define EXT_MDDI_PANEL '4'
-#define TV_PANEL '5'
-#define DTV_PANEL '7'
-#define MIPI_VIDEO_PANEL '8'
-#define MIPI_CMD_PANEL '9'
-#define WRITEBACK_PANEL 'a'
-#define LVDS_PANEL 'b'
-#define EDP_PANEL 'c'
-
-class MDPVersion;
-
-struct Split {
- int mLeft;
- int mRight;
- Split() : mLeft(0), mRight(0){}
- int left() { return mLeft; }
- int right() { return mRight; }
- friend class MDPVersion;
-};
-
-struct PanelInfo {
- char mType; // Smart or Dumb
- int mPartialUpdateEnable; // Partial update feature
- int mLeftAlign; // ROI left alignment restriction
- int mWidthAlign; // ROI width alignment restriction
- int mTopAlign; // ROI top alignment restriction
- int mHeightAlign; // ROI height alignment restriction
- int mMinROIWidth; // Min width needed for ROI
- int mMinROIHeight; // Min height needed for ROI
- bool mNeedsROIMerge; // Merge ROI's of both the DSI's
- bool mDynFpsSupported; // Panel Supports dyn fps
- uint32_t mMinFps; // Min fps supported by panel
- uint32_t mMaxFps; // Max fps supported by panel
- PanelInfo() : mType(NO_PANEL), mPartialUpdateEnable(0),
- mLeftAlign(0), mWidthAlign(0), mTopAlign(0), mHeightAlign(0),
- mMinROIWidth(0), mMinROIHeight(0), mNeedsROIMerge(false),
- mDynFpsSupported(0), mMinFps(0), mMaxFps(0) {}
- friend class MDPVersion;
-};
-
-class MDPVersion : public Singleton <MDPVersion>
-{
-public:
- MDPVersion();
- ~MDPVersion();
- int getMDPVersion() {return mMDPVersion;}
- char getPanelType() {return mPanelInfo.mType;}
- bool hasOverlay() {return mHasOverlay;}
- uint8_t getTotalPipes() {
- return (uint8_t)(mRGBPipes + mVGPipes + mDMAPipes);
- }
- uint8_t getRGBPipes() { return mRGBPipes; }
- uint8_t getVGPipes() { return mVGPipes; }
- uint8_t getDMAPipes() { return mDMAPipes; }
- uint8_t getCursorPipes() { return mCursorPipes; }
- uint8_t getBlendStages() { return mBlendStages; }
- bool supportsDecimation();
- uint32_t getMaxMDPDownscale();
- uint32_t getMaxMDPUpscale();
- bool supportsBWC();
- bool supportsMacroTile();
- int getLeftSplit() { return mSplit.left(); }
- int getRightSplit() { return mSplit.right(); }
- bool isPartialUpdateEnabled() { return mPanelInfo.mPartialUpdateEnable; }
- int getLeftAlign() { return mPanelInfo.mLeftAlign; }
- int getWidthAlign() { return mPanelInfo.mWidthAlign; }
- int getTopAlign() { return mPanelInfo.mTopAlign; }
- int getHeightAlign() { return mPanelInfo.mHeightAlign; }
- int getMinROIWidth() { return mPanelInfo.mMinROIWidth; }
- int getMinROIHeight() { return mPanelInfo.mMinROIHeight; }
- bool needsROIMerge() { return mPanelInfo.mNeedsROIMerge; }
- unsigned long getLowBw() { return mLowBw; }
- unsigned long getHighBw() { return mHighBw; }
- bool isRotDownscaleEnabled() { return mRotDownscale; }
- bool isDynFpsSupported() { return mPanelInfo.mDynFpsSupported; }
- uint32_t getMinFpsSupported() { return mPanelInfo.mMinFps; }
- uint32_t getMaxFpsSupported() { return mPanelInfo.mMaxFps; }
- uint32_t getMaxMixerWidth() const { return mMaxMixerWidth; }
- uint32_t getMaxPipeWidth() const { return mMaxPipeWidth; }
- uint32_t getMaxCursorSize() const { return mMaxCursorSize; }
- bool hasMinCropWidthLimitation() const;
- bool isSrcSplit() const;
- bool isSrcSplitAlways() const;
- bool isRGBScalarSupported() const;
- bool is8x26();
- bool is8x74v2();
- bool is8084();
- bool is8092();
- bool is8994();
- bool is8x16();
- bool is8x39();
- bool is8x52();
- bool is8992();
- bool updateSplitInfo();
-
-private:
- bool updateSysFsInfo();
- void updatePanelInfo();
- int tokenizeParams(char *inputParams, const char *delim,
- char* tokenStr[], int *idx);
- int mFd;
- int mMDPVersion;
- bool mHasOverlay;
- uint32_t mMdpRev;
- uint8_t mRGBPipes;
- uint8_t mVGPipes;
- uint8_t mDMAPipes;
- uint8_t mCursorPipes;
- uint8_t mBlendStages;
- uint32_t mFeatures;
- uint32_t mMDPDownscale;
- uint32_t mMDPUpscale;
- bool mMacroTileEnabled;
- Split mSplit;
- PanelInfo mPanelInfo;
- unsigned long mLowBw; //kbps
- unsigned long mHighBw; //kbps
- bool mSourceSplit;
- //Additional property on top of source split
- bool mSourceSplitAlways;
- bool mRGBHasNoScalar;
- bool mRotDownscale;
- uint32_t mMaxMixerWidth; //maximum x-res of a given mdss mixer.
- uint32_t mMaxPipeWidth; //maximum x-res of the mdp pipe.
- uint32_t mMaxCursorSize; //maximum size supported by hw cursor
-};
-}; //namespace qdutils
-#endif //INCLUDE_LIBQCOMUTILS_MDPVER
diff --git a/libqdutils/qd_utils.cpp b/libqdutils/qd_utils.cpp
index 5726202..254df30 100644
--- a/libqdutils/qd_utils.cpp
+++ b/libqdutils/qd_utils.cpp
@@ -28,10 +28,75 @@
*/
#include "qd_utils.h"
-#define QD_UTILS_DEBUG 0
namespace qdutils {
+int parseLine(char *input, char *tokens[], const uint32_t maxToken, uint32_t *count) {
+ char *tmpToken = NULL;
+ char *tmpPtr;
+ uint32_t index = 0;
+ const char *delim = ", =\n";
+ if (!input) {
+ return -1;
+ }
+ tmpToken = strtok_r(input, delim, &tmpPtr);
+ while (tmpToken && index < maxToken) {
+ tokens[index++] = tmpToken;
+ tmpToken = strtok_r(NULL, delim, &tmpPtr);
+ }
+ *count = index;
+
+ return 0;
+}
+
+int querySDEInfo(HWQueryType type, int *value) {
+ FILE *fileptr = NULL;
+ const char *featureName;
+ char stringBuffer[MAX_STRING_LENGTH];
+ uint32_t tokenCount = 0;
+ const uint32_t maxCount = 10;
+ char *tokens[maxCount] = { NULL };
+
+ switch(type) {
+ case HAS_MACRO_TILE:
+ featureName = "tile_format";
+ break;
+
+ default:
+ ALOGE("Invalid query type %d", type);
+ return -EINVAL;
+ }
+
+ fileptr = fopen("/sys/devices/virtual/graphics/fb0/mdp/caps", "rb");
+ if (!fileptr) {
+ ALOGE("File '%s' not found", stringBuffer);
+ return -EINVAL;
+ }
+
+ size_t len = MAX_STRING_LENGTH;
+ ssize_t read;
+ char *line = stringBuffer;
+ while ((read = getline(&line, &len, fileptr)) != -1) {
+ // parse the line and update information accordingly
+ if (parseLine(line, tokens, maxCount, &tokenCount)) {
+ continue;
+ }
+
+ if (strncmp(tokens[0], "features", strlen("features"))) {
+ continue;
+ }
+
+ for (uint32_t i = 0; i < tokenCount; i++) {
+ if (!strncmp(tokens[i], featureName, strlen(featureName))) {
+ *value = 1;
+ }
+ }
+ }
+ fclose(fileptr);
+
+ return 0;
+}
+
int getHDMINode(void)
{
FILE *displayDeviceFP = NULL;
@@ -80,7 +145,7 @@
snprintf(msmFbTypePath, sizeof(msmFbTypePath),
"/sys/class/graphics/fb%d/edid_raw_data", node_id);
- edidFile = open(msmFbTypePath, O_RDONLY, 0);
+ edidFile = open(msmFbTypePath, O_RDONLY, 0);
if (edidFile < 0) {
ALOGE("%s no edid raw data found", __func__);
@@ -92,32 +157,4 @@
return size;
}
-/* Calculates the aspect ratio for based on src & dest */
-void getAspectRatioPosition(int destWidth, int destHeight, int srcWidth,
- int srcHeight, hwc_rect_t& rect) {
- int x =0, y =0;
-
- if (srcWidth * destHeight > destWidth * srcHeight) {
- srcHeight = destWidth * srcHeight / srcWidth;
- srcWidth = destWidth;
- } else if (srcWidth * destHeight < destWidth * srcHeight) {
- srcWidth = destHeight * srcWidth / srcHeight;
- srcHeight = destHeight;
- } else {
- srcWidth = destWidth;
- srcHeight = destHeight;
- }
- if (srcWidth > destWidth) srcWidth = destWidth;
- if (srcHeight > destHeight) srcHeight = destHeight;
- x = (destWidth - srcWidth) / 2;
- y = (destHeight - srcHeight) / 2;
- ALOGD_IF(QD_UTILS_DEBUG, "%s: AS Position: x = %d, y = %d w = %d h = %d",
- __FUNCTION__, x, y, srcWidth , srcHeight);
- // Convert it back to hwc_rect_t
- rect.left = x;
- rect.top = y;
- rect.right = srcWidth + rect.left;
- rect.bottom = srcHeight + rect.top;
-}
-
}; //namespace qdutils
diff --git a/libqdutils/qd_utils.h b/libqdutils/qd_utils.h
index 1d4bc19..2b9ca74 100644
--- a/libqdutils/qd_utils.h
+++ b/libqdutils/qd_utils.h
@@ -45,18 +45,22 @@
#include <hardware/hwcomposer.h>
namespace qdutils {
-#define EDID_RAW_DATA_SIZE 640
-enum qd_utils {
- MAX_FRAME_BUFFER_NAME_SIZE = 128,
- MAX_SYSFS_FILE_PATH = 255,
- SUPPORTED_DOWNSCALE_AREA = (1920*1080)
+enum HWQueryType {
+ HAS_MACRO_TILE = 0,
};
-int getHDMINode(void);
-int getEdidRawData(char *buffer);
+enum {
+ EDID_RAW_DATA_SIZE = 640,
+ MAX_FRAME_BUFFER_NAME_SIZE = 128,
+ MAX_SYSFS_FILE_PATH = 255,
+ MAX_STRING_LENGTH = 1024,
+};
-void getAspectRatioPosition(int destWidth, int destHeight, int srcWidth,
- int srcHeight, hwc_rect_t& rect);
+int parseLine(char *input, char *tokens[], const uint32_t maxToken, uint32_t *count);
+int querySDEInfo(HWQueryType type, int *value);
+int getEdidRawData(char *buffer);
+int getHDMINode(void);
+
}; //namespace qdutils
#endif