Merge "qdutils: Query MDP caps for UBWC feature"

This commit is contained in:
Linux Build Service Account
2016-05-25 07:28:56 -07:00
committed by Gerrit - the friendly Code Review server
4 changed files with 33 additions and 21 deletions

View File

@@ -99,14 +99,10 @@ static bool useUncached(const int& usage) {
//------------- MDPCapabilityInfo-----------------------// //------------- MDPCapabilityInfo-----------------------//
MDPCapabilityInfo :: MDPCapabilityInfo() { MDPCapabilityInfo :: MDPCapabilityInfo() {
isMacroTileSupported = false;
qdutils::querySDEInfo(HAS_MACRO_TILE, &isMacroTileSupported); qdutils::querySDEInfo(HAS_MACRO_TILE, &isMacroTileSupported);
qdutils::querySDEInfo(HAS_UBWC, &isUBwcSupported);
} }
int MDPCapabilityInfo :: isMacroTilingSupportedByMDP(){
return isMacroTileSupported;
}
//------------- AdrenoMemInfo-----------------------// //------------- AdrenoMemInfo-----------------------//
AdrenoMemInfo::AdrenoMemInfo() AdrenoMemInfo::AdrenoMemInfo()
{ {
@@ -932,6 +928,7 @@ static bool isUBwcFormat(int format)
static bool isUBwcSupported(int format) static bool isUBwcSupported(int format)
{ {
if (MDPCapabilityInfo::getInstance().isUBwcSupportedByMDP()) {
// Existing HAL formats with UBWC support // Existing HAL formats with UBWC support
switch(format) switch(format)
{ {
@@ -944,8 +941,10 @@ static bool isUBwcSupported(int format)
case HAL_PIXEL_FORMAT_RGBX_1010102: case HAL_PIXEL_FORMAT_RGBX_1010102:
return true; return true;
default: default:
return false; break;
} }
}
return false;
} }
bool isUBwcEnabled(int format, int usage) bool isUBwcEnabled(int format, int usage)

View File

@@ -201,7 +201,9 @@ class AdrenoMemInfo : public android::Singleton <AdrenoMemInfo>
class MDPCapabilityInfo : public android::Singleton <MDPCapabilityInfo> class MDPCapabilityInfo : public android::Singleton <MDPCapabilityInfo>
{ {
int isMacroTileSupported; int isMacroTileSupported = 0;
int isUBwcSupported = 0;
public: public:
MDPCapabilityInfo(); MDPCapabilityInfo();
/* /*
@@ -210,8 +212,14 @@ class MDPCapabilityInfo : public android::Singleton <MDPCapabilityInfo>
* @return 1 : supported * @return 1 : supported
* 0 : not supported * 0 : not supported
*/ */
int isMacroTilingSupportedByMDP(); int isMacroTilingSupportedByMDP() { return isMacroTileSupported; }
/*
* Function to return whether MDP supports UBWC feature
*
* @return 1 : supported
* 0 : not supported
*/
int isUBwcSupportedByMDP() { return isUBwcSupported; }
}; };
#endif /* GR_H_ */ #endif /* GR_H_ */

View File

@@ -62,6 +62,10 @@ int querySDEInfo(HWQueryType type, int *value) {
featureName = "tile_format"; featureName = "tile_format";
break; break;
case HAS_UBWC:
featureName = "ubwc";
break;
default: default:
ALOGE("Invalid query type %d", type); ALOGE("Invalid query type %d", type);
return -EINVAL; return -EINVAL;

View File

@@ -48,6 +48,7 @@ namespace qdutils {
enum HWQueryType { enum HWQueryType {
HAS_MACRO_TILE = 0, HAS_MACRO_TILE = 0,
HAS_UBWC = 1,
}; };
enum { enum {