Skip to content

Commit b66617c

Browse files
vsyrjalagregkh
authored andcommitted
drm/i915/sdvo: Setup DDC fully before output init
commit e797625 upstream. Call intel_sdvo_select_ddc_bus() before initializing any of the outputs. And before that is functional (assuming no VBT) we have to set up the controlled_outputs thing. Otherwise DDC won't be functional during the output init but LVDS really needs it for the fixed mode setup. Note that the whole multi output support still looks very bogus, and more work will be needed to make it correct. But for now this should at least fix the LVDS EDID fixed mode setup. Cc: [email protected] Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7301 Fixes: aa2b880 ("drm/i915/sdvo: Fix multi function encoder stuff") Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]> (cherry picked from commit 64b7b55) Signed-off-by: Tvrtko Ursulin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 73d5232 commit b66617c

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

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

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,13 +2762,10 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
27622762
if (!intel_sdvo_connector)
27632763
return false;
27642764

2765-
if (device == 0) {
2766-
intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0;
2765+
if (device == 0)
27672766
intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS0;
2768-
} else if (device == 1) {
2769-
intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1;
2767+
else if (device == 1)
27702768
intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS1;
2771-
}
27722769

27732770
intel_connector = &intel_sdvo_connector->base;
27742771
connector = &intel_connector->base;
@@ -2823,7 +2820,6 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type)
28232820
encoder->encoder_type = DRM_MODE_ENCODER_TVDAC;
28242821
connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO;
28252822

2826-
intel_sdvo->controlled_output |= type;
28272823
intel_sdvo_connector->output_flag = type;
28282824

28292825
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
@@ -2864,13 +2860,10 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device)
28642860
encoder->encoder_type = DRM_MODE_ENCODER_DAC;
28652861
connector->connector_type = DRM_MODE_CONNECTOR_VGA;
28662862

2867-
if (device == 0) {
2868-
intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0;
2863+
if (device == 0)
28692864
intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB0;
2870-
} else if (device == 1) {
2871-
intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1;
2865+
else if (device == 1)
28722866
intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1;
2873-
}
28742867

28752868
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
28762869
kfree(intel_sdvo_connector);
@@ -2900,13 +2893,10 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
29002893
encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
29012894
connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
29022895

2903-
if (device == 0) {
2904-
intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0;
2896+
if (device == 0)
29052897
intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS0;
2906-
} else if (device == 1) {
2907-
intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1;
2898+
else if (device == 1)
29082899
intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1;
2909-
}
29102900

29112901
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
29122902
kfree(intel_sdvo_connector);
@@ -2959,8 +2949,14 @@ static u16 intel_sdvo_filter_output_flags(u16 flags)
29592949
static bool
29602950
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
29612951
{
2952+
struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev);
2953+
29622954
flags = intel_sdvo_filter_output_flags(flags);
29632955

2956+
intel_sdvo->controlled_output = flags;
2957+
2958+
intel_sdvo_select_ddc_bus(i915, intel_sdvo);
2959+
29642960
if (flags & SDVO_OUTPUT_TMDS0)
29652961
if (!intel_sdvo_dvi_init(intel_sdvo, 0))
29662962
return false;
@@ -3001,7 +2997,6 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
30012997
if (flags == 0) {
30022998
unsigned char bytes[2];
30032999

3004-
intel_sdvo->controlled_output = 0;
30053000
memcpy(bytes, &intel_sdvo->caps.output_flags, 2);
30063001
DRM_DEBUG_KMS("%s: Unknown SDVO output type (0x%02x%02x)\n",
30073002
SDVO_NAME(intel_sdvo),
@@ -3413,8 +3408,6 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,
34133408
*/
34143409
intel_sdvo->base.cloneable = 0;
34153410

3416-
intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo);
3417-
34183411
/* Set the input timing to the screen. Assume always input 0. */
34193412
if (!intel_sdvo_set_target_input(intel_sdvo))
34203413
goto err_output;

0 commit comments

Comments
 (0)