Commit 68ca1c3e authored by Shirish S's avatar Shirish S Committed by Alex Deucher

drm/amd/display: log amdgpu_dm_atomic_check() failure cause

update developers with next level of info about unsupported
display configuration query that led to atomic check failure.
Signed-off-by: default avatarShirish S <shirish.s@amd.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d493a024
...@@ -10757,8 +10757,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -10757,8 +10757,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
trace_amdgpu_dm_atomic_check_begin(state); trace_amdgpu_dm_atomic_check_begin(state);
ret = drm_atomic_helper_check_modeset(dev, state); ret = drm_atomic_helper_check_modeset(dev, state);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("drm_atomic_helper_check_modeset() failed\n");
goto fail; goto fail;
}
/* Check connector changes */ /* Check connector changes */
for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) { for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) {
...@@ -10774,6 +10776,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -10774,6 +10776,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
new_crtc_state = drm_atomic_get_crtc_state(state, new_con_state->crtc); new_crtc_state = drm_atomic_get_crtc_state(state, new_con_state->crtc);
if (IS_ERR(new_crtc_state)) { if (IS_ERR(new_crtc_state)) {
DRM_DEBUG_DRIVER("drm_atomic_get_crtc_state() failed\n");
ret = PTR_ERR(new_crtc_state); ret = PTR_ERR(new_crtc_state);
goto fail; goto fail;
} }
...@@ -10788,8 +10791,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -10788,8 +10791,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
if (drm_atomic_crtc_needs_modeset(new_crtc_state)) { if (drm_atomic_crtc_needs_modeset(new_crtc_state)) {
ret = add_affected_mst_dsc_crtcs(state, crtc); ret = add_affected_mst_dsc_crtcs(state, crtc);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("add_affected_mst_dsc_crtcs() failed\n");
goto fail; goto fail;
}
} }
} }
} }
...@@ -10804,19 +10809,25 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -10804,19 +10809,25 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
continue; continue;
ret = amdgpu_dm_verify_lut_sizes(new_crtc_state); ret = amdgpu_dm_verify_lut_sizes(new_crtc_state);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("amdgpu_dm_verify_lut_sizes() failed\n");
goto fail; goto fail;
}
if (!new_crtc_state->enable) if (!new_crtc_state->enable)
continue; continue;
ret = drm_atomic_add_affected_connectors(state, crtc); ret = drm_atomic_add_affected_connectors(state, crtc);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("drm_atomic_add_affected_connectors() failed\n");
goto fail; goto fail;
}
ret = drm_atomic_add_affected_planes(state, crtc); ret = drm_atomic_add_affected_planes(state, crtc);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("drm_atomic_add_affected_planes() failed\n");
goto fail; goto fail;
}
if (dm_old_crtc_state->dsc_force_changed) if (dm_old_crtc_state->dsc_force_changed)
new_crtc_state->mode_changed = true; new_crtc_state->mode_changed = true;
...@@ -10853,6 +10864,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -10853,6 +10864,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
if (IS_ERR(new_plane_state)) { if (IS_ERR(new_plane_state)) {
ret = PTR_ERR(new_plane_state); ret = PTR_ERR(new_plane_state);
DRM_DEBUG_DRIVER("new_plane_state is BAD\n");
goto fail; goto fail;
} }
} }
...@@ -10865,8 +10877,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -10865,8 +10877,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
new_plane_state, new_plane_state,
false, false,
&lock_and_validation_needed); &lock_and_validation_needed);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("dm_update_plane_state() failed\n");
goto fail; goto fail;
}
} }
/* Disable all crtcs which require disable */ /* Disable all crtcs which require disable */
...@@ -10876,8 +10890,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -10876,8 +10890,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
new_crtc_state, new_crtc_state,
false, false,
&lock_and_validation_needed); &lock_and_validation_needed);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("DISABLE: dm_update_crtc_state() failed\n");
goto fail; goto fail;
}
} }
/* Enable all crtcs which require enable */ /* Enable all crtcs which require enable */
...@@ -10887,8 +10903,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -10887,8 +10903,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
new_crtc_state, new_crtc_state,
true, true,
&lock_and_validation_needed); &lock_and_validation_needed);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("ENABLE: dm_update_crtc_state() failed\n");
goto fail; goto fail;
}
} }
/* Add new/modified planes */ /* Add new/modified planes */
...@@ -10898,20 +10916,26 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -10898,20 +10916,26 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
new_plane_state, new_plane_state,
true, true,
&lock_and_validation_needed); &lock_and_validation_needed);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("dm_update_plane_state() failed\n");
goto fail; goto fail;
}
} }
/* Run this here since we want to validate the streams we created */ /* Run this here since we want to validate the streams we created */
ret = drm_atomic_helper_check_planes(dev, state); ret = drm_atomic_helper_check_planes(dev, state);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("drm_atomic_helper_check_planes() failed\n");
goto fail; goto fail;
}
/* Check cursor planes scaling */ /* Check cursor planes scaling */
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
ret = dm_check_crtc_cursor(state, crtc, new_crtc_state); ret = dm_check_crtc_cursor(state, crtc, new_crtc_state);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("dm_check_crtc_cursor() failed\n");
goto fail; goto fail;
}
} }
if (state->legacy_cursor_update) { if (state->legacy_cursor_update) {
...@@ -10998,20 +11022,28 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -10998,20 +11022,28 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
*/ */
if (lock_and_validation_needed) { if (lock_and_validation_needed) {
ret = dm_atomic_get_state(state, &dm_state); ret = dm_atomic_get_state(state, &dm_state);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("dm_atomic_get_state() failed\n");
goto fail; goto fail;
}
ret = do_aquire_global_lock(dev, state); ret = do_aquire_global_lock(dev, state);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("do_aquire_global_lock() failed\n");
goto fail; goto fail;
}
#if defined(CONFIG_DRM_AMD_DC_DCN) #if defined(CONFIG_DRM_AMD_DC_DCN)
if (!compute_mst_dsc_configs_for_state(state, dm_state->context, vars)) if (!compute_mst_dsc_configs_for_state(state, dm_state->context, vars)) {
DRM_DEBUG_DRIVER("compute_mst_dsc_configs_for_state() failed\n");
goto fail; goto fail;
}
ret = dm_update_mst_vcpi_slots_for_dsc(state, dm_state->context, vars); ret = dm_update_mst_vcpi_slots_for_dsc(state, dm_state->context, vars);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("dm_update_mst_vcpi_slots_for_dsc() failed\n");
goto fail; goto fail;
}
#endif #endif
/* /*
...@@ -11021,12 +11053,13 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -11021,12 +11053,13 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
* to get stuck in an infinite loop and hang eventually. * to get stuck in an infinite loop and hang eventually.
*/ */
ret = drm_dp_mst_atomic_check(state); ret = drm_dp_mst_atomic_check(state);
if (ret) if (ret) {
DRM_DEBUG_DRIVER("drm_dp_mst_atomic_check() failed\n");
goto fail; goto fail;
}
status = dc_validate_global_state(dc, dm_state->context, false); status = dc_validate_global_state(dc, dm_state->context, false);
if (status != DC_OK) { if (status != DC_OK) {
drm_dbg_atomic(dev, DRM_DEBUG_DRIVER("DC global validation failure: %s (%d)",
"DC global validation failure: %s (%d)",
dc_status_to_str(status), status); dc_status_to_str(status), status);
ret = -EINVAL; ret = -EINVAL;
goto fail; goto fail;
......
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