diff options
Diffstat (limited to 'sdm')
-rw-r--r-- | sdm/libs/core/drm/hw_peripheral_drm.cpp | 13 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_display_primary.cpp | 2 |
2 files changed, 9 insertions, 6 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; } diff --git a/sdm/libs/hwc2/hwc_display_primary.cpp b/sdm/libs/hwc2/hwc_display_primary.cpp index 1a6944b2..f5970cd8 100644 --- a/sdm/libs/hwc2/hwc_display_primary.cpp +++ b/sdm/libs/hwc2/hwc_display_primary.cpp @@ -256,6 +256,7 @@ HWC2::Error HWCDisplayPrimary::Validate(uint32_t *out_num_types, uint32_t *out_n // here in a subsequent draw round. Readback is not allowed for any secure use case. readback_configured_ = !layer_stack_.flags.secure_present; if (readback_configured_) { + DisablePartialUpdateOneFrame(); layer_stack_.output_buffer = &output_buffer_; layer_stack_.flags.post_processed_output = post_processed_output_; } @@ -422,7 +423,6 @@ HWC2::Error HWCDisplayPrimary::SetReadbackBuffer(const native_handle_t *buffer, readback_configured_ = false; validated_ = false; - DisablePartialUpdateOneFrame(); return HWC2::Error::None; } |