@@ -3398,8 +3398,10 @@ static int dm_resume(struct amdgpu_ip_block *ip_block)
3398
3398
link_enc_cfg_copy (adev -> dm .dc -> current_state , dc_state );
3399
3399
3400
3400
r = dm_dmub_hw_init (adev );
3401
- if (r )
3401
+ if (r ) {
3402
3402
drm_err (adev_to_drm (adev ), "DMUB interface failed to initialize: status=%d\n" , r );
3403
+ return r ;
3404
+ }
3403
3405
3404
3406
dc_dmub_srv_set_power_state (dm -> dc -> ctx -> dmub_srv , DC_ACPI_CM_POWER_STATE_D0 );
3405
3407
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)
4983
4985
caps = & dm -> backlight_caps [aconnector -> bl_idx ];
4984
4986
if (get_brightness_range (caps , & min , & max )) {
4985
4987
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 );
4987
4989
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 );
4989
4991
/* min is zero, so max needs to be adjusted */
4990
4992
props .max_brightness = max - min ;
4991
4993
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)
5410
5412
5411
5413
static void amdgpu_dm_destroy_drm_device (struct amdgpu_display_manager * dm )
5412
5414
{
5413
- drm_atomic_private_obj_fini (& dm -> atomic_obj );
5415
+ if (dm -> atomic_obj .state )
5416
+ drm_atomic_private_obj_fini (& dm -> atomic_obj );
5414
5417
}
5415
5418
5416
5419
/******************************************************************************
0 commit comments