summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-12-02 23:07:33 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-12-02 23:07:33 +0000
commit616dd0bf5250251ca47d7a703a2005f955d3d7c5 (patch)
treeb896339db6eee3aff1e4f03280ad0eb02dfffee8
parenta710e2143a7bf837bb935e84ee3c1d4e81c3cf81 (diff)
parentf475c154f487ec03c3516dd58488f28d37ab3a5f (diff)
downloadandroid_hardware_qcom_sdm710_display-616dd0bf5250251ca47d7a703a2005f955d3d7c5.tar.gz
android_hardware_qcom_sdm710_display-616dd0bf5250251ca47d7a703a2005f955d3d7c5.tar.bz2
android_hardware_qcom_sdm710_display-616dd0bf5250251ca47d7a703a2005f955d3d7c5.zip
Snap for 5158751 from f475c154f487ec03c3516dd58488f28d37ab3a5f to pi-b4s4-release
Change-Id: Id2fe3ec4f6d6cdee2f4aa1ecfdfe92abb73a0825
-rw-r--r--gralloc/gr_buf_mgr.cpp1
-rw-r--r--sdm/libs/core/drm/hw_peripheral_drm.cpp13
-rw-r--r--sdm/libs/hwc2/hwc_display.cpp2
-rw-r--r--sdm/libs/hwc2/hwc_display_primary.cpp2
4 files changed, 11 insertions, 7 deletions
diff --git a/gralloc/gr_buf_mgr.cpp b/gralloc/gr_buf_mgr.cpp
index c8309525..985dd3ef 100644
--- a/gralloc/gr_buf_mgr.cpp
+++ b/gralloc/gr_buf_mgr.cpp
@@ -376,6 +376,7 @@ Error BufferManager::AllocateBuffer(const BufferDescriptor &descriptor, buffer_h
}
Error BufferManager::Dump(std::ostringstream *os) {
+ std::lock_guard<std::mutex> buffer_lock(buffer_lock_);
for (auto it : handles_map_) {
auto buf = it.second;
auto hnd = buf->handle;
diff --git a/sdm/libs/core/drm/hw_peripheral_drm.cpp b/sdm/libs/core/drm/hw_peripheral_drm.cpp
index 03403e5a..e4da1081 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.cpp b/sdm/libs/hwc2/hwc_display.cpp
index f06de99f..867d805f 100644
--- a/sdm/libs/hwc2/hwc_display.cpp
+++ b/sdm/libs/hwc2/hwc_display.cpp
@@ -377,7 +377,7 @@ int HWCDisplay::Init() {
DisplayConfigFixedInfo fixed_info = {};
display_intf_->GetConfig(&fixed_info);
- partial_update_enabled_ = fixed_info.partial_update;
+ partial_update_enabled_ = fixed_info.partial_update || (!fixed_info.is_cmdmode);
client_target_->SetPartialUpdate(partial_update_enabled_);
DLOGI("Display created with id: %d", id_);
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;
}