Skip to content

Commit 2abaa32

Browse files
victorlu-amdalexdeucher
authored andcommitted
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: Victor Lu <[email protected]> Reviewed-by: Roman Li <[email protected]> Acked-by: Anson Jacob <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 3ddc818 commit 2abaa32

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8354,14 +8354,14 @@ static int dm_force_atomic_commit(struct drm_connector *connector)
83548354

83558355
ret = PTR_ERR_OR_ZERO(conn_state);
83568356
if (ret)
8357-
goto err;
8357+
goto out;
83588358

83598359
/* Attach crtc to drm_atomic_state*/
83608360
crtc_state = drm_atomic_get_crtc_state(state, &disconnected_acrtc->base);
83618361

83628362
ret = PTR_ERR_OR_ZERO(crtc_state);
83638363
if (ret)
8364-
goto err;
8364+
goto out;
83658365

83668366
/* force a restore */
83678367
crtc_state->mode_changed = true;
@@ -8371,17 +8371,15 @@ static int dm_force_atomic_commit(struct drm_connector *connector)
83718371

83728372
ret = PTR_ERR_OR_ZERO(plane_state);
83738373
if (ret)
8374-
goto err;
8375-
8374+
goto out;
83768375

83778376
/* Call commit internally with the state we just constructed */
83788377
ret = drm_atomic_commit(state);
8379-
if (!ret)
8380-
return 0;
83818378

8382-
err:
8383-
DRM_ERROR("Restoring old state failed with %i\n", ret);
8379+
out:
83848380
drm_atomic_state_put(state);
8381+
if (ret)
8382+
DRM_ERROR("Restoring old state failed with %i\n", ret);
83858383

83868384
return ret;
83878385
}

0 commit comments

Comments
 (0)