Skip to content

Commit 1050e4c

Browse files
committed
drm/i915: Factor out a helper to check/compute all the CRTC states
Factor out intel_atomic_check_config() to check and compute all the CRTC states. This will be used by a follow up patch to recompute/check the state until required by BW limitations between CRTCs. Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e3b2690 commit 1050e4c

File tree

1 file changed

+46
-32
lines changed

1 file changed

+46
-32
lines changed

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6283,6 +6283,51 @@ static int intel_bigjoiner_add_affected_crtcs(struct intel_atomic_state *state)
62836283
return 0;
62846284
}
62856285

6286+
static int intel_atomic_check_config(struct intel_atomic_state *state)
6287+
{
6288+
struct drm_i915_private *i915 = to_i915(state->base.dev);
6289+
struct intel_crtc_state *new_crtc_state;
6290+
struct intel_crtc *crtc;
6291+
int ret;
6292+
int i;
6293+
6294+
ret = intel_bigjoiner_add_affected_crtcs(state);
6295+
if (ret)
6296+
return ret;
6297+
6298+
for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
6299+
if (!intel_crtc_needs_modeset(new_crtc_state)) {
6300+
if (intel_crtc_is_bigjoiner_slave(new_crtc_state))
6301+
copy_bigjoiner_crtc_state_nomodeset(state, crtc);
6302+
else
6303+
intel_crtc_copy_uapi_to_hw_state_nomodeset(state, crtc);
6304+
continue;
6305+
}
6306+
6307+
if (intel_crtc_is_bigjoiner_slave(new_crtc_state)) {
6308+
drm_WARN_ON(&i915->drm, new_crtc_state->uapi.enable);
6309+
continue;
6310+
}
6311+
6312+
ret = intel_crtc_prepare_cleared_state(state, crtc);
6313+
if (ret)
6314+
break;
6315+
6316+
if (!new_crtc_state->hw.enable)
6317+
continue;
6318+
6319+
ret = intel_modeset_pipe_config(state, crtc);
6320+
if (ret)
6321+
break;
6322+
6323+
ret = intel_atomic_check_bigjoiner(state, crtc);
6324+
if (ret)
6325+
break;
6326+
}
6327+
6328+
return ret;
6329+
}
6330+
62866331
/**
62876332
* intel_atomic_check - validate state object
62886333
* @dev: drm device
@@ -6327,41 +6372,10 @@ int intel_atomic_check(struct drm_device *dev,
63276372
return ret;
63286373
}
63296374

6330-
ret = intel_bigjoiner_add_affected_crtcs(state);
6375+
ret = intel_atomic_check_config(state);
63316376
if (ret)
63326377
goto fail;
63336378

6334-
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
6335-
new_crtc_state, i) {
6336-
if (!intel_crtc_needs_modeset(new_crtc_state)) {
6337-
if (intel_crtc_is_bigjoiner_slave(new_crtc_state))
6338-
copy_bigjoiner_crtc_state_nomodeset(state, crtc);
6339-
else
6340-
intel_crtc_copy_uapi_to_hw_state_nomodeset(state, crtc);
6341-
continue;
6342-
}
6343-
6344-
if (intel_crtc_is_bigjoiner_slave(new_crtc_state)) {
6345-
drm_WARN_ON(&dev_priv->drm, new_crtc_state->uapi.enable);
6346-
continue;
6347-
}
6348-
6349-
ret = intel_crtc_prepare_cleared_state(state, crtc);
6350-
if (ret)
6351-
goto fail;
6352-
6353-
if (!new_crtc_state->hw.enable)
6354-
continue;
6355-
6356-
ret = intel_modeset_pipe_config(state, crtc);
6357-
if (ret)
6358-
goto fail;
6359-
6360-
ret = intel_atomic_check_bigjoiner(state, crtc);
6361-
if (ret)
6362-
goto fail;
6363-
}
6364-
63656379
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
63666380
new_crtc_state, i) {
63676381
if (!intel_crtc_needs_modeset(new_crtc_state))

0 commit comments

Comments
 (0)