From ba7f96ca7b0767e5e05a711a1588c6e1ca693d7e Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mar 19 2024 10:37:19 +0000 Subject: drm/amd/display: fix ABM disablement (git-fixes). --- diff --git a/patches.suse/drm-amd-display-fix-ABM-disablement.patch b/patches.suse/drm-amd-display-fix-ABM-disablement.patch new file mode 100644 index 0000000..2f93a54 --- /dev/null +++ b/patches.suse/drm-amd-display-fix-ABM-disablement.patch @@ -0,0 +1,62 @@ +From b9f46f0b98784e40288ee393f863f553fde062fa Mon Sep 17 00:00:00 2001 +From: Hamza Mahfooz +Date: Wed, 22 Nov 2023 14:50:34 -0500 +Subject: [PATCH] drm/amd/display: fix ABM disablement +Git-commit: b9f46f0b98784e40288ee393f863f553fde062fa +Patch-mainline: v6.7-rc4 +References: git-fixes + +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 +Signed-off-by: Hamza Mahfooz +Signed-off-by: Alex Deucher +Acked-by: Takashi Iwai + +--- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +index ee97814ebd99..b452796fc6d3 100644 +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +@@ -6267,7 +6267,7 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector, + dm_new_state->underscan_enable = val; + ret = 0; + } else if (property == adev->mode_info.abm_level_property) { +- dm_new_state->abm_level = val; ++ dm_new_state->abm_level = val ?: ABM_LEVEL_IMMEDIATE_DISABLE; + ret = 0; + } + +@@ -6312,7 +6312,8 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector, + *val = dm_state->underscan_enable; + ret = 0; + } else if (property == adev->mode_info.abm_level_property) { +- *val = dm_state->abm_level; ++ *val = (dm_state->abm_level != ABM_LEVEL_IMMEDIATE_DISABLE) ? ++ dm_state->abm_level : 0; + ret = 0; + } + +@@ -6385,7 +6386,8 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector) + state->pbn = 0; + + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) +- state->abm_level = amdgpu_dm_abm_level; ++ state->abm_level = amdgpu_dm_abm_level ?: ++ ABM_LEVEL_IMMEDIATE_DISABLE; + + __drm_atomic_helper_connector_reset(connector, &state->base); + } +-- +2.43.0 + diff --git a/series.conf b/series.conf index ff638b3..d020deb 100644 --- a/series.conf +++ b/series.conf @@ -44788,6 +44788,7 @@ patches.suse/drm-amd-display-Remove-min_dst_y_next_start-check-fo.patch patches.suse/drm-amd-display-Update-min-Z8-residency-time-to-2100.patch patches.suse/drm-amdgpu-correct-the-amdgpu-runtime-dereference-us.patch + patches.suse/drm-amd-display-fix-ABM-disablement.patch patches.suse/drm-amd-display-update-dcn315-lpddr-pstate-latency.patch patches.suse/drm-amdgpu-Fix-cat-debugfs-amdgpu_regs_didt-causes-k.patch patches.suse/drm-amdgpu-Update-EEPROM-I2C-address-for-smu-v13_0_0.patch