OSDN Git Service

drm/amd/display: Don't set mode_changed=false if the stream was removed
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tue, 11 Jun 2019 16:54:05 +0000 (11:54 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Jun 2019 16:54:53 +0000 (11:54 -0500)
commit7e93094945016492f6cb3660b2960d4b027eab51
tree3af9ce6802f02a9a371923e58607deceb3ff5f63
parent55c2e5a1600cfa9bb7afb445318d6ba1730251a5
drm/amd/display: Don't set mode_changed=false if the stream was removed

[Why]
When switching from vt to desktop with EDID emulation we can receive
an atomic commit such that we have a crtc where mode_changed = true.

During the dm_update_crtc_state disable pass we remove the stream from
the context and free it on the dm_new_crtc_state.

During the enable pass we compare the new provisional stream to the
dm_old_crtc_state->stream and determine that the stream is unchanged
and no scaling has been changed.

Following this, new_crtc_state->mode_changed is then set to false.
The connectors haven't changed and the CRTC active state hasn't changed
so drm_atomic_crtc_needs_modeset returns false, so we jump to
skip_modeset and we hit:

BUG_ON(dm_new_crtc_state->stream == NULL);

...since the old stream is gone from the context and the new stream is
also still NULL.

[How]
Ensure that we still a stream to reuse before checking if we can reuse
the old stream without a full modeset.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c