Commit 2833920d authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Dump failed crtc states during atomic check

Currently we're only dumping the failed crtc state if
intel_modeset_pipe_config() fails. Let's do the state
dump if anything else fails afterwards. The downside
is that we lose the immediate knowledge which crtc caused
the failure (unless a lower level function indicates it
with an additional debug print) but having the full state
dumped seems like something that could be beneficial.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190517193132.8140-12-ville.syrjala@linux.intel.comReviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
parent 64f6dbab
...@@ -13369,7 +13369,7 @@ static int intel_atomic_check(struct drm_device *dev, ...@@ -13369,7 +13369,7 @@ static int intel_atomic_check(struct drm_device *dev,
ret = drm_atomic_helper_check_modeset(dev, &state->base); ret = drm_atomic_helper_check_modeset(dev, &state->base);
if (ret) if (ret)
return ret; goto fail;
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
new_crtc_state, i) { new_crtc_state, i) {
...@@ -13382,12 +13382,8 @@ static int intel_atomic_check(struct drm_device *dev, ...@@ -13382,12 +13382,8 @@ static int intel_atomic_check(struct drm_device *dev,
} }
ret = intel_modeset_pipe_config(new_crtc_state); ret = intel_modeset_pipe_config(new_crtc_state);
if (ret == -EDEADLK) if (ret)
return ret; goto fail;
if (ret) {
intel_dump_pipe_config(new_crtc_state, "[failed]");
return ret;
}
if (intel_pipe_config_compare(dev_priv, old_crtc_state, if (intel_pipe_config_compare(dev_priv, old_crtc_state,
new_crtc_state, true)) { new_crtc_state, true)) {
...@@ -13401,32 +13397,32 @@ static int intel_atomic_check(struct drm_device *dev, ...@@ -13401,32 +13397,32 @@ static int intel_atomic_check(struct drm_device *dev,
ret = drm_dp_mst_atomic_check(&state->base); ret = drm_dp_mst_atomic_check(&state->base);
if (ret) if (ret)
return ret; goto fail;
if (any_ms) { if (any_ms) {
ret = intel_modeset_checks(state); ret = intel_modeset_checks(state);
if (ret) if (ret)
return ret; goto fail;
} else { } else {
state->cdclk.logical = dev_priv->cdclk.logical; state->cdclk.logical = dev_priv->cdclk.logical;
} }
ret = icl_add_linked_planes(state); ret = icl_add_linked_planes(state);
if (ret) if (ret)
return ret; goto fail;
ret = drm_atomic_helper_check_planes(dev, &state->base); ret = drm_atomic_helper_check_planes(dev, &state->base);
if (ret) if (ret)
return ret; goto fail;
intel_fbc_choose_crtc(dev_priv, state); intel_fbc_choose_crtc(dev_priv, state);
ret = calc_watermark_data(state); ret = calc_watermark_data(state);
if (ret) if (ret)
return ret; goto fail;
ret = intel_bw_atomic_check(state); ret = intel_bw_atomic_check(state);
if (ret) if (ret)
return ret; goto fail;
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
new_crtc_state, i) { new_crtc_state, i) {
...@@ -13440,6 +13436,20 @@ static int intel_atomic_check(struct drm_device *dev, ...@@ -13440,6 +13436,20 @@ static int intel_atomic_check(struct drm_device *dev,
} }
return 0; return 0;
fail:
if (ret == -EDEADLK)
return ret;
/*
* FIXME would probably be nice to know which crtc specifically
* caused the failure, in cases where we can pinpoint it.
*/
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
new_crtc_state, i)
intel_dump_pipe_config(new_crtc_state, "[failed]");
return ret;
} }
static int intel_atomic_prepare_commit(struct drm_device *dev, static int intel_atomic_prepare_commit(struct drm_device *dev,
......
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