Set blockingRegion for DISPLAY_DECORATION layers

Devices that have support for DISPLAY_DECORATION layers may also have
support for a blockingRegion, which will allow the DPU to skip regions
that are known to be transparent, in order to save power.

Use the transparentRegionHint to compute the blockingRegion. It may not
be accurate for all layers, which is why it is only used for
DISPLAY_DECORATION layers.

Add tests.

Bug: 212736475
Test: libcompositionengine_test
Change-Id: I6c5d29614dc8d65d8481150ce717a440192083a0
diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
index 95cc5a8..4ccf11f 100644
--- a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
@@ -484,6 +484,14 @@
         visibleRegion.dump(LOG_TAG);
     }
 
+    if (auto error =
+                hwcLayer->setBlockingRegion(outputDependentState.outputSpaceBlockingRegionHint);
+        error != hal::Error::NONE) {
+        ALOGE("[%s] Failed to set blocking region: %s (%d)", getLayerFE().getDebugName(),
+              to_string(error).c_str(), static_cast<int32_t>(error));
+        outputDependentState.outputSpaceBlockingRegionHint.dump(LOG_TAG);
+    }
+
     const auto dataspace = outputDependentState.overrideInfo.buffer
             ? outputDependentState.overrideInfo.dataspace
             : outputDependentState.dataspace;