OSDN Git Service

libui: log an error on allocation failure
authorChia-I Wu <olv@google.com>
Thu, 20 Apr 2017 05:20:55 +0000 (22:20 -0700)
committerChia-I Wu <olv@google.com>
Thu, 20 Apr 2017 05:30:53 +0000 (22:30 -0700)
This was on the gralloc0/gralloc1 path, but was missing from the HIDL
gralloc path.

Bug: 37444686
Test: allocate an invalid buffer
Change-Id: If1ea0e27c228d82abbcd6f6290eb8fee423828e7

libs/ui/GraphicBufferAllocator.cpp

index 9beed0e..11f0250 100644 (file)
@@ -137,6 +137,10 @@ status_t GraphicBufferAllocator::allocate(uint32_t width, uint32_t height,
 
         return NO_ERROR;
     } else {
+        ALOGE("Failed to allocate (%u x %u) layerCount %u format %d "
+                "producerUsage %" PRIx64 " consumerUsage %" PRIx64 ": %d",
+                width, height, layerCount, format, producerUsage,
+                consumerUsage, error);
         return NO_MEMORY;
     }
 }