[SurfaceFlinger] Implement per layer color transformation.

Previously we introduced a new composer HAL API to set color transform for per
layer and added the plumbing in SurfaceFlinger. This patch implements the
functionality and alwasy mark those layers to fall back to GPU composition
until composer 2.3 is implemented.

BUG: 111562338
Test: Build, boot, flash, tested by setting a greyscale matrix on Settings
Test: adb shell /data/nativetest/SurfaceFlinger_test/SurfaceFlinger_test
Change-Id: If8d5ed52bf920d8cc962602196fb1b0b6e2955da
diff --git a/libs/gui/include/gui/LayerState.h b/libs/gui/include/gui/LayerState.h
index 9a9f633..e06e2b1 100644
--- a/libs/gui/include/gui/LayerState.h
+++ b/libs/gui/include/gui/LayerState.h
@@ -23,6 +23,7 @@
 #include <utils/Errors.h>
 
 #include <gui/IGraphicBufferProducer.h>
+#include <math/mat4.h>
 #include <math/vec3.h>
 #include <ui/GraphicTypes.h>
 #include <ui/Rect.h>
@@ -72,6 +73,7 @@
         eSurfaceDamageRegionChanged = 0x02000000,
         eApiChanged = 0x04000000,
         eSidebandStreamChanged = 0x08000000,
+        eColorTransformChanged = 0x10000000,
     };
 
     layer_state_t()
@@ -94,7 +96,8 @@
             crop(Rect::INVALID_RECT),
             dataspace(ui::Dataspace::UNKNOWN),
             surfaceDamageRegion(),
-            api(-1) {
+            api(-1),
+            colorTransform(mat4()) {
         matrix.dsdx = matrix.dtdy = 1.0f;
         matrix.dsdy = matrix.dtdx = 0.0f;
         hdrMetadata.validTypes = 0;
@@ -150,6 +153,7 @@
     Region surfaceDamageRegion;
     int32_t api;
     sp<NativeHandle> sidebandStream;
+    mat4 colorTransform;
 };
 
 struct ComposerState {