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
This commit is contained in:
Balamurugan Thanikachalam
2014-01-31 18:23:20 +05:30
committed by Radhika Ranjan Soni
parent a6fe50e686
commit f558c863d4

View File

@@ -1256,15 +1256,14 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
} }
} }
//Accumulate acquireFenceFds for MDP //Accumulate acquireFenceFds for MDP Overlays
if(list->outbufAcquireFenceFd >= 0) { if(list->outbufAcquireFenceFd >= 0) {
//Writeback output buffer //Writeback output buffer
acquireFd[count++] = list->outbufAcquireFenceFd; acquireFd[count++] = list->outbufAcquireFenceFd;
} }
for(uint32_t i = 0; i < list->numHwLayers; i++) { for(uint32_t i = 0; i < list->numHwLayers; i++) {
if((list->hwLayers[i].compositionType == HWC_OVERLAY || if(list->hwLayers[i].compositionType == HWC_OVERLAY &&
list->hwLayers[i].compositionType == HWC_BLIT) &&
list->hwLayers[i].acquireFenceFd >= 0) { list->hwLayers[i].acquireFenceFd >= 0) {
if(UNLIKELY(swapzero)) if(UNLIKELY(swapzero))
acquireFd[count++] = -1; acquireFd[count++] = -1;
@@ -1320,10 +1319,16 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
!(layerProp[i].mFlags & HWC_VPUCOMP)) { !(layerProp[i].mFlags & HWC_VPUCOMP)) {
//If rotator has not already populated this field //If rotator has not already populated this field
// & if it's a not VPU layer // & if it's a not VPU layer
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); list->hwLayers[i].releaseFenceFd = dup(releaseFd);
} }
} }
} }
}
if(fd >= 0) { if(fd >= 0) {
close(fd); close(fd);