hwc: hwc_sync - populate correct fences for BLIT
Previously, the acquire and release fences for BLIT
composition were populated using same logic as Overlay,
but BLIT composition consists of separate BLIT step
before screen refresh, and app buffers are no longer
required after BLIT. So holding the buffers for both
the steps is unnecessary and impacts performance.
This change adds condition for BLIT in fence population
logic in hwc_sync and populates the right fences for the
App Buffers and Display Refresh during BLIT composition.
Change-Id: I9998a7052c0375acb32a174bdf0469d2a88f79e8
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index f6476f5..2938ae1 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -1256,15 +1256,14 @@
}
}
- //Accumulate acquireFenceFds for MDP
+ //Accumulate acquireFenceFds for MDP Overlays
if(list->outbufAcquireFenceFd >= 0) {
//Writeback output buffer
acquireFd[count++] = list->outbufAcquireFenceFd;
}
for(uint32_t i = 0; i < list->numHwLayers; i++) {
- if((list->hwLayers[i].compositionType == HWC_OVERLAY ||
- list->hwLayers[i].compositionType == HWC_BLIT) &&
+ if(list->hwLayers[i].compositionType == HWC_OVERLAY &&
list->hwLayers[i].acquireFenceFd >= 0) {
if(UNLIKELY(swapzero))
acquireFd[count++] = -1;
@@ -1320,7 +1319,13 @@
!(layerProp[i].mFlags & HWC_VPUCOMP)) {
//If rotator has not already populated this field
// & if it's a not VPU layer
- list->hwLayers[i].releaseFenceFd = dup(releaseFd);
+ if(list->hwLayers[i].compositionType == HWC_BLIT) {
+ //For Blit, the app layers should be released when the Blit is
+ //complete. This fd was passed from copybit->draw
+ list->hwLayers[i].releaseFenceFd = dup(fd);
+ } else {
+ list->hwLayers[i].releaseFenceFd = dup(releaseFd);
+ }
}
}
}