[Why] For OLED eDP the Display Manager uses max_cll value as a limit for brightness control. max_cll defines the content light luminance for individual pixel. Whereas max_fall defines frame-average level luminance. The user may not observe the difference in brightness in between max_fall and max_cll. That negatively impacts the user experience. [How] Use max_fall value instead of max_cll as a limit for brightness control.
Unified · Split
| @@ -2812,7 +2812,7 @@ static struct drm_mode_config_helper_funcs amdgpu_dm_mode_config_helperfuncs = { · 2811 unmodified lines | ||
| 2812 | 2812 | |
| 2813 | 2813 | static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector) |
| 2814 | 2814 | { |
| 2815 | − u32 max_cll, min_cll, max, min, q, r; | |
| 2815 | + u32 max_avg, min_cll, max, min, q, r; | |
| 2816 | 2816 | struct amdgpu_dm_backlight_caps *caps; |
| 2817 | 2817 | struct amdgpu_display_manager *dm; |
| 2818 | 2818 | struct drm_connector *conn_base; |
| @@ -2842,7 +2842,7 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector) · 23 unmodified lines | ||
| 2842 | 2842 | caps = &dm->backlight_caps[i]; |
| 2843 | 2843 | caps->ext_caps = &aconnector->dc_link->dpcd_sink_ext_caps; |
| 2844 | 2844 | caps->aux_support = false; |
| 2845 | − max_cll = conn_base->hdr_sink_metadata.hdmi_type1.max_cll; | |
| 2845 | + max_avg = conn_base->hdr_sink_metadata.hdmi_type1.max_fall; | |
| 2846 | 2846 | min_cll = conn_base->hdr_sink_metadata.hdmi_type1.min_cll; |
| 2847 | 2847 | |
| 2848 | 2848 | if (caps->ext_caps->bits.oled == 1 /*|| |
| @@ -2870,8 +2870,8 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector) · 21 unmodified lines | ||
| 2870 | 2870 | * The results of the above expressions can be verified at |
| 2871 | 2871 | * pre_computed_values. |
| 2872 | 2872 | */ |
| 2873 | − q = max_cll >> 5; | |
| 2874 | − r = max_cll % 32; | |
| 2873 | + q = max_avg >> 5; | |
| 2874 | + r = max_avg % 32; | |
| 2875 | 2875 | max = (1 << q) * pre_computed_values[r]; |
| 2876 | 2876 | |
| 2877 | 2877 | // min luminance: maxLum * (CV/255)^2 / 100 |