Skip to content

Commit 7cfc388

Browse files
effective-lightgregkh
authored andcommitted
drm/amd/display: fix ABM disablement
commit b9f46f0 upstream. On recent versions of DMUB firmware, if we want to completely disable ABM we have to pass ABM_LEVEL_IMMEDIATE_DISABLE as the requested ABM level to DMUB. Otherwise, LCD eDP displays are unable to reach their maximum brightness levels. So, to fix this whenever the user requests an ABM level of 0 pass ABM_LEVEL_IMMEDIATE_DISABLE to DMUB instead. Also, to keep the user's experience consistent map ABM_LEVEL_IMMEDIATE_DISABLE to 0 when a user tries to read the requested ABM level. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 859a3a9 commit 7cfc388

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6149,7 +6149,7 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector,
61496149
dm_new_state->underscan_enable = val;
61506150
ret = 0;
61516151
} else if (property == adev->mode_info.abm_level_property) {
6152-
dm_new_state->abm_level = val;
6152+
dm_new_state->abm_level = val ?: ABM_LEVEL_IMMEDIATE_DISABLE;
61536153
ret = 0;
61546154
}
61556155

@@ -6194,7 +6194,8 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector,
61946194
*val = dm_state->underscan_enable;
61956195
ret = 0;
61966196
} else if (property == adev->mode_info.abm_level_property) {
6197-
*val = dm_state->abm_level;
6197+
*val = (dm_state->abm_level != ABM_LEVEL_IMMEDIATE_DISABLE) ?
6198+
dm_state->abm_level : 0;
61986199
ret = 0;
61996200
}
62006201

@@ -6274,7 +6275,8 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)
62746275
state->pbn = 0;
62756276

62766277
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP)
6277-
state->abm_level = amdgpu_dm_abm_level;
6278+
state->abm_level = amdgpu_dm_abm_level ?:
6279+
ABM_LEVEL_IMMEDIATE_DISABLE;
62786280

62796281
__drm_atomic_helper_connector_reset(connector, &state->base);
62806282
}

0 commit comments

Comments
 (0)