diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 22 | 
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c index e997ebbe43ea..77ad59ade85c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c @@ -115,6 +115,26 @@ void amdgpu_dpm_print_ps_status(struct amdgpu_device *adev,  	pr_cont("\n");  } +void amdgpu_dpm_get_active_displays(struct amdgpu_device *adev) +{ +	struct drm_device *ddev = adev->ddev; +	struct drm_crtc *crtc; +	struct amdgpu_crtc *amdgpu_crtc; + +	adev->pm.dpm.new_active_crtcs = 0; +	adev->pm.dpm.new_active_crtc_count = 0; +	if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) { +		list_for_each_entry(crtc, +				    &ddev->mode_config.crtc_list, head) { +			amdgpu_crtc = to_amdgpu_crtc(crtc); +			if (amdgpu_crtc->enabled) { +				adev->pm.dpm.new_active_crtcs |= (1 << amdgpu_crtc->crtc_id); +				adev->pm.dpm.new_active_crtc_count++; +			} +		} +	} +} +  u32 amdgpu_dpm_get_vblank_time(struct amdgpu_device *adev)  { @@ -432,7 +452,7 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)  			ATOM_PPLIB_PhaseSheddingLimits_Record *entry;  			adev->pm.dpm.dyn_state.phase_shedding_limits_table.entries = -				kzalloc(psl->ucNumEntries * +				kcalloc(psl->ucNumEntries,  					sizeof(struct amdgpu_phase_shedding_limits_entry),  					GFP_KERNEL);  			if (!adev->pm.dpm.dyn_state.phase_shedding_limits_table.entries) {  |