Skip to content

Commit f280142

Browse files
vsyrjalauma-intel
authored andcommitted
drm/i915: Introduce encoder->compute_config_late()
Add an optional secondary encoder state compute hook. This gets called after the normak .compute_config() has been called for all the encoders in the state. Thus in the new hook we can rely on all derived state populated by .compute_config() to be already set up. Should be useful for MST and port sync master/slave transcoder selection. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Manasi Navare <[email protected]> Signed-off-by: Uma Shankar <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c014e07 commit f280142

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13549,6 +13549,35 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)
1354913549
return 0;
1355013550
}
1355113551

13552+
static int
13553+
intel_modeset_pipe_config_late(struct intel_crtc_state *crtc_state)
13554+
{
13555+
struct intel_atomic_state *state =
13556+
to_intel_atomic_state(crtc_state->uapi.state);
13557+
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
13558+
struct drm_connector_state *conn_state;
13559+
struct drm_connector *connector;
13560+
int i;
13561+
13562+
for_each_new_connector_in_state(&state->base, connector,
13563+
conn_state, i) {
13564+
struct intel_encoder *encoder =
13565+
to_intel_encoder(conn_state->best_encoder);
13566+
int ret;
13567+
13568+
if (conn_state->crtc != &crtc->base ||
13569+
!encoder->compute_config_late)
13570+
continue;
13571+
13572+
ret = encoder->compute_config_late(encoder, crtc_state,
13573+
conn_state);
13574+
if (ret)
13575+
return ret;
13576+
}
13577+
13578+
return 0;
13579+
}
13580+
1355213581
bool intel_fuzzy_clock_check(int clock1, int clock2)
1355313582
{
1355413583
int diff;
@@ -14954,6 +14983,16 @@ static int intel_atomic_check(struct drm_device *dev,
1495414983
ret = intel_modeset_pipe_config(new_crtc_state);
1495514984
if (ret)
1495614985
goto fail;
14986+
}
14987+
14988+
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
14989+
new_crtc_state, i) {
14990+
if (!needs_modeset(new_crtc_state))
14991+
continue;
14992+
14993+
ret = intel_modeset_pipe_config_late(new_crtc_state);
14994+
if (ret)
14995+
goto fail;
1495714996

1495814997
intel_crtc_check_fastset(old_crtc_state, new_crtc_state);
1495914998
}

drivers/gpu/drm/i915/display/intel_display_types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ struct intel_encoder {
141141
int (*compute_config)(struct intel_encoder *,
142142
struct intel_crtc_state *,
143143
struct drm_connector_state *);
144+
int (*compute_config_late)(struct intel_encoder *,
145+
struct intel_crtc_state *,
146+
struct drm_connector_state *);
144147
void (*update_prepare)(struct intel_atomic_state *,
145148
struct intel_encoder *,
146149
struct intel_crtc *);

0 commit comments

Comments
 (0)