[PATCH 022/108] drm/i915/display: Simplify intel_modeset_commit_pipes_for_atomic_state()

Imre Deak
2026-04-28T12:53:27Z

Simplify accessing the DRM atomic state via the intel atomic state
in intel_modeset_commit_pipes_for_atomic_state(), which also allows
dropping the cached DRM state pointer. Also streamline the success/error
return flows.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/display/intel_display.c | 22 +++++++-------------
1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 560b057ec163d..f13aaaf2ea1de 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -5629,33 +5629,27 @@ int intel_modeset_all_pipes_late(struct intel_atomic_state *state,
return 0;
}

-int intel_modeset_commit_pipes_for_atomic_state(struct intel_atomic_state *intel_state,
+int intel_modeset_commit_pipes_for_atomic_state(struct intel_atomic_state *state,
u8 pipe_mask,
struct drm_modeset_acquire_ctx *ctx)
{
- struct drm_atomic_state *state = &intel_state->base;
- struct intel_display *display = to_intel_display(intel_state);
+ struct intel_display *display = to_intel_display(state);
struct intel_crtc *crtc;
- int ret;

- state->acquire_ctx = ctx;
- to_intel_atomic_state(state)->internal = true;
+ state->base.acquire_ctx = ctx;
+ state->internal = true;

for_each_intel_crtc_in_pipe_mask(display->drm, crtc, pipe_mask) {
struct intel_crtc_state *crtc_state =
- intel_atomic_get_crtc_state(state, crtc);
+ intel_atomic_get_crtc_state(&state->base, crtc);

- if (IS_ERR(crtc_state)) {
- ret = PTR_ERR(crtc_state);
- goto out;
- }
+ if (IS_ERR(crtc_state))
+ return PTR_ERR(crtc_state);

crtc_state->uapi.connectors_changed = true;
}

- ret = drm_atomic_commit(state);
-out:
- return ret;
+ return drm_atomic_commit(&state->base);
}

int intel_modeset_commit_pipes(struct intel_display *display,
--
2.49.1