From ef264828fe1c3801ade282221cd270d293cffbde Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Wed, 13 Jul 2016 14:51:09 -0700 Subject: [PATCH] HWC2: Redefine retire fence as present fence Redefines the retire fence returned by presentDisplay to be a present fence with more strictly defined semantics: this fence should fire at the vsync when the frame is picked up by hardware, either for scanout (in the case of video-mode panels) or for transfer to panel memory (in the case of command-mode panels). Bug: 29771461 Change-Id: Idf5f86c92a8748426cf3368242c08876a48d81dd --- include/hardware/hwcomposer2.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/include/hardware/hwcomposer2.h b/include/hardware/hwcomposer2.h index a51efd7..f6a6eba 100644 --- a/include/hardware/hwcomposer2.h +++ b/include/hardware/hwcomposer2.h @@ -1328,7 +1328,7 @@ typedef int32_t /*hwc2_error_t*/ (*HWC2_PFN_GET_RELEASE_FENCES)( hwc2_device_t* device, hwc2_display_t display, uint32_t* outNumElements, hwc2_layer_t* outLayers, int32_t* outFences); -/* presentDisplay(..., outRetireFence) +/* presentDisplay(..., outPresentFence) * Descriptor: HWC2_FUNCTION_PRESENT_DISPLAY * Must be provided by all HWC2 devices * @@ -1342,15 +1342,16 @@ typedef int32_t /*hwc2_error_t*/ (*HWC2_PFN_GET_RELEASE_FENCES)( * setLayerBuffer), then it is safe to call this function without first * validating the display. * - * If this call succeeds, outRetireFence will be populated with a file - * descriptor referring to a retire sync fence object. For physical displays, - * this fence will be signaled when the result of composition of the prior frame - * is no longer necessary (because it has been copied or replaced by this - * frame). For virtual displays, this fence will be signaled when writes to the - * output buffer have completed and it is safe to read from it. + * If this call succeeds, outPresentFence will be populated with a file + * descriptor referring to a present sync fence object. For physical displays, + * this fence will be signaled at the vsync when the result of composition of + * this frame starts to appear (for video-mode panels) or starts to transfer to + * panel memory (for command-mode panels). For virtual displays, this fence will + * be signaled when writes to the output buffer have completed and it is safe to + * read from it. * * Parameters: - * outRetireFence - a sync fence file descriptor as described above; pointer + * outPresentFence - a sync fence file descriptor as described above; pointer * will be non-NULL * * Returns HWC2_ERROR_NONE or one of the following errors: @@ -1361,7 +1362,8 @@ typedef int32_t /*hwc2_error_t*/ (*HWC2_PFN_GET_RELEASE_FENCES)( * for this display */ typedef int32_t /*hwc2_error_t*/ (*HWC2_PFN_PRESENT_DISPLAY)( - hwc2_device_t* device, hwc2_display_t display, int32_t* outRetireFence); + hwc2_device_t* device, hwc2_display_t display, + int32_t* outPresentFence); /* setActiveConfig(..., config) * Descriptor: HWC2_FUNCTION_SET_ACTIVE_CONFIG -- 2.11.0