Commit 3b42a1c0 authored by Andrey Grodzovsky's avatar Andrey Grodzovsky Committed by Alex Deucher

drm/amd/display: Skip DC validation for flips and cursor.

Nothing to validate in DC in this case. Skip it.
Signed-off-by: default avatarAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: default avatarRoman Li <Roman.Li@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8a76708e
...@@ -1311,8 +1311,7 @@ int amdgpu_dm_connector_mode_valid( ...@@ -1311,8 +1311,7 @@ int amdgpu_dm_connector_mode_valid(
if (context) { if (context) {
result = MODE_OK; result = MODE_OK;
dc_resource_validate_ctx_destruct(context); dc_release_validate_context(context);
dm_free(context);
} }
dc_stream_release(stream); dc_stream_release(stream);
...@@ -2598,7 +2597,7 @@ void amdgpu_dm_atomic_commit_tail( ...@@ -2598,7 +2597,7 @@ void amdgpu_dm_atomic_commit_tail(
} }
} }
/* DC is optimized not to do anything if 'streams' didn't change. */ if (dm_state->context)
WARN_ON(!dc_commit_context(dm->dc, dm_state->context)); WARN_ON(!dc_commit_context(dm->dc, dm_state->context));
...@@ -2932,9 +2931,9 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -2932,9 +2931,9 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
/* /*
* This bool will be set for true for any modeset/reset * This bool will be set for true for any modeset/reset
* or surface update which implies non fast surfae update. * or surface update which implies non fast surface update.
*/ */
bool aquire_global_lock = false; bool lock_and_validation_needed = false;
ret = drm_atomic_helper_check(dev, state); ret = drm_atomic_helper_check(dev, state);
...@@ -3022,7 +3021,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -3022,7 +3021,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
new_acrtc_state->stream, new_acrtc_state->stream,
crtc); crtc);
aquire_global_lock = true; lock_and_validation_needed = true;
} else if (modereset_required(crtc_state)) { } else if (modereset_required(crtc_state)) {
...@@ -3036,7 +3035,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -3036,7 +3035,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
dc_stream_release(new_acrtc_state->stream); dc_stream_release(new_acrtc_state->stream);
new_acrtc_state->stream = NULL; new_acrtc_state->stream = NULL;
aquire_global_lock = true; lock_and_validation_needed = true;
} }
} }
...@@ -3074,7 +3073,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -3074,7 +3073,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
if (!is_scaling_state_different(con_new_state, con_old_state)) if (!is_scaling_state_different(con_new_state, con_old_state))
continue; continue;
aquire_global_lock = true; lock_and_validation_needed = true;
} }
for_each_crtc_in_state(state, crtc, crtc_state, i) { for_each_crtc_in_state(state, crtc, crtc_state, i) {
...@@ -3124,17 +3123,11 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -3124,17 +3123,11 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
new_acrtc_state->stream, new_acrtc_state->stream,
surface); surface);
aquire_global_lock = true; lock_and_validation_needed = true;
} }
} }
} }
dm_state->context = dc_get_validate_context(dc, set, set_count);
if (!dm_state->context) {
ret = -EINVAL;
goto fail_planes;
}
/* /*
* For full updates case when * For full updates case when
* removing/adding/updating streams on once CRTC while flipping * removing/adding/updating streams on once CRTC while flipping
...@@ -3144,10 +3137,18 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -3144,10 +3137,18 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
* will wait for completion of any outstanding flip using DRMs * will wait for completion of any outstanding flip using DRMs
* synchronization events. * synchronization events.
*/ */
if (aquire_global_lock) {
if (lock_and_validation_needed) {
ret = do_aquire_global_lock(dev, state); ret = do_aquire_global_lock(dev, state);
if (ret) if (ret)
goto fail_planes; goto fail_planes;
dm_state->context = dc_get_validate_context(dc, set, set_count);
if (!dm_state->context) {
ret = -EINVAL;
goto fail_planes;
}
} }
/* Must be success */ /* Must be success */
......
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