diff options
author | Matvii Zorin <matvii.zorin@globallogic.com> | 2020-04-06 19:03:03 +0300 |
---|---|---|
committer | Matvii Zorin <matvii.zorin@globallogic.com> | 2020-07-01 13:18:42 +0300 |
commit | fdcdeabd7e50f2ff005333b135c1d0b440296a85 (patch) | |
tree | 19b23ca4ccd04b69ae72483f5caa0af6601d5900 | |
parent | 3f17bc0953a6efae769c26ba116a7e936303315c (diff) |
drm_hwcomposer: Run test commit only when it actually needed
Composition testing is expensive. We do not need to spend CPU time when:
* All layers are marked as a client.
The patch skips CommitFrame function called by the ValidateDisplay
method in this case.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
-rw-r--r-- | drmhwctwo.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp index 46071b9..8743b14 100644 --- a/drmhwctwo.cpp +++ b/drmhwctwo.cpp @@ -963,7 +963,9 @@ HWC2::Error DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types, MarkValidated(z_map, client_start, client_size); - if (CreateComposition(true) != HWC2::Error::None) { + bool testing_needed = !(client_start == 0 && client_size == z_map.size()); + + if (testing_needed && CreateComposition(true) != HWC2::Error::None) { ++total_stats_.failed_kms_validate_; gpu_pixops = total_pixops; client_size = z_map.size(); |