Merge "gralloc: Add debug.gralloc.gfx_ubwc_disable"

This commit is contained in:
Linux Build Service Account
2015-04-24 23:48:25 -07:00
committed by Gerrit - the friendly Code Review server
2 changed files with 13 additions and 1 deletions

View File

@@ -108,6 +108,16 @@ AdrenoMemInfo::AdrenoMemInfo()
*(void **)&LINK_adreno_isUBWCSupportedByGpu =
::dlsym(libadreno_utils, "isUBWCSupportedByGpu");
}
// Check if the overriding property debug.gralloc.gfx_ubwc_disable
// that disables UBWC allocations for the graphics stack is set
gfx_ubwc_disable = 0;
char property[PROPERTY_VALUE_MAX];
property_get("debug.gralloc.gfx_ubwc_disable", property, "0");
if(!(strncmp(property, "1", PROPERTY_VALUE_MAX)) ||
!(strncmp(property, "true", PROPERTY_VALUE_MAX))) {
gfx_ubwc_disable = 1;
}
}
AdrenoMemInfo::~AdrenoMemInfo()
@@ -282,7 +292,7 @@ void AdrenoMemInfo::getGpuAlignedWidthHeight(int width, int height, int format,
int AdrenoMemInfo::isUBWCSupportedByGPU(int format)
{
if (libadreno_utils) {
if (!gfx_ubwc_disable && libadreno_utils) {
if (LINK_adreno_isUBWCSupportedByGpu) {
ADRENOPIXELFORMAT gpu_format = getGpuPixelFormat(format);
return LINK_adreno_isUBWCSupportedByGpu(gpu_format);