diff options
author | Valerie Hau <vhau@google.com> | 2019-04-09 14:37:00 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-04-09 14:37:00 +0000 |
commit | abc5bd873e54d74d396dc280205d608f72b000dc (patch) | |
tree | 9613cd4a2d7d6593662774374e20af98f48c1d6e /sdm/libs/hwc2/hwc_display_primary.cpp | |
parent | 1c3903b59f159857f017866c0173e04dc238b149 (diff) | |
parent | f8c3fdc74c5b807bb0db6c0881d620c96d352e5f (diff) | |
download | display-abc5bd873e54d74d396dc280205d608f72b000dc.tar.gz |
Merge changes from topic "readbackfix-qcom" into qt-dev
* changes:
hwc2: Teardown CWB in Create Virtual Display
Revert "sdm: Fix Concurrent Writeback fence handling"
Diffstat (limited to 'sdm/libs/hwc2/hwc_display_primary.cpp')
-rw-r--r-- | sdm/libs/hwc2/hwc_display_primary.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sdm/libs/hwc2/hwc_display_primary.cpp b/sdm/libs/hwc2/hwc_display_primary.cpp index ac8d12a4..7b015636 100644 --- a/sdm/libs/hwc2/hwc_display_primary.cpp +++ b/sdm/libs/hwc2/hwc_display_primary.cpp @@ -509,6 +509,28 @@ HWC2::Error HWCDisplayPrimary::PostCommitLayerStack(int32_t *out_retire_fence) { return HWC2::Error::None; } +DisplayError HWCDisplayPrimary::TeardownConcurrentWriteback(void) { + DisplayError error = kErrorNotSupported; + + if (output_buffer_.release_fence_fd >= 0) { + int32_t release_fence_fd = dup(output_buffer_.release_fence_fd); + int ret = sync_wait(output_buffer_.release_fence_fd, 1000); + if (ret < 0) { + DLOGE("sync_wait error errno = %d, desc = %s", errno, strerror(errno)); + } + + ::close(release_fence_fd); + if (ret) + return kErrorResources; + } + + if (display_intf_) { + error = display_intf_->TeardownConcurrentWriteback(); + } + + return error; +} + int HWCDisplayPrimary::Perform(uint32_t operation, ...) { va_list args; va_start(args, operation); |