diff options
author | qctecmdr <qctecmdr@localhost> | 2022-07-20 19:50:17 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2022-07-20 19:50:17 -0700 |
commit | 71cc1d71e1f43c37c81fb699cd87bfbe7cab8724 (patch) | |
tree | 083dc68105a7353f4c74d252eb17339a3c64c1f2 | |
parent | 6c49a67dced43c52d56ec53ca18087b9d54166cc (diff) | |
parent | 412c023c852469777cd9212c8f2b94345cc740b1 (diff) |
Merge "composer: do not skip present IPC call if prevalidate display fails"
-rw-r--r-- | composer/hwc_display.cpp | 2 | ||||
-rw-r--r-- | composer/hwc_display.h | 1 | ||||
-rw-r--r-- | composer/hwc_display_builtin.cpp | 5 | ||||
-rw-r--r-- | composer/hwc_display_pluggable.cpp | 5 | ||||
-rw-r--r-- | composer/hwc_display_virtual_dpu.cpp | 41 |
5 files changed, 54 insertions, 0 deletions
diff --git a/composer/hwc_display.cpp b/composer/hwc_display.cpp index e82767fa..f4c2c73a 100644 --- a/composer/hwc_display.cpp +++ b/composer/hwc_display.cpp @@ -1815,6 +1815,8 @@ HWC2::Error HWCDisplay::CommitOrPrepare(bool validate_only, shared_ptr<Fence> *o if (exit_validate) { validate_done_ = true; client_target_3_1_set_ = false; + *needs_commit = true; + bypass_drawcycle_ = true; return HWC2::Error::None; } diff --git a/composer/hwc_display.h b/composer/hwc_display.h index 64652c2e..0787bc7d 100644 --- a/composer/hwc_display.h +++ b/composer/hwc_display.h @@ -647,6 +647,7 @@ class HWCDisplay : public DisplayEventHandler { DisplayDrawMethod draw_method_ = kDrawDefault; uint32_t fb_width_ = 0; uint32_t fb_height_ = 0; + bool bypass_drawcycle_ = false; // CWB state & configuration CwbConfig cwb_config_ = {}; diff --git a/composer/hwc_display_builtin.cpp b/composer/hwc_display_builtin.cpp index d2aaa67e..fbff70bb 100644 --- a/composer/hwc_display_builtin.cpp +++ b/composer/hwc_display_builtin.cpp @@ -423,6 +423,11 @@ HWC2::Error HWCDisplayBuiltIn::Present(shared_ptr<Fence> *out_retire_fence) { DTRACE_SCOPED(); + if (bypass_drawcycle_) { + bypass_drawcycle_ = false; + return status; + } + // Proceed only if any resources are available to be allocated for the current display, // Otherwise keep doing invalidate if (CheckResourceState(&res_exhausted)) { diff --git a/composer/hwc_display_pluggable.cpp b/composer/hwc_display_pluggable.cpp index 25ad3d89..0a22d804 100644 --- a/composer/hwc_display_pluggable.cpp +++ b/composer/hwc_display_pluggable.cpp @@ -240,6 +240,11 @@ HWC2::Error HWCDisplayPluggable::Present(shared_ptr<Fence> *out_retire_fence) { auto status = HWC2::Error::None; bool res_exhausted = false; + if (bypass_drawcycle_) { + bypass_drawcycle_ = false; + return status; + } + if (!active_secure_sessions_[kSecureDisplay] && !display_paused_ && !(mmrm_restricted_ && (current_power_mode_ == HWC2::PowerMode::Off || current_power_mode_ == HWC2::PowerMode::DozeSuspend))) { diff --git a/composer/hwc_display_virtual_dpu.cpp b/composer/hwc_display_virtual_dpu.cpp index aa139216..133e3074 100644 --- a/composer/hwc_display_virtual_dpu.cpp +++ b/composer/hwc_display_virtual_dpu.cpp @@ -27,6 +27,42 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* +* Changes from Qualcomm Innovation Center are provided under the following license: +* +* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted (subject to the limitations in the +* disclaimer below) provided that the following conditions are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* +* * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE +* GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT +* HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + #include <hwc_display_virtual_dpu.h> #define __CLASS__ "HWCDisplayVirtualDPU" @@ -180,6 +216,11 @@ HWC2::Error HWCDisplayVirtualDPU::Validate(uint32_t *out_num_types, uint32_t *ou HWC2::Error HWCDisplayVirtualDPU::Present(shared_ptr<Fence> *out_retire_fence) { auto status = HWC2::Error::None; + if (bypass_drawcycle_) { + bypass_drawcycle_ = false; + return status; + } + if (!output_buffer_.buffer_id) { return HWC2::Error::NoResources; } |