SF: Store DeviceProductInfo in DisplayDevice
When a new display is connected we query the display
identification data, parse the EDID and store it in
DisplayDevice for future use. This saves an unnecessary IPC
to HWC when SurfaceFlinger::getDisplayInfo() is called.
Bug: 149075047
Test: 1. flash a device
2. boot a device connected to a display
3. Check for sensible DeviceProductInfo:
adb shell dumpsys SurfaceFlinger | grep deviceProductInfo
adb shell dumpsys display | grep deviceProductInfo
4. reboot without a display
5. Check that DeviceProductInfo is empty / null in
adb shell dumpsys SurfaceFlinger | grep deviceProductInfo
adb shell dumpsys display | grep deviceProductInfo
Change-Id: I35b6b3869eb740dd90913c9d3095fdc591b5ba3c
diff --git a/services/surfaceflinger/DisplayDevice.h b/services/surfaceflinger/DisplayDevice.h
index 8c86153..5a5bbe6 100644
--- a/services/surfaceflinger/DisplayDevice.h
+++ b/services/surfaceflinger/DisplayDevice.h
@@ -132,6 +132,11 @@
void setDisplayName(const std::string& displayName);
const std::string& getDisplayName() const { return mDisplayName; }
+ void setDeviceProductInfo(std::optional<DeviceProductInfo> info);
+ const std::optional<DeviceProductInfo>& getDeviceProductInfo() const {
+ return mDeviceProductInfo;
+ }
+
/* ------------------------------------------------------------------------
* Display power mode management.
*/
@@ -178,6 +183,8 @@
// TODO(b/74619554): Remove special cases for primary display.
const bool mIsPrimary;
+
+ std::optional<DeviceProductInfo> mDeviceProductInfo;
};
struct DisplayDeviceState {