drm_hwcomposer: duplicate buffer_handles before hwc_set returns
This is needed because SF will sometimes release buffer_handles before GL gets
to using them for composition.
Change-Id: I01db0975cc82d6b59bf4f9521a24071baf89c38a
diff --git a/drmdisplaycomposition.h b/drmdisplaycomposition.h
index 7202c7c..76da993 100644
--- a/drmdisplaycomposition.h
+++ b/drmdisplaycomposition.h
@@ -23,6 +23,7 @@
#include <vector>
+#include <hardware/gralloc.h>
#include <hardware/hardware.h>
#include <hardware/hwcomposer.h>
@@ -42,6 +43,7 @@
hwc_drm_bo_t bo;
DrmCrtc *crtc;
DrmPlane *plane;
+ native_handle_t *handle;
} DrmCompositionLayer_t;
typedef std::vector<DrmCompositionLayer_t> DrmCompositionLayerVector_t;
@@ -62,6 +64,7 @@
int AddPlaneDisable(DrmPlane *plane);
int AddDpmsMode(uint32_t dpms_mode);
+ void RemoveNoPlaneLayers();
int FinishComposition();
DrmCompositionLayerVector_t *GetCompositionLayers();
@@ -76,6 +79,7 @@
DrmResources *drm_;
Importer *importer_;
+ const gralloc_module_t *gralloc_;
DrmCompositionType type_;