Commit 111b0a72 authored by Roman Stratiienko's avatar Roman Stratiienko
Browse files

drm_hwcomposer: Be more careful with returning the release fences



Don't return release fence for layer in case buffer wasn't updated.
Signed-off-by: default avatarRoman Stratiienko <roman.o.stratiienko@globallogic.com>
parent a32f907c
Pipeline #591656 passed with stages
in 10 minutes and 45 seconds
......@@ -423,6 +423,7 @@ HWC2::Error HwcDisplay::GetReleaseFences(uint32_t *num_elements,
layers[num_layers - 1] = l.first;
fences[num_layers - 1] = UniqueFd::Dup(present_fence_.Get()).Release();
l.second.ClearPriorBufferScanOutFlag();
}
*num_elements = num_layers;
......@@ -713,15 +714,6 @@ HWC2::Error HwcDisplay::ValidateDisplay(uint32_t *num_types,
return HWC2::Error::None;
}
/* In current drm_hwc design in case previous frame layer was not validated as
* a CLIENT, it is used by display controller (Front buffer). We have to store
* this state to provide the CLIENT with the release fences for such buffers.
*/
for (auto &l : layers_) {
l.second.SetPriorBufferScanOutFlag(l.second.GetValidatedType() !=
HWC2::Composition::Client);
}
return backend_->ValidateDisplay(this, num_types, num_requests);
}
......
......@@ -54,6 +54,13 @@ HWC2::Error HwcLayer::SetLayerBlendMode(int32_t mode) {
HWC2::Error HwcLayer::SetLayerBuffer(buffer_handle_t buffer,
int32_t acquire_fence) {
acquire_fence_ = UniqueFd(acquire_fence);
/* In current drm_hwc design in case previous frame layer was not validated as
* a CLIENT, it is used by display controller (Front buffer). We have to store
* this state to provide the CLIENT with the release fences for such buffers.
*/
prior_buffer_scanout_flag_ = validated_type_ != HWC2::Composition::Client;
buffer_handle_ = buffer;
buffer_handle_updated_ = true;
......
......@@ -50,8 +50,8 @@ class HwcLayer {
return prior_buffer_scanout_flag_;
}
void SetPriorBufferScanOutFlag(bool state) {
prior_buffer_scanout_flag_ = state;
void ClearPriorBufferScanOutFlag() {
prior_buffer_scanout_flag_ = false;
}
uint32_t GetZOrder() const {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment