gralloc1: Add additional debug logging
CRs-Fixed: 2018334
Change-Id: I4ef2613ec69ca98818ed9c4f8d2408c4df2d039e
diff --git a/libgralloc1/gr_priv_handle.h b/libgralloc1/gr_priv_handle.h
index 9a7e7b6..27d405b 100644
--- a/libgralloc1/gr_priv_handle.h
+++ b/libgralloc1/gr_priv_handle.h
@@ -23,6 +23,7 @@
#include <cutils/log.h>
#include <hardware/gralloc1.h>
#include <hardware/gralloc.h>
+#include <cinttypes>
#define GRALLOC1_FUNCTION_PERFORM 0x00001000
@@ -160,6 +161,14 @@
return 0;
}
+ static void Dump(const private_handle_t *hnd) {
+ ALOGD("handle id:%" PRIu64 " wxh:%dx%d uwxuh:%dx%d size: %d fd:%d fd_meta:%d flags:0x%x"
+ "prod_usage:0x%" PRIx64" cons_usage:0x%" PRIx64 "format:0x%x",
+ hnd->id, hnd->width, hnd->height, hnd->unaligned_width, hnd->unaligned_height, hnd->size,
+ hnd->fd, hnd->fd_metadata, hnd->flags, hnd->producer_usage, hnd->consumer_usage,
+ hnd->format);
+ }
+
int GetUnalignedWidth() const { return unaligned_width; }
int GetUnalignedHeight() const { return unaligned_height; }