gralloc: Add debug.gralloc.gfx_ubwc_disable

This patch adds a new debug property
that can be used to disable UBWC compilant
allocations for graphics stack by gralloc.

Change-Id: I59e5994700730c73d62eec9f74ab6ded60c2d256
This commit is contained in:
Mohan Maiya
2015-04-20 09:20:44 -07:00
parent e6b3209514
commit cbeab9e705
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);

View File

@@ -148,6 +148,8 @@ class AdrenoMemInfo : public android::Singleton <AdrenoMemInfo>
ADRENOPIXELFORMAT getGpuPixelFormat(int hal_format);
private:
// Overriding flag to disable UBWC alloc for graphics stack
int gfx_ubwc_disable;
// Pointer to the padding library.
void *libadreno_utils;