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/DisplayDevice.h b/services/surfaceflinger/DisplayDevice.h
index 499bf8e..a470670 100644
--- a/services/surfaceflinger/DisplayDevice.h
+++ b/services/surfaceflinger/DisplayDevice.h
@@ -78,7 +78,7 @@
const wp<IBinder>& displayToken,
const sp<DisplaySurface>& displaySurface,
const sp<IGraphicBufferProducer>& producer,
- bool supportWideColor);
+ bool supportWideColor, bool supportHdr);
// clang-format on
~DisplayDevice();
@@ -128,6 +128,7 @@
status_t beginFrame(bool mustRecompose) const;
status_t prepareFrame(HWComposer& hwc);
bool getWideColorSupport() const { return mDisplayHasWideColor; }
+ bool getHdrSupport() const { return mDisplayHasHdr; }
void swapBuffers(HWComposer& hwc) const;
@@ -235,6 +236,7 @@
// Initialized by SurfaceFlinger when the DisplayDevice is created.
// Fed to RenderEngine during composition.
bool mDisplayHasWideColor;
+ bool mDisplayHasHdr;
};
struct DisplayDeviceState {