Skip to content

Commit e797625

Browse files
vsyrjalatursulin
authored andcommitted
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]> (cherry picked from commit 64b7b55) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent 3e206b6 commit e797625

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
@@ -2747,13 +2747,10 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
27472747
if (!intel_sdvo_connector)
27482748
return false;
27492749

2750-
if (device == 0) {
2751-
intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0;
2750+
if (device == 0)
27522751
intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS0;
2753-
} else if (device == 1) {
2754-
intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1;
2752+
else if (device == 1)
27552753
intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS1;
2756-
}
27572754

27582755
intel_connector = &intel_sdvo_connector->base;
27592756
connector = &intel_connector->base;
@@ -2808,7 +2805,6 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type)
28082805
encoder->encoder_type = DRM_MODE_ENCODER_TVDAC;
28092806
connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO;
28102807

2811-
intel_sdvo->controlled_output |= type;
28122808
intel_sdvo_connector->output_flag = type;
28132809

28142810
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
@@ -2849,13 +2845,10 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device)
28492845
encoder->encoder_type = DRM_MODE_ENCODER_DAC;
28502846
connector->connector_type = DRM_MODE_CONNECTOR_VGA;
28512847

2852-
if (device == 0) {
2853-
intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0;
2848+
if (device == 0)
28542849
intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB0;
2855-
} else if (device == 1) {
2856-
intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1;
2850+
else if (device == 1)
28572851
intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1;
2858-
}
28592852

28602853
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
28612854
kfree(intel_sdvo_connector);
@@ -2885,13 +2878,10 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
28852878
encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
28862879
connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
28872880

2888-
if (device == 0) {
2889-
intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0;
2881+
if (device == 0)
28902882
intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS0;
2891-
} else if (device == 1) {
2892-
intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1;
2883+
else if (device == 1)
28932884
intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1;
2894-
}
28952885

28962886
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
28972887
kfree(intel_sdvo_connector);
@@ -2946,8 +2936,14 @@ static u16 intel_sdvo_filter_output_flags(u16 flags)
29462936
static bool
29472937
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
29482938
{
2939+
struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev);
2940+
29492941
flags = intel_sdvo_filter_output_flags(flags);
29502942

2943+
intel_sdvo->controlled_output = flags;
2944+
2945+
intel_sdvo_select_ddc_bus(i915, intel_sdvo);
2946+
29512947
if (flags & SDVO_OUTPUT_TMDS0)
29522948
if (!intel_sdvo_dvi_init(intel_sdvo, 0))
29532949
return false;
@@ -2988,7 +2984,6 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
29882984
if (flags == 0) {
29892985
unsigned char bytes[2];
29902986

2991-
intel_sdvo->controlled_output = 0;
29922987
memcpy(bytes, &intel_sdvo->caps.output_flags, 2);
29932988
DRM_DEBUG_KMS("%s: Unknown SDVO output type (0x%02x%02x)\n",
29942989
SDVO_NAME(intel_sdvo),
@@ -3400,8 +3395,6 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,
34003395
*/
34013396
intel_sdvo->base.cloneable = 0;
34023397

3403-
intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo);
3404-
34053398
/* Set the input timing to the screen. Assume always input 0. */
34063399
if (!intel_sdvo_set_target_input(intel_sdvo))
34073400
goto err_output;

0 commit comments

Comments
 (0)