3131#include < common/FlagManager.h>
3232#include < scheduler/Fps.h>
3333
34- #include " DisplayHardware/ Hal.h"
34+ #include " Hal.h"
3535
3636namespace android {
3737
38+ using aidl::android::hardware::graphics::composer3::OutputType;
3839namespace hal = android::hardware::graphics::composer::hal;
3940
4041class DisplayMode ;
@@ -114,6 +115,11 @@ class DisplayMode {
114115 return *this ;
115116 }
116117
118+ Builder& setHdrOutputType (OutputType type) {
119+ mDisplayMode ->mHdrOutputType = type;
120+ return *this ;
121+ }
122+
117123 private:
118124 float getDefaultDensity () {
119125 // Default density is based on TVs: 1080p displays get XHIGH density, lower-
@@ -166,6 +172,8 @@ class DisplayMode {
166172 // without visual interruptions such as a black screen.
167173 int32_t getGroup () const { return mGroup ; }
168174
175+ OutputType getHdrOutputType () const { return mHdrOutputType ; }
176+
169177private:
170178 explicit DisplayMode (hal::HWConfigId id) : mHwcId(id) {}
171179
@@ -179,21 +187,25 @@ class DisplayMode {
179187 Dpi mDpi ;
180188 int32_t mGroup = -1 ;
181189 std::optional<hal::VrrConfig> mVrrConfig ;
190+ OutputType mHdrOutputType ;
182191};
183192
184193inline bool equalsExceptDisplayModeId (const DisplayMode& lhs, const DisplayMode& rhs) {
185194 return lhs.getHwcId () == rhs.getHwcId () && lhs.getResolution () == rhs.getResolution () &&
186195 lhs.getVsyncRate ().getPeriodNsecs () == rhs.getVsyncRate ().getPeriodNsecs () &&
187- lhs.getDpi () == rhs.getDpi () && lhs.getGroup () == rhs.getGroup ();
196+ lhs.getDpi () == rhs.getDpi () && lhs.getGroup () == rhs.getGroup () &&
197+ lhs.getVrrConfig () == rhs.getVrrConfig () &&
198+ lhs.getHdrOutputType () == rhs.getHdrOutputType ();
188199}
189200
190201inline std::string to_string (const DisplayMode& mode) {
191202 return base::StringPrintf (" {id=%d, hwcId=%d, resolution=%dx%d, vsyncRate=%s, "
192- " dpi=%.2fx%.2f, group=%d, vrrConfig=%s}" ,
203+ " dpi=%.2fx%.2f, group=%d, vrrConfig=%s, supportedHdrTypes=%s }" ,
193204 ftl::to_underlying (mode.getId ()), mode.getHwcId (), mode.getWidth (),
194205 mode.getHeight (), to_string (mode.getVsyncRate ()).c_str (),
195206 mode.getDpi ().x , mode.getDpi ().y , mode.getGroup (),
196- to_string (mode.getVrrConfig ()).c_str ());
207+ to_string (mode.getVrrConfig ()).c_str (),
208+ toString (mode.getHdrOutputType ()).c_str ());
197209}
198210
199211template <typename ... DisplayModePtrs>
0 commit comments