Commit 2afda735 authored by Michel Dänzer's avatar Michel Dänzer Committed by Alex Deucher

drm/amdgpu/dc: Simplify drm_crtc_state::active checks

drm_atomic_crtc_check enforces that ::active can only be true if
::enable is as well.
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: default avatarMichel Dänzer <mdaenzer@redhat.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8fe384ff
...@@ -3430,21 +3430,12 @@ static bool modeset_required(struct drm_crtc_state *crtc_state, ...@@ -3430,21 +3430,12 @@ static bool modeset_required(struct drm_crtc_state *crtc_state,
struct dc_stream_state *new_stream, struct dc_stream_state *new_stream,
struct dc_stream_state *old_stream) struct dc_stream_state *old_stream)
{ {
if (!drm_atomic_crtc_needs_modeset(crtc_state)) return crtc_state->active && drm_atomic_crtc_needs_modeset(crtc_state);
return false;
if (!crtc_state->enable)
return false;
return crtc_state->active;
} }
static bool modereset_required(struct drm_crtc_state *crtc_state) static bool modereset_required(struct drm_crtc_state *crtc_state)
{ {
if (!drm_atomic_crtc_needs_modeset(crtc_state)) return !crtc_state->active && drm_atomic_crtc_needs_modeset(crtc_state);
return false;
return !crtc_state->enable || !crtc_state->active;
} }
static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder) static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder)
...@@ -8034,8 +8025,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm, ...@@ -8034,8 +8025,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
* We want to do dc stream updates that do not require a * We want to do dc stream updates that do not require a
* full modeset below. * full modeset below.
*/ */
if (!(enable && aconnector && new_crtc_state->enable && if (!(enable && aconnector && new_crtc_state->active))
new_crtc_state->active))
return 0; return 0;
/* /*
* Given above conditions, the dc state cannot be NULL because: * Given above conditions, the dc state cannot be NULL because:
......
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