@@ -1752,6 +1752,30 @@ static struct dml2_soc_bb *dm_dmub_get_vbios_bounding_box(struct amdgpu_device *
17521752 return bb ;
17531753}
17541754
1755+ static enum dmub_ips_disable_type dm_get_default_ips_mode (
1756+ struct amdgpu_device * adev )
1757+ {
1758+ /*
1759+ * On DCN35 systems with Z8 enabled, it's possible for IPS2 + Z8 to
1760+ * cause a hard hang. A fix exists for newer PMFW.
1761+ *
1762+ * As a workaround, for non-fixed PMFW, force IPS1+RCG as the deepest
1763+ * IPS state in all cases, except for s0ix and all displays off (DPMS),
1764+ * where IPS2 is allowed.
1765+ *
1766+ * When checking pmfw version, use the major and minor only.
1767+ */
1768+ if (amdgpu_ip_version (adev , DCE_HWIP , 0 ) == IP_VERSION (3 , 5 , 0 ) &&
1769+ (adev -> pm .fw_version & 0x00FFFF00 ) < 0x005D6300 )
1770+ return DMUB_IPS_RCG_IN_ACTIVE_IPS2_IN_OFF ;
1771+
1772+ if (amdgpu_ip_version (adev , DCE_HWIP , 0 ) >= IP_VERSION (3 , 5 , 0 ))
1773+ return DMUB_IPS_ENABLE ;
1774+
1775+ /* ASICs older than DCN35 do not have IPSs */
1776+ return DMUB_IPS_DISABLE_ALL ;
1777+ }
1778+
17551779static int amdgpu_dm_init (struct amdgpu_device * adev )
17561780{
17571781 struct dc_init_data init_data ;
@@ -1863,7 +1887,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
18631887 if (amdgpu_dc_debug_mask & DC_DISABLE_IPS )
18641888 init_data .flags .disable_ips = DMUB_IPS_DISABLE_ALL ;
18651889 else
1866- init_data .flags .disable_ips = DMUB_IPS_ENABLE ;
1890+ init_data .flags .disable_ips = dm_get_default_ips_mode ( adev ) ;
18671891
18681892 init_data .flags .disable_ips_in_vpb = 0 ;
18691893
@@ -4492,7 +4516,7 @@ static void amdgpu_dm_backlight_set_level(struct amdgpu_display_manager *dm,
44924516 struct amdgpu_dm_backlight_caps caps ;
44934517 struct dc_link * link ;
44944518 u32 brightness ;
4495- bool rc ;
4519+ bool rc , reallow_idle = false ;
44964520
44974521 amdgpu_dm_update_backlight_caps (dm , bl_idx );
44984522 caps = dm -> backlight_caps [bl_idx ];
@@ -4505,6 +4529,12 @@ static void amdgpu_dm_backlight_set_level(struct amdgpu_display_manager *dm,
45054529 link = (struct dc_link * )dm -> backlight_link [bl_idx ];
45064530
45074531 /* Change brightness based on AUX property */
4532+ mutex_lock (& dm -> dc_lock );
4533+ if (dm -> dc -> caps .ips_support && dm -> dc -> ctx -> dmub_srv -> idle_allowed ) {
4534+ dc_allow_idle_optimizations (dm -> dc , false);
4535+ reallow_idle = true;
4536+ }
4537+
45084538 if (caps .aux_support ) {
45094539 rc = dc_link_set_backlight_level_nits (link , true, brightness ,
45104540 AUX_BL_DEFAULT_TRANSITION_TIME_MS );
@@ -4516,6 +4546,11 @@ static void amdgpu_dm_backlight_set_level(struct amdgpu_display_manager *dm,
45164546 DRM_DEBUG ("DM: Failed to update backlight on eDP[%d]\n" , bl_idx );
45174547 }
45184548
4549+ if (dm -> dc -> caps .ips_support && reallow_idle )
4550+ dc_allow_idle_optimizations (dm -> dc , true);
4551+
4552+ mutex_unlock (& dm -> dc_lock );
4553+
45194554 if (rc )
45204555 dm -> actual_brightness [bl_idx ] = user_brightness ;
45214556}
0 commit comments