Commit b7ad57b5 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amdgpu: get display info from DC when DC enabled.

Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c802570e
...@@ -889,10 +889,6 @@ static int amdgpu_cgs_get_active_displays_info(struct cgs_device *cgs_device, ...@@ -889,10 +889,6 @@ static int amdgpu_cgs_get_active_displays_info(struct cgs_device *cgs_device,
struct cgs_display_info *info) struct cgs_display_info *info)
{ {
CGS_FUNC_ADEV; CGS_FUNC_ADEV;
struct amdgpu_crtc *amdgpu_crtc;
struct drm_device *ddev = adev->ddev;
struct drm_crtc *crtc;
uint32_t line_time_us, vblank_lines;
struct cgs_mode_info *mode_info; struct cgs_mode_info *mode_info;
if (info == NULL) if (info == NULL)
...@@ -906,30 +902,43 @@ static int amdgpu_cgs_get_active_displays_info(struct cgs_device *cgs_device, ...@@ -906,30 +902,43 @@ static int amdgpu_cgs_get_active_displays_info(struct cgs_device *cgs_device,
mode_info->ref_clock = adev->clock.spll.reference_freq; mode_info->ref_clock = adev->clock.spll.reference_freq;
} }
if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) { if (!amdgpu_device_has_dc_support(adev)) {
list_for_each_entry(crtc, struct amdgpu_crtc *amdgpu_crtc;
&ddev->mode_config.crtc_list, head) { struct drm_device *ddev = adev->ddev;
amdgpu_crtc = to_amdgpu_crtc(crtc); struct drm_crtc *crtc;
if (crtc->enabled) { uint32_t line_time_us, vblank_lines;
info->active_display_mask |= (1 << amdgpu_crtc->crtc_id);
info->display_count++; if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {
} list_for_each_entry(crtc,
if (mode_info != NULL && &ddev->mode_config.crtc_list, head) {
crtc->enabled && amdgpu_crtc->enabled && amdgpu_crtc = to_amdgpu_crtc(crtc);
amdgpu_crtc->hw_mode.clock) { if (crtc->enabled) {
line_time_us = (amdgpu_crtc->hw_mode.crtc_htotal * 1000) / info->active_display_mask |= (1 << amdgpu_crtc->crtc_id);
amdgpu_crtc->hw_mode.clock; info->display_count++;
vblank_lines = amdgpu_crtc->hw_mode.crtc_vblank_end - }
amdgpu_crtc->hw_mode.crtc_vdisplay + if (mode_info != NULL &&
(amdgpu_crtc->v_border * 2); crtc->enabled && amdgpu_crtc->enabled &&
mode_info->vblank_time_us = vblank_lines * line_time_us; amdgpu_crtc->hw_mode.clock) {
mode_info->refresh_rate = drm_mode_vrefresh(&amdgpu_crtc->hw_mode); line_time_us = (amdgpu_crtc->hw_mode.crtc_htotal * 1000) /
mode_info->ref_clock = adev->clock.spll.reference_freq; amdgpu_crtc->hw_mode.clock;
mode_info = NULL; vblank_lines = amdgpu_crtc->hw_mode.crtc_vblank_end -
amdgpu_crtc->hw_mode.crtc_vdisplay +
(amdgpu_crtc->v_border * 2);
mode_info->vblank_time_us = vblank_lines * line_time_us;
mode_info->refresh_rate = drm_mode_vrefresh(&amdgpu_crtc->hw_mode);
mode_info->ref_clock = adev->clock.spll.reference_freq;
mode_info = NULL;
}
} }
} }
} else {
info->display_count = adev->pm.pm_display_cfg.num_display;
if (mode_info != NULL) {
mode_info->vblank_time_us = adev->pm.pm_display_cfg.min_vblank_time;
mode_info->refresh_rate = adev->pm.pm_display_cfg.vrefresh;
mode_info->ref_clock = adev->clock.spll.reference_freq;
}
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment