Skip to content

Commit e25148d

Browse files
committed
drm/i915: Check for invalid cloning earlier during modeset
Move the encoder cloning check to happen earlier in the modeset. The main benefit will be that the debug output from a failed modeset will be less confusing as output_types can not indicate an invalid configuration during the later computation stages. For instance, what happened to me was kms_setmode was attempting one of its invalid cloning checks during which it asked for DP+VGA cloning on HSW. In this case the DP .compute_config() was executed after the FDI .compute_config() leaving the DP link clock (1.62 in this case) in port_clock, and then later the FDI BW computation tried to use that as the FDI link clock (which should always be 2.7). 1.62 x 2 wasn't enough for the mode it was trying to use, and so it ended up rejecting the modeset, not because of an invalid cloning configuration, but because of supposedly running out of FDI bandwidth. Took me a while to figure out what had actually happened. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1466621833-5054-12-git-send-email-ville.syrjala@linux.intel.com
1 parent 3f1c928 commit e25148d

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11997,26 +11997,6 @@ static bool check_single_encoder_cloning(struct drm_atomic_state *state,
1199711997
return true;
1199811998
}
1199911999

12000-
static bool check_encoder_cloning(struct drm_atomic_state *state,
12001-
struct intel_crtc *crtc)
12002-
{
12003-
struct intel_encoder *encoder;
12004-
struct drm_connector *connector;
12005-
struct drm_connector_state *connector_state;
12006-
int i;
12007-
12008-
for_each_connector_in_state(state, connector, connector_state, i) {
12009-
if (connector_state->crtc != &crtc->base)
12010-
continue;
12011-
12012-
encoder = to_intel_encoder(connector_state->best_encoder);
12013-
if (!check_single_encoder_cloning(state, crtc, encoder))
12014-
return false;
12015-
}
12016-
12017-
return true;
12018-
}
12019-
1202012000
static int intel_crtc_atomic_check(struct drm_crtc *crtc,
1202112001
struct drm_crtc_state *crtc_state)
1202212002
{
@@ -12029,11 +12009,6 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,
1202912009
int ret;
1203012010
bool mode_changed = needs_modeset(crtc_state);
1203112011

12032-
if (mode_changed && !check_encoder_cloning(state, intel_crtc)) {
12033-
DRM_DEBUG_KMS("rejecting invalid cloning configuration\n");
12034-
return -EINVAL;
12035-
}
12036-
1203712012
if (mode_changed && !crtc_state->active)
1203812013
pipe_config->update_wm_post = true;
1203912014

@@ -12472,6 +12447,11 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
1247212447

1247312448
encoder = to_intel_encoder(connector_state->best_encoder);
1247412449

12450+
if (!check_single_encoder_cloning(state, to_intel_crtc(crtc), encoder)) {
12451+
DRM_DEBUG_KMS("rejecting invalid cloning configuration\n");
12452+
goto fail;
12453+
}
12454+
1247512455
/*
1247612456
* Determine output_types before calling the .compute_config()
1247712457
* hooks so that the hooks can use this information safely.

0 commit comments

Comments
 (0)