diff options
-rw-r--r-- | sdm/libs/core/drm/hw_peripheral_drm.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sdm/libs/core/drm/hw_peripheral_drm.cpp b/sdm/libs/core/drm/hw_peripheral_drm.cpp index 71437d48..0e0aa9b0 100644 --- a/sdm/libs/core/drm/hw_peripheral_drm.cpp +++ b/sdm/libs/core/drm/hw_peripheral_drm.cpp @@ -165,13 +165,6 @@ 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); @@ -246,7 +239,11 @@ void HWPeripheralDRM::ConfigureConcurrentWriteback(LayerStack *layer_stack) { void HWPeripheralDRM::PostCommitConcurrentWriteback(LayerBuffer *output_buffer) { bool enabled = hw_resource_.has_concurrent_writeback && output_buffer; - if (!enabled) { + 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 { drm_mgr_intf_->UnregisterDisplay(cwb_config_.token); cwb_config_.enabled = false; } |