Bug 869696 - Disable gralloc surfaces on the Geeksphone Peak. r=jrmuizel

Geeksphone distribute a known bad driver that has issues when using
gralloc-backed surfaces. Performance is much better just falling back to
shared memory.
This commit is contained in:
Chris Lord 2013-07-17 15:34:52 +01:00
parent e2823f5290
commit dbafdacc87

View File

@ -346,13 +346,28 @@ ISurfaceAllocator::PlatformAllocSurfaceDescriptor(const gfxIntSize& aSize,
SurfaceDescriptor* aBuffer)
{
// Check for Nexus S to disable gralloc. We only check for this on ICS or
// earlier, in hopes that JB will work.
// Check for devices that have problems with gralloc. We only check for
// this on ICS or earlier, in hopes that JB will work.
#if ANDROID_VERSION <= 15
char propValue[PROPERTY_VALUE_MAX];
property_get("ro.product.device", propValue, "None");
if (strcmp("crespo",propValue) == 0) {
NS_WARNING("Nexus S has issues with gralloc, falling back to shmem");
static bool checkedDevice = false;
static bool disableGralloc = false;
if (!checkedDevice) {
char propValue[PROPERTY_VALUE_MAX];
property_get("ro.product.device", propValue, "None");
if (strcmp("crespo",propValue) == 0) {
NS_WARNING("Nexus S has issues with gralloc, falling back to shmem");
disableGralloc = true;
} else if (strcmp("peak", propValue) == 0) {
NS_WARNING("Geeksphone Peak has issues with gralloc, falling back to shmem");
disableGralloc = true;
}
checkedDevice = true;
}
if (disableGralloc) {
return false;
}
#endif