Skip to content

Commit

Permalink
hwc2: Fix retire fences
Browse files Browse the repository at this point in the history
The HWC2 header does not require deferring the retire fence, also
known as the present fence. The retire fence is now known as the
present fence in the HWC2 header and it belongs to the
current frame that is submitted and is signalled when the current
frame is picked up. Also, the retire fence was incorrectly set to
the release fence of the output buffer. Use the retire fence
instead.

Bug: 30204952
Change-Id: Ide2fdcc27d0ed42119ccb1e37e16d43c32a39790
  • Loading branch information
naseer authored and spfetsch committed Jul 21, 2016
1 parent 1f76e6b commit c25b1e7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
10 changes: 3 additions & 7 deletions msm8996/sdm/libs/hwc2/hwc_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,25 +895,21 @@ HWC2::Error HWCDisplay::PostCommitLayerStack(int32_t *out_retire_fence) {
}
}

*out_retire_fence = stored_retire_fence_;
*out_retire_fence = -1;
if (!flush_) {
// if swapinterval property is set to 0 then close and reset the list retire fence
if (swap_interval_zero_) {
close(layer_stack_.retire_fence_fd);
layer_stack_.retire_fence_fd = -1;
}
stored_retire_fence_ = layer_stack_.retire_fence_fd;
if (id_ == HWC_DISPLAY_PRIMARY) {
*out_retire_fence = layer_stack_.retire_fence_fd;
}
*out_retire_fence = layer_stack_.retire_fence_fd;

if (dump_frame_count_) {
dump_frame_count_--;
dump_frame_index_++;
}
} else {
stored_retire_fence_ = -1;
}

geometry_changes_ = GeometryChanges::kNone;
flush_ = false;

Expand Down
1 change: 0 additions & 1 deletion msm8996/sdm/libs/hwc2/hwc_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ class HWCDisplay : public DisplayEventHandler {
bool validated_ = false;
bool color_tranform_failed_ = false;
HWCColorMode *color_mode_ = NULL;
int32_t stored_retire_fence_ = -1;

private:
void DumpInputBuffers(void);
Expand Down
7 changes: 0 additions & 7 deletions msm8996/sdm/libs/hwc2/hwc_display_virtual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,6 @@ HWC2::Error HWCDisplayVirtual::Present(int32_t *out_retire_fence) {
}

status = HWCDisplay::PostCommitLayerStack(out_retire_fence);
// On Virtual displays, use the output buffer release fence as the retire fence
// Close the layer stack retire fence as it is unused
if (layer_stack_.output_buffer) {
stored_retire_fence_ = layer_stack_.output_buffer->release_fence_fd;
close(layer_stack_.retire_fence_fd);
layer_stack_.retire_fence_fd = -1;
}
}
}
CloseAcquireFds();
Expand Down

0 comments on commit c25b1e7

Please sign in to comment.