Even if the layer buffers are not used at the moment (because we
always fallback to client composition), the acquire fences still
need to be closed to avoid leaking file descriptors.
During client composition, SurfaceFlinger will wait for the
layer buffers if necessary.
}
Error DrmComposerHal::setLayerBuffer(Display /*displayId*/, Layer /*layer*/,
- buffer_handle_t /*buffer*/, int32_t /*acquireFence*/) {
+ buffer_handle_t /*buffer*/, int32_t acquireFence) {
+
+ if (acquireFence >= 0) {
+ /*
+ * This buffer will be only used by client composition.
+ * During client composition, SurfaceFlinger will wait for the buffer
+ * (if necessary), so there is no need to do it here.
+ */
+ close(acquireFence);
+ }
+
return Error::NONE; // Ignored
}