Change-Id: I6459575717a03ae8522e4d083edf0aad49724092
mHwc->hwc_ctrl.max_num_ovly = mAllowedOverlays;
+ for (size_t i = 0; i < contents->numHwLayers; i++) {
+ hwc_layer_1_t &layer = contents->hwLayers[i];
+ /* If Fb is not needed and this is a HWC buffer (function reverse engineered from S7 libexynosdisplay.so) */
+ if(!mFbNeeded && layer.compositionType == HWC_FRAMEBUFFER_TARGET) {
+ /* Close the acquire fence Fd if it is valid */
+ if(layer.acquireFenceFd >= 0) {
+ close(layer.acquireFenceFd);
+ layer.acquireFenceFd = -1;
+ }
+ }
+ }
+
return err;
}