hwc2: Cache display type at construction
The display type is constant for the life of the display. Query it
upfront to avoid the binder transaction later.
V2: fixup HWC1 path
Test: boot to launcher on bullhead; build on fugu for HWC1 path
Bug: b/36597125
Change-Id: I2a4c3d9ff449960957376afef78f424261fcc282
diff --git a/services/surfaceflinger/DisplayHardware/HWC2.h b/services/surfaceflinger/DisplayHardware/HWC2.h
index 4419dc1..69d4afc 100644
--- a/services/surfaceflinger/DisplayHardware/HWC2.h
+++ b/services/surfaceflinger/DisplayHardware/HWC2.h
@@ -376,6 +376,7 @@
hwc2_display_t mId;
bool mIsConnected;
bool mIsVirtual;
+ DisplayType mType;
std::unordered_map<hwc2_layer_t, std::weak_ptr<Layer>> mLayers;
std::unordered_map<hwc2_config_t, std::shared_ptr<const Config>> mConfigs;
};