mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
drm/i915: Extract intel_atomic_swap_state()
Pull all the state swap stuff into its own function to declutter intel_atomic_commit() a bit. Note that currently the state swap is spread across both sides of the unprepare branch in intel_atomic_commit(), but we can pull all of it ahead a bit since we bail on the first error, and thus there is no change in behaviour from the reordering. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231219130756.25986-4-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
This commit is contained in:
parent
e0aee99015
commit
c1ce62e4d6
|
|
@ -7320,6 +7320,23 @@ static int intel_atomic_setup_commit(struct intel_atomic_state *state, bool nonb
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int intel_atomic_swap_state(struct intel_atomic_state *state)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = drm_atomic_helper_swap_state(&state->base, true);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
intel_atomic_swap_global_state(state);
|
||||
|
||||
intel_shared_dpll_swap_state(state);
|
||||
|
||||
intel_atomic_track_fbs(state);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int intel_atomic_commit(struct drm_device *dev, struct drm_atomic_state *_state,
|
||||
bool nonblock)
|
||||
{
|
||||
|
|
@ -7367,9 +7384,7 @@ int intel_atomic_commit(struct drm_device *dev, struct drm_atomic_state *_state,
|
|||
|
||||
ret = intel_atomic_setup_commit(state, nonblock);
|
||||
if (!ret)
|
||||
ret = drm_atomic_helper_swap_state(&state->base, true);
|
||||
if (!ret)
|
||||
intel_atomic_swap_global_state(state);
|
||||
ret = intel_atomic_swap_state(state);
|
||||
|
||||
if (ret) {
|
||||
struct intel_crtc_state *new_crtc_state;
|
||||
|
|
@ -7383,8 +7398,6 @@ int intel_atomic_commit(struct drm_device *dev, struct drm_atomic_state *_state,
|
|||
intel_runtime_pm_put(&dev_priv->runtime_pm, state->wakeref);
|
||||
return ret;
|
||||
}
|
||||
intel_shared_dpll_swap_state(state);
|
||||
intel_atomic_track_fbs(state);
|
||||
|
||||
drm_atomic_state_get(&state->base);
|
||||
INIT_WORK(&state->base.commit_work, intel_atomic_commit_work);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user