Commit 2dc39051 authored by Victor Lu's avatar Victor Lu Committed by Alex Deucher

drm/amd/display: Free atomic state after drm_atomic_commit

[why]
drm_atomic_commit was changed so that the caller must free their
drm_atomic_state reference on successes.

[how]
Add drm_atomic_commit_put after drm_atomic_commit call in
dm_force_atomic_commit.
Signed-off-by: default avatarVictor Lu <victorchengchi.lu@amd.com>
Reviewed-by: default avatarRoman Li <Roman.Li@amd.com>
Acked-by: default avatarAnson Jacob <Anson.Jacob@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent dc33e0aa
...@@ -8446,14 +8446,14 @@ static int dm_force_atomic_commit(struct drm_connector *connector) ...@@ -8446,14 +8446,14 @@ static int dm_force_atomic_commit(struct drm_connector *connector)
ret = PTR_ERR_OR_ZERO(conn_state); ret = PTR_ERR_OR_ZERO(conn_state);
if (ret) if (ret)
goto err; goto out;
/* Attach crtc to drm_atomic_state*/ /* Attach crtc to drm_atomic_state*/
crtc_state = drm_atomic_get_crtc_state(state, &disconnected_acrtc->base); crtc_state = drm_atomic_get_crtc_state(state, &disconnected_acrtc->base);
ret = PTR_ERR_OR_ZERO(crtc_state); ret = PTR_ERR_OR_ZERO(crtc_state);
if (ret) if (ret)
goto err; goto out;
/* force a restore */ /* force a restore */
crtc_state->mode_changed = true; crtc_state->mode_changed = true;
...@@ -8463,17 +8463,15 @@ static int dm_force_atomic_commit(struct drm_connector *connector) ...@@ -8463,17 +8463,15 @@ static int dm_force_atomic_commit(struct drm_connector *connector)
ret = PTR_ERR_OR_ZERO(plane_state); ret = PTR_ERR_OR_ZERO(plane_state);
if (ret) if (ret)
goto err; goto out;
/* Call commit internally with the state we just constructed */ /* Call commit internally with the state we just constructed */
ret = drm_atomic_commit(state); ret = drm_atomic_commit(state);
if (!ret)
return 0;
err: out:
DRM_ERROR("Restoring old state failed with %i\n", ret);
drm_atomic_state_put(state); drm_atomic_state_put(state);
if (ret)
DRM_ERROR("Restoring old state failed with %i\n", ret);
return ret; return ret;
} }
......
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