diff options
author | Wayne Lin <Wayne.Lin@amd.com> | 2021-04-27 12:00:40 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-05-19 22:39:16 -0400 |
commit | d98af2725d42e85efb04a6939939eab31f562e45 (patch) | |
tree | 019902fd35aa29da326baca50b2b3a562d95b0e3 /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |
parent | f1900a9b0f6436153e6b1be398d31f1ead6096f6 (diff) | |
download | lwn-d98af2725d42e85efb04a6939939eab31f562e45.tar.gz lwn-d98af2725d42e85efb04a6939939eab31f562e45.zip |
drm/amd/display: Refactor suspend/resume of Secure display
[Why]
Once set ROI and do suspend/resume, current flow will not enable
OTG_CRC_CTL again due to we'll defer crc configuration when stream
is enabled.
[How]
Remove current suspend/resume function and have logic implemented into
amdgpu_dm_atomic_commit_tail()
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Chao-kai Wang <Stylon.Wang@amd.com>
Acked-by: Stylon Wang <stylon.wang@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 5df187a6e25f..676f41349e01 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1987,9 +1987,6 @@ static int dm_suspend(void *handle) return ret; } -#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY - amdgpu_dm_crtc_secure_display_suspend(adev); -#endif WARN_ON(adev->dm.cached_state); adev->dm.cached_state = drm_atomic_helper_suspend(adev_to_drm(adev)); @@ -2314,10 +2311,6 @@ static int dm_resume(void *handle) dm->cached_state = NULL; -#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY - amdgpu_dm_crtc_secure_display_resume(adev); -#endif - amdgpu_dm_irq_resume_late(adev); amdgpu_dm_smu_write_watermarks_table(adev); @@ -9004,6 +8997,12 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) #ifdef CONFIG_DEBUG_FS bool configure_crc = false; enum amdgpu_dm_pipe_crc_source cur_crc_src; +#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) + struct crc_rd_work *crc_rd_wrk = dm->crc_rd_wrk; +#endif + spin_lock_irqsave(&adev_to_drm(adev)->event_lock, flags); + cur_crc_src = acrtc->dm_irq_params.crc_src; + spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); #endif dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); @@ -9020,15 +9019,19 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) * settings for the stream. */ dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); - spin_lock_irqsave(&adev_to_drm(adev)->event_lock, flags); - cur_crc_src = acrtc->dm_irq_params.crc_src; - spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); if (amdgpu_dm_is_valid_crc_source(cur_crc_src)) { configure_crc = true; #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) - if (amdgpu_dm_crc_window_is_activated(crtc)) - configure_crc = false; + if (amdgpu_dm_crc_window_is_activated(crtc)) { + spin_lock_irqsave(&adev_to_drm(adev)->event_lock, flags); + acrtc->dm_irq_params.crc_window.update_win = true; + acrtc->dm_irq_params.crc_window.skip_frame_cnt = 2; + spin_lock_irq(&crc_rd_wrk->crc_rd_work_lock); + crc_rd_wrk->crtc = crtc; + spin_unlock_irq(&crc_rd_wrk->crc_rd_work_lock); + spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); + } #endif } |