[SurfaceFlinger] Add getCompositionPreference APIs to SurfaceComposer.

Previously we added APIs in ConfigStore to return the composition data space
and pixel format that SurfaceFlinger would prefer for the device. This patch we
plumb such information up to SurfaceComposer to prepare HWUI to use it to
render.

BUG: 113530681
Test: Build, flash, boot and verified the output in adb logcat.
Change-Id: Ic96156e103af9f12febc98081179c2dc035a5139
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index b20fe44..72ede93 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -296,6 +296,12 @@
 
     static bool useContextPriority;
 
+    // The data space and pixel format that SurfaceFlinger expects hardware composer
+    // to composite efficiently. Meaning under most scenarios, hardware composer
+    // will accept layers with the data space and pixel format.
+    static ui::Dataspace compositionDataSpace;
+    static ui::PixelFormat compositionPixelFormat;
+
     static char const* getServiceName() ANDROID_API {
         return "SurfaceFlinger";
     }
@@ -454,6 +460,8 @@
     virtual status_t enableVSyncInjections(bool enable);
     virtual status_t injectVSync(nsecs_t when);
     virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const;
+    status_t getCompositionPreference(ui::Dataspace* outDataSpace,
+                                      ui::PixelFormat* outPixelFormat) const override;
 
 
     /* ------------------------------------------------------------------------