diff options
author | Leo (Sunpeng) Li <sunpeng.li@amd.com> | 2018-05-29 09:51:51 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-29 15:01:49 -0400 |
commit | 20d4ac659c76034586a3ab79489b0940631a65de (patch) | |
tree | 3c19374ef317b72bc01e15210408f0c24702c3d0 | |
parent | c733e40c74457ad6aa56cc8b3318e829b8274bef (diff) |
drm/amd/display: Fix BUG_ON during CRTC atomic check update
For cases where the CRTC is inactive (DPMS off), where a modeset is not
required, yet the CRTC is still in the atomic state, we should not
attempt to update anything on it.
Previously, we were relying on the modereset_required() helper to check
the above condition. However, the function returns false immediately if
a modeset is not required, ignoring the CRTC's enable/active state
flags. The correct way to filter is by looking at these flags instead.
Fixes: e277adc5a06c "drm/amd/display: Hookup color management functions"
Bugzilla: https://bugs.freedesktop.org/106194
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 |
1 files changed, 7 insertions, 6 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 d913c0a029f2..0a06941204d7 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |||
@@ -4765,15 +4765,16 @@ next_crtc: | |||
4765 | * We want to do dc stream updates that do not require a | 4765 | * We want to do dc stream updates that do not require a |
4766 | * full modeset below. | 4766 | * full modeset below. |
4767 | */ | 4767 | */ |
4768 | if (!enable || !aconnector || modereset_required(new_crtc_state)) | 4768 | if (!(enable && aconnector && new_crtc_state->enable && |
4769 | new_crtc_state->active)) | ||
4769 | continue; | 4770 | continue; |
4770 | /* | 4771 | /* |
4771 | * Given above conditions, the dc state cannot be NULL because: | 4772 | * Given above conditions, the dc state cannot be NULL because: |
4772 | * 1. We're attempting to enable a CRTC. Which has a... | 4773 | * 1. We're in the process of enabling CRTCs (just been added |
4773 | * 2. Valid connector attached, and | 4774 | * to the dc context, or already is on the context) |
4774 | * 3. User does not want to reset it (disable or mark inactive, | 4775 | * 2. Has a valid connector attached, and |
4775 | * which can happen on a CRTC that's already disabled). | 4776 | * 3. Is currently active and enabled. |
4776 | * => It currently exists. | 4777 | * => The dc stream state currently exists. |
4777 | */ | 4778 | */ |
4778 | BUG_ON(dm_new_crtc_state->stream == NULL); | 4779 | BUG_ON(dm_new_crtc_state->stream == NULL); |
4779 | 4780 | ||