Skip to content

Commit 20fa2ff

Browse files
leo-sunli1alexdeucher
authored andcommitted
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: e277adc "drm/amd/display: Hookup color management functions" Bugzilla: https://bugs.freedesktop.org/106194 Signed-off-by: Leo (Sunpeng) Li <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Tested-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 72777fe commit 20fa2ff

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4695,15 +4695,16 @@ static int dm_update_crtcs_state(struct dc *dc,
46954695
* We want to do dc stream updates that do not require a
46964696
* full modeset below.
46974697
*/
4698-
if (!enable || !aconnector || modereset_required(new_crtc_state))
4698+
if (!(enable && aconnector && new_crtc_state->enable &&
4699+
new_crtc_state->active))
46994700
continue;
47004701
/*
47014702
* Given above conditions, the dc state cannot be NULL because:
4702-
* 1. We're attempting to enable a CRTC. Which has a...
4703-
* 2. Valid connector attached, and
4704-
* 3. User does not want to reset it (disable or mark inactive,
4705-
* which can happen on a CRTC that's already disabled).
4706-
* => It currently exists.
4703+
* 1. We're in the process of enabling CRTCs (just been added
4704+
* to the dc context, or already is on the context)
4705+
* 2. Has a valid connector attached, and
4706+
* 3. Is currently active and enabled.
4707+
* => The dc stream state currently exists.
47074708
*/
47084709
BUG_ON(dm_new_crtc_state->stream == NULL);
47094710

0 commit comments

Comments
 (0)