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:
@@ -108,6 +108,16 @@ AdrenoMemInfo::AdrenoMemInfo()
|
|||||||
*(void **)&LINK_adreno_isUBWCSupportedByGpu =
|
*(void **)&LINK_adreno_isUBWCSupportedByGpu =
|
||||||
::dlsym(libadreno_utils, "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()
|
AdrenoMemInfo::~AdrenoMemInfo()
|
||||||
@@ -282,7 +292,7 @@ void AdrenoMemInfo::getGpuAlignedWidthHeight(int width, int height, int format,
|
|||||||
|
|
||||||
int AdrenoMemInfo::isUBWCSupportedByGPU(int format)
|
int AdrenoMemInfo::isUBWCSupportedByGPU(int format)
|
||||||
{
|
{
|
||||||
if (libadreno_utils) {
|
if (!gfx_ubwc_disable && libadreno_utils) {
|
||||||
if (LINK_adreno_isUBWCSupportedByGpu) {
|
if (LINK_adreno_isUBWCSupportedByGpu) {
|
||||||
ADRENOPIXELFORMAT gpu_format = getGpuPixelFormat(format);
|
ADRENOPIXELFORMAT gpu_format = getGpuPixelFormat(format);
|
||||||
return LINK_adreno_isUBWCSupportedByGpu(gpu_format);
|
return LINK_adreno_isUBWCSupportedByGpu(gpu_format);
|
||||||
|
|||||||
@@ -148,6 +148,8 @@ class AdrenoMemInfo : public android::Singleton <AdrenoMemInfo>
|
|||||||
ADRENOPIXELFORMAT getGpuPixelFormat(int hal_format);
|
ADRENOPIXELFORMAT getGpuPixelFormat(int hal_format);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// Overriding flag to disable UBWC alloc for graphics stack
|
||||||
|
int gfx_ubwc_disable;
|
||||||
// Pointer to the padding library.
|
// Pointer to the padding library.
|
||||||
void *libadreno_utils;
|
void *libadreno_utils;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user