diff options
author | Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> | 2014-10-29 05:32:30 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-11-04 17:22:15 -0500 |
commit | d0737e1d5944f570d5151ae6213952058c18a903 (patch) | |
tree | 581049c7ba18169d378a2029f3f7b9e2fcd80cda /drivers/gpu/drm/i915/intel_ddi.c | |
parent | cd0707cb1dbdd96b0358e5b10eba89c3bbe5a690 (diff) |
drm/i915: Make *_crtc_mode_set work on new_config
This shouldn't change the behavior of those functions, since they are
called after the new_config is made effective and that points to the
current config. In a follow up patch, the mode set sequence will be
changed so this is called before disabling crtcs, and in that case
those functions should work on the staged config.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
[danvet: Flatten if by moving the check into the WARN.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ddi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ddi.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index b182b9b80461..d41768846f18 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
@@ -459,6 +459,27 @@ intel_ddi_get_crtc_encoder(struct drm_crtc *crtc) | |||
459 | return ret; | 459 | return ret; |
460 | } | 460 | } |
461 | 461 | ||
462 | static struct intel_encoder * | ||
463 | intel_ddi_get_crtc_new_encoder(struct intel_crtc *crtc) | ||
464 | { | ||
465 | struct drm_device *dev = crtc->base.dev; | ||
466 | struct intel_encoder *intel_encoder, *ret = NULL; | ||
467 | int num_encoders = 0; | ||
468 | |||
469 | for_each_intel_encoder(dev, intel_encoder) { | ||
470 | if (intel_encoder->new_crtc == crtc) { | ||
471 | ret = intel_encoder; | ||
472 | num_encoders++; | ||
473 | } | ||
474 | } | ||
475 | |||
476 | WARN(num_encoders != 1, "%d encoders on crtc for pipe %c\n", num_encoders, | ||
477 | pipe_name(crtc->pipe)); | ||
478 | |||
479 | BUG_ON(ret == NULL); | ||
480 | return ret; | ||
481 | } | ||
482 | |||
462 | #define LC_FREQ 2700 | 483 | #define LC_FREQ 2700 |
463 | #define LC_FREQ_2K U64_C(LC_FREQ * 2000) | 484 | #define LC_FREQ_2K U64_C(LC_FREQ * 2000) |
464 | 485 | ||
@@ -792,7 +813,7 @@ hsw_ddi_pll_select(struct intel_crtc *intel_crtc, | |||
792 | WRPLL_DIVIDER_REFERENCE(r2) | WRPLL_DIVIDER_FEEDBACK(n2) | | 813 | WRPLL_DIVIDER_REFERENCE(r2) | WRPLL_DIVIDER_FEEDBACK(n2) | |
793 | WRPLL_DIVIDER_POST(p); | 814 | WRPLL_DIVIDER_POST(p); |
794 | 815 | ||
795 | intel_crtc->config.dpll_hw_state.wrpll = val; | 816 | intel_crtc->new_config->dpll_hw_state.wrpll = val; |
796 | 817 | ||
797 | pll = intel_get_shared_dpll(intel_crtc); | 818 | pll = intel_get_shared_dpll(intel_crtc); |
798 | if (pll == NULL) { | 819 | if (pll == NULL) { |
@@ -801,7 +822,7 @@ hsw_ddi_pll_select(struct intel_crtc *intel_crtc, | |||
801 | return false; | 822 | return false; |
802 | } | 823 | } |
803 | 824 | ||
804 | intel_crtc->config.ddi_pll_sel = PORT_CLK_SEL_WRPLL(pll->id); | 825 | intel_crtc->new_config->ddi_pll_sel = PORT_CLK_SEL_WRPLL(pll->id); |
805 | } | 826 | } |
806 | 827 | ||
807 | return true; | 828 | return true; |
@@ -817,9 +838,9 @@ hsw_ddi_pll_select(struct intel_crtc *intel_crtc, | |||
817 | */ | 838 | */ |
818 | bool intel_ddi_pll_select(struct intel_crtc *intel_crtc) | 839 | bool intel_ddi_pll_select(struct intel_crtc *intel_crtc) |
819 | { | 840 | { |
820 | struct drm_crtc *crtc = &intel_crtc->base; | 841 | struct intel_encoder *intel_encoder = |
821 | struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc); | 842 | intel_ddi_get_crtc_new_encoder(intel_crtc); |
822 | int clock = intel_crtc->config.port_clock; | 843 | int clock = intel_crtc->new_config->port_clock; |
823 | 844 | ||
824 | intel_put_shared_dpll(intel_crtc); | 845 | intel_put_shared_dpll(intel_crtc); |
825 | 846 | ||