drm_hwcomposer: get gralloc buffer usage during hwc_set
This is needed during the layer composition planning phase to determine if a
layer is protected and therefore needs to be in its own overlay.
BUG=chrome-os-partner:43674
Change-Id: I33510a5a56b57aaaf55732149ae3e3d2f92ada79
diff --git a/hwcomposer.cpp b/hwcomposer.cpp
index 7b64bf2..de5c66f 100644
--- a/hwcomposer.cpp
+++ b/hwcomposer.cpp
@@ -318,6 +318,18 @@
if (ret)
return ret;
+ ret = gralloc->perform(gralloc, GRALLOC_MODULE_PERFORM_GET_USAGE,
+ handle.get(), &gralloc_buffer_usage);
+ if (ret) {
+ // TODO(zachr): Once GRALLOC_MODULE_PERFORM_GET_USAGE is implemented, remove
+ // "ret = 0" and enable the error logging code.
+ ret = 0;
+#if 0
+ ALOGE("Failed to get usage for buffer %p (%d)", handle.get(), ret);
+ return ret;
+#endif
+ }
+
return 0;
}