Commit 09ede541 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: make SDVO TV-out work for multifunction devices

We need to track this correctly. While at it shovel the boolean
to track whether the sdvo is in tv mode or not into pipe_config.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36997Tested-by: default avatarPierre Assal <pierre.assal@verint.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63609Tested-by: default avatarcancan,feng <cancan.feng@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent a16af721
...@@ -4587,7 +4587,7 @@ static void i9xx_update_pll(struct intel_crtc *crtc, ...@@ -4587,7 +4587,7 @@ static void i9xx_update_pll(struct intel_crtc *crtc,
if (INTEL_INFO(dev)->gen >= 4) if (INTEL_INFO(dev)->gen >= 4)
dpll |= (6 << PLL_LOAD_PULSE_PHASE_SHIFT); dpll |= (6 << PLL_LOAD_PULSE_PHASE_SHIFT);
if (is_sdvo && intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_TVOUT)) if (crtc->config.sdvo_tv_clock)
dpll |= PLL_REF_INPUT_TVCLKINBC; dpll |= PLL_REF_INPUT_TVCLKINBC;
else if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS) && else if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS) &&
intel_panel_use_ssc(dev_priv) && num_connectors < 2) intel_panel_use_ssc(dev_priv) && num_connectors < 2)
...@@ -5598,7 +5598,7 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc, ...@@ -5598,7 +5598,7 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc,
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
uint32_t dpll; uint32_t dpll;
int factor, num_connectors = 0; int factor, num_connectors = 0;
bool is_lvds = false, is_sdvo = false, is_tv = false; bool is_lvds = false, is_sdvo = false;
for_each_encoder_on_crtc(dev, crtc, intel_encoder) { for_each_encoder_on_crtc(dev, crtc, intel_encoder) {
switch (intel_encoder->type) { switch (intel_encoder->type) {
...@@ -5608,8 +5608,6 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc, ...@@ -5608,8 +5608,6 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc,
case INTEL_OUTPUT_SDVO: case INTEL_OUTPUT_SDVO:
case INTEL_OUTPUT_HDMI: case INTEL_OUTPUT_HDMI:
is_sdvo = true; is_sdvo = true;
if (intel_encoder->needs_tv_clock)
is_tv = true;
break; break;
} }
...@@ -5623,7 +5621,7 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc, ...@@ -5623,7 +5621,7 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc,
dev_priv->lvds_ssc_freq == 100) || dev_priv->lvds_ssc_freq == 100) ||
(HAS_PCH_IBX(dev) && intel_is_dual_link_lvds(dev))) (HAS_PCH_IBX(dev) && intel_is_dual_link_lvds(dev)))
factor = 25; factor = 25;
} else if (is_sdvo && is_tv) } else if (intel_crtc->config.sdvo_tv_clock)
factor = 20; factor = 20;
if (ironlake_needs_fb_cb_tune(&intel_crtc->config.dpll, factor)) if (ironlake_needs_fb_cb_tune(&intel_crtc->config.dpll, factor))
......
...@@ -120,7 +120,6 @@ struct intel_encoder { ...@@ -120,7 +120,6 @@ struct intel_encoder {
struct intel_crtc *new_crtc; struct intel_crtc *new_crtc;
int type; int type;
bool needs_tv_clock;
/* /*
* Intel hw has only one MUX where encoders could be clone, hence a * Intel hw has only one MUX where encoders could be clone, hence a
* simple flag is enough to compute the possible_clones mask. * simple flag is enough to compute the possible_clones mask.
...@@ -223,6 +222,10 @@ struct intel_crtc_config { ...@@ -223,6 +222,10 @@ struct intel_crtc_config {
/* Controls for the clock computation, to override various stages. */ /* Controls for the clock computation, to override various stages. */
bool clock_set; bool clock_set;
/* SDVO TV has a bunch of special case. To make multifunction encoders
* work correctly, we need to track this at runtime.*/
bool sdvo_tv_clock;
/* /*
* crtc bandwidth limit, don't increase pipe bpp or clock if not really * crtc bandwidth limit, don't increase pipe bpp or clock if not really
* required. This is set in the 2nd loop of calling encoder's * required. This is set in the 2nd loop of calling encoder's
......
...@@ -1092,6 +1092,7 @@ static bool intel_sdvo_compute_config(struct intel_encoder *encoder, ...@@ -1092,6 +1092,7 @@ static bool intel_sdvo_compute_config(struct intel_encoder *encoder,
(void) intel_sdvo_get_preferred_input_mode(intel_sdvo, (void) intel_sdvo_get_preferred_input_mode(intel_sdvo,
mode, mode,
adjusted_mode); adjusted_mode);
pipe_config->sdvo_tv_clock = true;
} else if (intel_sdvo->is_lvds) { } else if (intel_sdvo->is_lvds) {
if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo,
intel_sdvo->sdvo_lvds_fixed_mode)) intel_sdvo->sdvo_lvds_fixed_mode))
...@@ -1655,12 +1656,9 @@ intel_sdvo_detect(struct drm_connector *connector, bool force) ...@@ -1655,12 +1656,9 @@ intel_sdvo_detect(struct drm_connector *connector, bool force)
if (ret == connector_status_connected) { if (ret == connector_status_connected) {
intel_sdvo->is_tv = false; intel_sdvo->is_tv = false;
intel_sdvo->is_lvds = false; intel_sdvo->is_lvds = false;
intel_sdvo->base.needs_tv_clock = false;
if (response & SDVO_TV_MASK) { if (response & SDVO_TV_MASK)
intel_sdvo->is_tv = true; intel_sdvo->is_tv = true;
intel_sdvo->base.needs_tv_clock = true;
}
if (response & SDVO_LVDS_MASK) if (response & SDVO_LVDS_MASK)
intel_sdvo->is_lvds = intel_sdvo->sdvo_lvds_fixed_mode != NULL; intel_sdvo->is_lvds = intel_sdvo->sdvo_lvds_fixed_mode != NULL;
} }
...@@ -2349,7 +2347,6 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) ...@@ -2349,7 +2347,6 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type)
intel_sdvo_connector->output_flag = type; intel_sdvo_connector->output_flag = type;
intel_sdvo->is_tv = true; intel_sdvo->is_tv = true;
intel_sdvo->base.needs_tv_clock = true;
intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo); intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
...@@ -2437,7 +2434,6 @@ static bool ...@@ -2437,7 +2434,6 @@ static bool
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags) intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags)
{ {
intel_sdvo->is_tv = false; intel_sdvo->is_tv = false;
intel_sdvo->base.needs_tv_clock = false;
intel_sdvo->is_lvds = false; intel_sdvo->is_lvds = false;
/* SDVO requires XXX1 function may not exist unless it has XXX0 function.*/ /* SDVO requires XXX1 function may not exist unless it has XXX0 function.*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment