diff options
author | Long Ling <longling@google.com> | 2021-12-20 17:34:17 -0800 |
---|---|---|
committer | Long Ling <longling@google.com> | 2022-02-09 20:26:11 -0800 |
commit | 7c42d81f1756ac0aef51d70e37f55bdb9eea7d21 (patch) | |
tree | 46444c74491704ef9eb5ba6f052a0fe369e40ea7 /include | |
parent | 0b21789279bc1d261e12523d42f0d59f6d3754b1 (diff) |
libhwc2.1: set correct client target property
Get preferred property of blending stage from displaycolor.
Pass HDR layer state to displaycolor.
Bug: 200310159
Change-Id: I44fb1ce891aa39a04ed6d1bc8921a21299574958
Diffstat (limited to 'include')
-rw-r--r-- | include/displaycolor/displaycolor.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/include/displaycolor/displaycolor.h b/include/displaycolor/displaycolor.h index b82ff43..74bebcf 100644 --- a/include/displaycolor/displaycolor.h +++ b/include/displaycolor/displaycolor.h @@ -28,11 +28,13 @@ namespace hwc { using android::hardware::graphics::common::V1_1::RenderIntent; using android::hardware::graphics::common::V1_2::ColorMode; using android::hardware::graphics::common::V1_2::Dataspace; +using android::hardware::graphics::common::V1_2::PixelFormat; } // namespace hwc /** * hwc/displaycolor interface history * + * 4.0.0.2021-12-20 Get pixel format and dataspace of blending stage. * 3.0.0.2021-11-18 calibration info intf * 2.0.0.2021-08-27 pass brightness table for hdr10+ * 1.0.0.2021-08-25 Initial release @@ -55,7 +57,7 @@ constexpr struct DisplayColorIntfVer { } } kInterfaceVersion { - 3, + 4, 0, 0, }; @@ -82,6 +84,15 @@ enum BrightnessMode { BM_MAX = 2, }; +enum class HdrLayerState { + /// No HDR layer on screen + kHdrNone, + /// One or more small HDR layer(s), < 50% display size, take it as portrait mode. + kHdrSmall, + /// At least one large HDR layer, >= 50% display size, take it as full screen mode. + kHdrLarge, +}; + struct DisplayBrightnessTable { float nbm_nits_min; float nbm_nits_max; @@ -228,7 +239,7 @@ struct DisplayScene { lhbm_on == rhs.lhbm_on && (lhbm_on && dbv == rhs.dbv) && refresh_rate == rhs.refresh_rate && - hdr_full_screen == rhs.hdr_full_screen; + hdr_layer_state == rhs.hdr_layer_state; } /// A vector of layer color data. @@ -264,8 +275,8 @@ struct DisplayScene { /// refresh rate float refresh_rate; - /// hdr full screen mode - bool hdr_full_screen; + /// hdr layer state on screen + HdrLayerState hdr_layer_state; }; struct CalibrationInfo { @@ -351,6 +362,17 @@ class IDisplayColorGeneric { */ virtual const ColorModesMap &ColorModesAndRenderIntents( DisplayType display) const = 0; + + /** + * @brief Get pixel format and dataspace of blending stage. + * @param display to read the properties. + * @param pixel_format Pixel format of blending stage + * @param dataspace Dataspace of blending stage + * @return OK if successful, error otherwise. + */ + virtual int GetBlendingProperty(DisplayType display, + hwc::PixelFormat &pixel_format, + hwc::Dataspace &dataspace) const = 0; }; extern "C" { |