mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08:00
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: stable@vger.kernel.org
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7301
Fixes: aa2b88074a
("drm/i915/sdvo: Fix multi function encoder stuff")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221026101134.20865-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
cc1e66394d
commit
64b7b557dc
@ -2755,13 +2755,10 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
|
|||||||
if (!intel_sdvo_connector)
|
if (!intel_sdvo_connector)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (device == 0) {
|
if (device == 0)
|
||||||
intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0;
|
|
||||||
intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS0;
|
intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS0;
|
||||||
} else if (device == 1) {
|
else if (device == 1)
|
||||||
intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1;
|
|
||||||
intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS1;
|
intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS1;
|
||||||
}
|
|
||||||
|
|
||||||
intel_connector = &intel_sdvo_connector->base;
|
intel_connector = &intel_sdvo_connector->base;
|
||||||
connector = &intel_connector->base;
|
connector = &intel_connector->base;
|
||||||
@ -2816,7 +2813,6 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type)
|
|||||||
encoder->encoder_type = DRM_MODE_ENCODER_TVDAC;
|
encoder->encoder_type = DRM_MODE_ENCODER_TVDAC;
|
||||||
connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO;
|
connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO;
|
||||||
|
|
||||||
intel_sdvo->controlled_output |= type;
|
|
||||||
intel_sdvo_connector->output_flag = type;
|
intel_sdvo_connector->output_flag = type;
|
||||||
|
|
||||||
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
|
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)
|
|||||||
encoder->encoder_type = DRM_MODE_ENCODER_DAC;
|
encoder->encoder_type = DRM_MODE_ENCODER_DAC;
|
||||||
connector->connector_type = DRM_MODE_CONNECTOR_VGA;
|
connector->connector_type = DRM_MODE_CONNECTOR_VGA;
|
||||||
|
|
||||||
if (device == 0) {
|
if (device == 0)
|
||||||
intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0;
|
|
||||||
intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB0;
|
intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB0;
|
||||||
} else if (device == 1) {
|
else if (device == 1)
|
||||||
intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1;
|
|
||||||
intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1;
|
intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1;
|
||||||
}
|
|
||||||
|
|
||||||
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
|
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
|
||||||
kfree(intel_sdvo_connector);
|
kfree(intel_sdvo_connector);
|
||||||
@ -2893,13 +2886,10 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
|
|||||||
encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
|
encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
|
||||||
connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
|
connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
|
||||||
|
|
||||||
if (device == 0) {
|
if (device == 0)
|
||||||
intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0;
|
|
||||||
intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS0;
|
intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS0;
|
||||||
} else if (device == 1) {
|
else if (device == 1)
|
||||||
intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1;
|
|
||||||
intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1;
|
intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1;
|
||||||
}
|
|
||||||
|
|
||||||
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
|
if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
|
||||||
kfree(intel_sdvo_connector);
|
kfree(intel_sdvo_connector);
|
||||||
@ -2954,8 +2944,14 @@ static u16 intel_sdvo_filter_output_flags(u16 flags)
|
|||||||
static bool
|
static bool
|
||||||
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
|
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
|
||||||
{
|
{
|
||||||
|
struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev);
|
||||||
|
|
||||||
flags = intel_sdvo_filter_output_flags(flags);
|
flags = intel_sdvo_filter_output_flags(flags);
|
||||||
|
|
||||||
|
intel_sdvo->controlled_output = flags;
|
||||||
|
|
||||||
|
intel_sdvo_select_ddc_bus(i915, intel_sdvo);
|
||||||
|
|
||||||
if (flags & SDVO_OUTPUT_TMDS0)
|
if (flags & SDVO_OUTPUT_TMDS0)
|
||||||
if (!intel_sdvo_dvi_init(intel_sdvo, 0))
|
if (!intel_sdvo_dvi_init(intel_sdvo, 0))
|
||||||
return false;
|
return false;
|
||||||
@ -2996,7 +2992,6 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
|
|||||||
if (flags == 0) {
|
if (flags == 0) {
|
||||||
unsigned char bytes[2];
|
unsigned char bytes[2];
|
||||||
|
|
||||||
intel_sdvo->controlled_output = 0;
|
|
||||||
memcpy(bytes, &intel_sdvo->caps.output_flags, 2);
|
memcpy(bytes, &intel_sdvo->caps.output_flags, 2);
|
||||||
DRM_DEBUG_KMS("%s: Unknown SDVO output type (0x%02x%02x)\n",
|
DRM_DEBUG_KMS("%s: Unknown SDVO output type (0x%02x%02x)\n",
|
||||||
SDVO_NAME(intel_sdvo),
|
SDVO_NAME(intel_sdvo),
|
||||||
@ -3408,8 +3403,6 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,
|
|||||||
*/
|
*/
|
||||||
intel_sdvo->base.cloneable = 0;
|
intel_sdvo->base.cloneable = 0;
|
||||||
|
|
||||||
intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo);
|
|
||||||
|
|
||||||
/* Set the input timing to the screen. Assume always input 0. */
|
/* Set the input timing to the screen. Assume always input 0. */
|
||||||
if (!intel_sdvo_set_target_input(intel_sdvo))
|
if (!intel_sdvo_set_target_input(intel_sdvo))
|
||||||
goto err_output;
|
goto err_output;
|
||||||
|
Loading…
Reference in New Issue
Block a user