diff options
author | Wiwit Rifa'i <wiwitrifai@google.com> | 2022-08-16 21:53:05 +0800 |
---|---|---|
committer | Yichi Chen <yichichen@google.com> | 2022-08-23 19:53:46 +0000 |
commit | faac12043d4077ba5f87fb82c154f45414adad31 (patch) | |
tree | 10d3b636cc885ad72349992d2e85b8abe6ade87c /hwc3/ComposerCommandEngine.cpp | |
parent | bb8cb0403680b7635a6eb280af3a1ffd4200ee6b (diff) |
hwc3: move mustValidateDisplay() to executePresentOrValidateDisplay()
mustValidateDisplay() should only be checked in
executePresentOrValidateDisplay(), not in executePresentDisplay(). This
is according to the behaviour in HWC 2.x. Otherwise, validateDisplay()
could be called without calling presentDisplay() afterward.
Bug: 241060812
Test: open/close apps
Change-Id: I4a210b95bee76384a1fce8b8fec2d02c8c1311d2
Diffstat (limited to 'hwc3/ComposerCommandEngine.cpp')
-rw-r--r-- | hwc3/ComposerCommandEngine.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hwc3/ComposerCommandEngine.cpp b/hwc3/ComposerCommandEngine.cpp index ff66f9d..4b3a1a3 100644 --- a/hwc3/ComposerCommandEngine.cpp +++ b/hwc3/ComposerCommandEngine.cpp @@ -236,7 +236,8 @@ void ComposerCommandEngine::executePresentOrValidateDisplay( int err; // First try to Present as is. if (mHal->hasCapability(Capability::SKIP_VALIDATE)) { - err = executePresentDisplay(display); + err = mResources->mustValidateDisplay(display) ? IComposerClient::EX_NOT_VALIDATED + : executePresentDisplay(display); if (!err) { mWriter->setPresentOrValidateResult(display, PresentOrValidate::Result::Presented); return; @@ -262,9 +263,7 @@ int ComposerCommandEngine::executePresentDisplay(int64_t display) { ndk::ScopedFileDescriptor presentFence; std::vector<int64_t> layers; std::vector<ndk::ScopedFileDescriptor> fences; - auto err = mResources->mustValidateDisplay(display) - ? IComposerClient::EX_NOT_VALIDATED - : mHal->presentDisplay(display, presentFence, &layers, &fences); + auto err = mHal->presentDisplay(display, presentFence, &layers, &fences); if (!err) { mWriter->setPresentFence(display, std::move(presentFence)); mWriter->setReleaseFences(display, layers, std::move(fences)); |