drm_hwcomposer: Add Importer to CreateComposition()
The Compositor will be responsible for releasing buffers that
are successfully added to a composition using AddLayer. To achieve
this, the Importer of the buffers must be provided to Compositor/Composition.
Change-Id: I1f0acd70c245b7a2b6c93649f247e30e7f2e9dc4
Signed-off-by: Sean Paul <seanpaul@chromium.org>
diff --git a/compositor.h b/compositor.h
index b162f4a..b4956b6 100644
--- a/compositor.h
+++ b/compositor.h
@@ -17,6 +17,8 @@
#ifndef DRM_HWCOMPOSER_COMPOSITOR_H_
#define DRM_HWCOMPOSER_COMPOSITOR_H_
+#include "importer.h"
+
struct hwc_layer_1;
struct hwc_drm_bo;
@@ -57,7 +59,11 @@
// Adds the given layer, whose handle has been imported into the given buffer
// object, to the given display of the composition. The layer may be modified
- // to include a releaseFenceFd. Returns 0 on success.
+ // to include a releaseFenceFd.
+ //
+ // Upon success, the compositor takes ownership of bo and is responsible
+ // for calling importer->ReleaseBuffer(bo), where importer is the importer
+ // provided on CreateComposition(). Returns 0 on success.
virtual int AddLayer(int display, hwc_layer_1 *layer, hwc_drm_bo *bo) = 0;
// Gets the number of successful AddLayer calls that can be made on the
@@ -80,7 +86,7 @@
virtual Targeting *targeting() = 0;
// Starts a fresh composition.
- virtual Composition *CreateComposition() = 0;
+ virtual Composition *CreateComposition(Importer *importer) = 0;
// On success returns a syncpoint fd that will be signaled when composition is
// complete or -1 if compositing was completed by this method's return. On