Skip to content

Commit 64b7b55

Browse files
committed
drm/i915/sdvo: Setup DDC fully before output init
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]>
1 parent cc1e663 commit 64b7b55

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
@@ -2755,13 +2755,10 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
27552755
if (!intel_sdvo_connector)
27562756
return false;
27572757

2758-
if (device == 0) {
2759-
intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0;
2758+
if (device == 0)
27602759
intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS0;
2761-
} else if (device == 1) {
2762-
intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1;
2760+
else if (device == 1)
27632761
intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS1;
2764-
}
27652762

27662763
intel_connector = &intel_sdvo_connector->base;
27672764
connector = &intel_connector->base;
@@ -2816,7 +2813,6 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type)
28162813
encoder->encoder_type = DRM_MODE_ENCODER_TVDAC;
28172814
connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO;
28182815

2819-
intel_sdvo->controlled_output |= type;
28202816
intel_sdvo_connector->output_flag = type;
28212817

28222818
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
@@ -2857,13 +2853,10 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device)
28572853
encoder->encoder_type = DRM_MODE_ENCODER_DAC;
28582854
connector->connector_type = DRM_MODE_CONNECTOR_VGA;
28592855

2860-
if (device == 0) {
2861-
intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0;
2856+
if (device == 0)
28622857
intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB0;
2863-
} else if (device == 1) {
2864-
intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1;
2858+
else if (device == 1)
28652859
intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1;
2866-
}
28672860

28682861
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
28692862
kfree(intel_sdvo_connector);
@@ -2893,13 +2886,10 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
28932886
encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
28942887
connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
28952888

2896-
if (device == 0) {
2897-
intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0;
2889+
if (device == 0)
28982890
intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS0;
2899-
} else if (device == 1) {
2900-
intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1;
2891+
else if (device == 1)
29012892
intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1;
2902-
}
29032893

29042894
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
29052895
kfree(intel_sdvo_connector);
@@ -2954,8 +2944,14 @@ static u16 intel_sdvo_filter_output_flags(u16 flags)
29542944
static bool
29552945
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
29562946
{
2947+
struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev);
2948+
29572949
flags = intel_sdvo_filter_output_flags(flags);
29582950

2951+
intel_sdvo->controlled_output = flags;
2952+
2953+
intel_sdvo_select_ddc_bus(i915, intel_sdvo);
2954+
29592955
if (flags & SDVO_OUTPUT_TMDS0)
29602956
if (!intel_sdvo_dvi_init(intel_sdvo, 0))
29612957
return false;
@@ -2996,7 +2992,6 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
29962992
if (flags == 0) {
29972993
unsigned char bytes[2];
29982994

2999-
intel_sdvo->controlled_output = 0;
30002995
memcpy(bytes, &intel_sdvo->caps.output_flags, 2);
30012996
DRM_DEBUG_KMS("%s: Unknown SDVO output type (0x%02x%02x)\n",
30022997
SDVO_NAME(intel_sdvo),
@@ -3408,8 +3403,6 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,
34083403
*/
34093404
intel_sdvo->base.cloneable = 0;
34103405

3411-
intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo);
3412-
34133406
/* Set the input timing to the screen. Assume always input 0. */
34143407
if (!intel_sdvo_set_target_input(intel_sdvo))
34153408
goto err_output;

0 commit comments

Comments
 (0)