@@ -3398,8 +3398,10 @@ static int dm_resume(struct amdgpu_ip_block *ip_block)
33983398 link_enc_cfg_copy (adev -> dm .dc -> current_state , dc_state );
33993399
34003400 r = dm_dmub_hw_init (adev );
3401- if (r )
3401+ if (r ) {
34023402 drm_err (adev_to_drm (adev ), "DMUB interface failed to initialize: status=%d\n" , r );
3403+ return r ;
3404+ }
34033405
34043406 dc_dmub_srv_set_power_state (dm -> dc -> ctx -> dmub_srv , DC_ACPI_CM_POWER_STATE_D0 );
34053407 dc_set_power_state (dm -> dc , DC_ACPI_CM_POWER_STATE_D0 );
@@ -4983,9 +4985,9 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector)
49834985 caps = & dm -> backlight_caps [aconnector -> bl_idx ];
49844986 if (get_brightness_range (caps , & min , & max )) {
49854987 if (power_supply_is_system_supplied () > 0 )
4986- props .brightness = ( max - min ) * DIV_ROUND_CLOSEST ( caps -> ac_level , 100 );
4988+ props .brightness = DIV_ROUND_CLOSEST (( max - min ) * caps -> ac_level , 100 );
49874989 else
4988- props .brightness = ( max - min ) * DIV_ROUND_CLOSEST ( caps -> dc_level , 100 );
4990+ props .brightness = DIV_ROUND_CLOSEST (( max - min ) * caps -> dc_level , 100 );
49894991 /* min is zero, so max needs to be adjusted */
49904992 props .max_brightness = max - min ;
49914993 drm_dbg (drm , "Backlight caps: min: %d, max: %d, ac %d, dc %d\n" , min , max ,
@@ -5410,7 +5412,8 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
54105412
54115413static void amdgpu_dm_destroy_drm_device (struct amdgpu_display_manager * dm )
54125414{
5413- drm_atomic_private_obj_fini (& dm -> atomic_obj );
5415+ if (dm -> atomic_obj .state )
5416+ drm_atomic_private_obj_fini (& dm -> atomic_obj );
54145417}
54155418
54165419/******************************************************************************
0 commit comments