sdm: Fix avg luminance value for built-in displays
Primary panel don't have average luminance value. Hence, display
driver don't populate the same. Average luminance is initialized
to default value of zero in HAL. Add average luminance calculation
for primary display. This aligns with the external displays.
CRs-fixed: 2716028
Change-Id: I962adef4c8298e7247cc320cc5813f1060dad4c1
diff --git a/sdm/libs/core/drm/hw_device_drm.cpp b/sdm/libs/core/drm/hw_device_drm.cpp
index 007cb2a..da5c271 100644
--- a/sdm/libs/core/drm/hw_device_drm.cpp
+++ b/sdm/libs/core/drm/hw_device_drm.cpp
@@ -706,6 +706,9 @@
// Convert the luminance values to cd/m^2 units.
hw_panel_info_.peak_luminance = FLOAT(connector_info_.panel_hdr_prop.peak_brightness) / 10000.0f;
hw_panel_info_.blackness_level = FLOAT(connector_info_.panel_hdr_prop.blackness_level) / 10000.0f;
+ hw_panel_info_.average_luminance = FLOAT(connector_info_.panel_hdr_prop.peak_brightness +
+ connector_info_.panel_hdr_prop.blackness_level) /
+ (2 * 10000.0f);
hw_panel_info_.primaries.white_point[0] = connector_info_.panel_hdr_prop.display_primaries[0];
hw_panel_info_.primaries.white_point[1] = connector_info_.panel_hdr_prop.display_primaries[1];
hw_panel_info_.primaries.red[0] = connector_info_.panel_hdr_prop.display_primaries[2];