summaryrefslogtreecommitdiff
path: root/sdm/libs
diff options
context:
space:
mode:
Diffstat (limited to 'sdm/libs')
-rw-r--r--sdm/libs/core/drm/hw_peripheral_drm.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/sdm/libs/core/drm/hw_peripheral_drm.cpp b/sdm/libs/core/drm/hw_peripheral_drm.cpp
index 61e67c11..a7bb33d6 100644
--- a/sdm/libs/core/drm/hw_peripheral_drm.cpp
+++ b/sdm/libs/core/drm/hw_peripheral_drm.cpp
@@ -165,6 +165,13 @@ void HWPeripheralDRM::SetupConcurrentWriteback(const HWLayersInfo &hw_layer_info
if (enable) {
// Set DRM properties for Concurrent Writeback.
ConfigureConcurrentWriteback(hw_layer_info.stack);
+
+ if (!validate) {
+ // Set GET_RETIRE_FENCE property to get Concurrent Writeback fence.
+ int *fence = &hw_layer_info.stack->output_buffer->release_fence_fd;
+ drm_atomic_intf_->Perform(DRMOps::CONNECTOR_GET_RETIRE_FENCE,
+ cwb_config_.token.conn_id, fence);
+ }
} else {
// Tear down the Concurrent Writeback topology.
drm_atomic_intf_->Perform(DRMOps::CONNECTOR_SET_CRTC, cwb_config_.token.conn_id, 0);
@@ -239,11 +246,7 @@ void HWPeripheralDRM::ConfigureConcurrentWriteback(LayerStack *layer_stack) {
void HWPeripheralDRM::PostCommitConcurrentWriteback(LayerBuffer *output_buffer) {
bool enabled = hw_resource_.has_concurrent_writeback && output_buffer;
- if (enabled) {
- // Get Concurrent Writeback fence
- int *fence = &output_buffer->release_fence_fd;
- drm_atomic_intf_->Perform(DRMOps::CONNECTOR_GET_RETIRE_FENCE, cwb_config_.token.conn_id, fence);
- } else {
+ if (!enabled) {
drm_mgr_intf_->UnregisterDisplay(cwb_config_.token);
cwb_config_.enabled = false;
}