OSDN Git Service

drm_hwcomposer: Run test commit only when it actually needed
authorMatvii Zorin <matvii.zorin@globallogic.com>
Mon, 6 Apr 2020 16:03:03 +0000 (19:03 +0300)
committerMatvii Zorin <matvii.zorin@globallogic.com>
Wed, 1 Jul 2020 10:18:42 +0000 (13:18 +0300)
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>
drmhwctwo.cpp

index 46071b9..8743b14 100644 (file)
@@ -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();