drm_hwcomposer: Reference count NvImporter buffers
Instead of directly freeing buffers from the NvImporter
release callback, use reference counting to ensure that
we:
(a) don't free the buffer while NvGralloc is still using it
(b) don't free the buffer while HWC is still using it
Before this patch, we weren't satisifying (b). This would
cause us to free a buffer before and while it was on the
screen.
Change-Id: I6bbc541c72df4d5f12a8734de2f2e68168b73a07
Signed-off-by: Sean Paul <seanpaul@chromium.org>
diff --git a/drm_hwcomposer.h b/drm_hwcomposer.h
index c82506c..cebdbee 100644
--- a/drm_hwcomposer.h
+++ b/drm_hwcomposer.h
@@ -60,6 +60,7 @@
uint32_t gem_handles[4];
uint32_t fb_id;
int acquire_fence_fd;
+ void *priv;
} hwc_drm_bo_t;
int hwc_import_init(struct hwc_import_context **ctx);