surfaceflinger: always advertise HDR10 when wide color is available

For HWC that already adversises HDR10 support, this has no effect.
Otherwise, SurfaceFlinger will insert HDR10 into HdrCapabilities
when wide color is supported.

SurfaceFlinger simulates HDR10 support by switching the color mode
to DISPLAY_P3 and forcing client composition for HDR10 layers.  It
also has a special path to treat RGBA_1010102/BT2020_PQ as
Y410/BT2020_PQ in RenderEngine when the buffer is from media.

Test: manual
Change-Id: Ib5f18e0100f5610ee65218108bdb9843baccbe98
diff --git a/services/surfaceflinger/BufferLayerConsumer.cpp b/services/surfaceflinger/BufferLayerConsumer.cpp
index 8f5c9c7..4d9b43f 100644
--- a/services/surfaceflinger/BufferLayerConsumer.cpp
+++ b/services/surfaceflinger/BufferLayerConsumer.cpp
@@ -68,6 +68,7 @@
         mCurrentFrameNumber(0),
         mCurrentTransformToDisplayInverse(false),
         mCurrentSurfaceDamage(),
+        mCurrentApi(0),
         mDefaultWidth(1),
         mDefaultHeight(1),
         mFilteringEnabled(true),
@@ -346,6 +347,7 @@
     mCurrentFrameNumber = item.mFrameNumber;
     mCurrentTransformToDisplayInverse = item.mTransformToDisplayInverse;
     mCurrentSurfaceDamage = item.mSurfaceDamage;
+    mCurrentApi = item.mApi;
 
     computeCurrentTransformMatrixLocked();
 
@@ -469,6 +471,11 @@
     return mCurrentSurfaceDamage;
 }
 
+int BufferLayerConsumer::getCurrentApi() const {
+    Mutex::Autolock lock(mMutex);
+    return mCurrentApi;
+}
+
 sp<GraphicBuffer> BufferLayerConsumer::getCurrentBuffer(int* outSlot) const {
     Mutex::Autolock lock(mMutex);