diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-04-30 08:01:45 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-05-10 15:56:46 -0400 |
commit | 09ede5414f0215461c933032630bf9c3a61a8ba3 (patch) | |
tree | 603fe6012789c9b5dca478c33a2cc7aadc628cb6 /drivers/gpu/drm/i915 | |
parent | a16af721e83466b965c7e53d5350e16abf9691e4 (diff) |
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=36997
Tested-by: Pierre Assal <pierre.assal@verint.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63609
Tested-by: cancan,feng <cancan.feng@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 8 |
3 files changed, 9 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index df81f1648400..e75e54680321 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4587,7 +4587,7 @@ static void i9xx_update_pll(struct intel_crtc *crtc, | |||
4587 | if (INTEL_INFO(dev)->gen >= 4) | 4587 | if (INTEL_INFO(dev)->gen >= 4) |
4588 | dpll |= (6 << PLL_LOAD_PULSE_PHASE_SHIFT); | 4588 | dpll |= (6 << PLL_LOAD_PULSE_PHASE_SHIFT); |
4589 | 4589 | ||
4590 | if (is_sdvo && intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_TVOUT)) | 4590 | if (crtc->config.sdvo_tv_clock) |
4591 | dpll |= PLL_REF_INPUT_TVCLKINBC; | 4591 | dpll |= PLL_REF_INPUT_TVCLKINBC; |
4592 | else if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS) && | 4592 | else if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS) && |
4593 | intel_panel_use_ssc(dev_priv) && num_connectors < 2) | 4593 | 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 | struct intel_encoder *intel_encoder; | 5598 | struct intel_encoder *intel_encoder; |
5599 | uint32_t dpll; | 5599 | uint32_t dpll; |
5600 | int factor, num_connectors = 0; | 5600 | int factor, num_connectors = 0; |
5601 | bool is_lvds = false, is_sdvo = false, is_tv = false; | 5601 | bool is_lvds = false, is_sdvo = false; |
5602 | 5602 | ||
5603 | for_each_encoder_on_crtc(dev, crtc, intel_encoder) { | 5603 | for_each_encoder_on_crtc(dev, crtc, intel_encoder) { |
5604 | switch (intel_encoder->type) { | 5604 | switch (intel_encoder->type) { |
@@ -5608,8 +5608,6 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc, | |||
5608 | case INTEL_OUTPUT_SDVO: | 5608 | case INTEL_OUTPUT_SDVO: |
5609 | case INTEL_OUTPUT_HDMI: | 5609 | case INTEL_OUTPUT_HDMI: |
5610 | is_sdvo = true; | 5610 | is_sdvo = true; |
5611 | if (intel_encoder->needs_tv_clock) | ||
5612 | is_tv = true; | ||
5613 | break; | 5611 | break; |
5614 | } | 5612 | } |
5615 | 5613 | ||
@@ -5623,7 +5621,7 @@ static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc, | |||
5623 | dev_priv->lvds_ssc_freq == 100) || | 5621 | dev_priv->lvds_ssc_freq == 100) || |
5624 | (HAS_PCH_IBX(dev) && intel_is_dual_link_lvds(dev))) | 5622 | (HAS_PCH_IBX(dev) && intel_is_dual_link_lvds(dev))) |
5625 | factor = 25; | 5623 | factor = 25; |
5626 | } else if (is_sdvo && is_tv) | 5624 | } else if (intel_crtc->config.sdvo_tv_clock) |
5627 | factor = 20; | 5625 | factor = 20; |
5628 | 5626 | ||
5629 | if (ironlake_needs_fb_cb_tune(&intel_crtc->config.dpll, factor)) | 5627 | if (ironlake_needs_fb_cb_tune(&intel_crtc->config.dpll, factor)) |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 118e1bfcbe85..0f3554592719 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -120,7 +120,6 @@ struct intel_encoder { | |||
120 | struct intel_crtc *new_crtc; | 120 | struct intel_crtc *new_crtc; |
121 | 121 | ||
122 | int type; | 122 | int type; |
123 | bool needs_tv_clock; | ||
124 | /* | 123 | /* |
125 | * Intel hw has only one MUX where encoders could be clone, hence a | 124 | * Intel hw has only one MUX where encoders could be clone, hence a |
126 | * simple flag is enough to compute the possible_clones mask. | 125 | * simple flag is enough to compute the possible_clones mask. |
@@ -223,6 +222,10 @@ struct intel_crtc_config { | |||
223 | /* Controls for the clock computation, to override various stages. */ | 222 | /* Controls for the clock computation, to override various stages. */ |
224 | bool clock_set; | 223 | bool clock_set; |
225 | 224 | ||
225 | /* SDVO TV has a bunch of special case. To make multifunction encoders | ||
226 | * work correctly, we need to track this at runtime.*/ | ||
227 | bool sdvo_tv_clock; | ||
228 | |||
226 | /* | 229 | /* |
227 | * crtc bandwidth limit, don't increase pipe bpp or clock if not really | 230 | * crtc bandwidth limit, don't increase pipe bpp or clock if not really |
228 | * required. This is set in the 2nd loop of calling encoder's | 231 | * required. This is set in the 2nd loop of calling encoder's |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 0fc6fc2d6a30..015f9f4263fe 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -1092,6 +1092,7 @@ static bool intel_sdvo_compute_config(struct intel_encoder *encoder, | |||
1092 | (void) intel_sdvo_get_preferred_input_mode(intel_sdvo, | 1092 | (void) intel_sdvo_get_preferred_input_mode(intel_sdvo, |
1093 | mode, | 1093 | mode, |
1094 | adjusted_mode); | 1094 | adjusted_mode); |
1095 | pipe_config->sdvo_tv_clock = true; | ||
1095 | } else if (intel_sdvo->is_lvds) { | 1096 | } else if (intel_sdvo->is_lvds) { |
1096 | if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, | 1097 | if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, |
1097 | intel_sdvo->sdvo_lvds_fixed_mode)) | 1098 | intel_sdvo->sdvo_lvds_fixed_mode)) |
@@ -1655,12 +1656,9 @@ intel_sdvo_detect(struct drm_connector *connector, bool force) | |||
1655 | if (ret == connector_status_connected) { | 1656 | if (ret == connector_status_connected) { |
1656 | intel_sdvo->is_tv = false; | 1657 | intel_sdvo->is_tv = false; |
1657 | intel_sdvo->is_lvds = false; | 1658 | intel_sdvo->is_lvds = false; |
1658 | intel_sdvo->base.needs_tv_clock = false; | ||
1659 | 1659 | ||
1660 | if (response & SDVO_TV_MASK) { | 1660 | if (response & SDVO_TV_MASK) |
1661 | intel_sdvo->is_tv = true; | 1661 | intel_sdvo->is_tv = true; |
1662 | intel_sdvo->base.needs_tv_clock = true; | ||
1663 | } | ||
1664 | if (response & SDVO_LVDS_MASK) | 1662 | if (response & SDVO_LVDS_MASK) |
1665 | intel_sdvo->is_lvds = intel_sdvo->sdvo_lvds_fixed_mode != NULL; | 1663 | intel_sdvo->is_lvds = intel_sdvo->sdvo_lvds_fixed_mode != NULL; |
1666 | } | 1664 | } |
@@ -2349,7 +2347,6 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) | |||
2349 | intel_sdvo_connector->output_flag = type; | 2347 | intel_sdvo_connector->output_flag = type; |
2350 | 2348 | ||
2351 | intel_sdvo->is_tv = true; | 2349 | intel_sdvo->is_tv = true; |
2352 | intel_sdvo->base.needs_tv_clock = true; | ||
2353 | 2350 | ||
2354 | intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo); | 2351 | intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo); |
2355 | 2352 | ||
@@ -2437,7 +2434,6 @@ static bool | |||
2437 | intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags) | 2434 | intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags) |
2438 | { | 2435 | { |
2439 | intel_sdvo->is_tv = false; | 2436 | intel_sdvo->is_tv = false; |
2440 | intel_sdvo->base.needs_tv_clock = false; | ||
2441 | intel_sdvo->is_lvds = false; | 2437 | intel_sdvo->is_lvds = false; |
2442 | 2438 | ||
2443 | /* SDVO requires XXX1 function may not exist unless it has XXX0 function.*/ | 2439 | /* SDVO requires XXX1 function may not exist unless it has XXX0 function.*/ |