@@ -1620,24 +1620,6 @@ static void hsw_set_frame_start_delay(const struct intel_crtc_state *crtc_state)
1620
1620
HSW_FRAME_START_DELAY (crtc_state -> framestart_delay - 1 ));
1621
1621
}
1622
1622
1623
- static void icl_ddi_bigjoiner_pre_enable (struct intel_atomic_state * state ,
1624
- const struct intel_crtc_state * crtc_state )
1625
- {
1626
- struct intel_crtc * master_crtc = intel_master_crtc (crtc_state );
1627
-
1628
- /*
1629
- * Enable sequence steps 1-7 on bigjoiner master
1630
- */
1631
- if (intel_crtc_is_bigjoiner_slave (crtc_state ))
1632
- intel_encoders_pre_pll_enable (state , master_crtc );
1633
-
1634
- if (crtc_state -> shared_dpll )
1635
- intel_enable_shared_dpll (crtc_state );
1636
-
1637
- if (intel_crtc_is_bigjoiner_slave (crtc_state ))
1638
- intel_encoders_pre_enable (state , master_crtc );
1639
- }
1640
-
1641
1623
static void hsw_configure_cpu_transcoder (const struct intel_crtc_state * crtc_state )
1642
1624
{
1643
1625
struct intel_crtc * crtc = to_intel_crtc (crtc_state -> uapi .crtc );
@@ -1674,85 +1656,106 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,
1674
1656
intel_atomic_get_new_crtc_state (state , crtc );
1675
1657
struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
1676
1658
enum transcoder cpu_transcoder = new_crtc_state -> cpu_transcoder ;
1677
- enum pipe hsw_workaround_pipe ;
1659
+ struct intel_crtc * pipe_crtc ;
1678
1660
1679
1661
if (drm_WARN_ON (& dev_priv -> drm , crtc -> active ))
1680
1662
return ;
1681
1663
1682
- intel_dmc_enable_pipe (dev_priv , crtc -> pipe );
1664
+ for_each_intel_crtc_in_pipe_mask_reverse (& dev_priv -> drm , pipe_crtc ,
1665
+ intel_crtc_joined_pipe_mask (new_crtc_state ))
1666
+ intel_dmc_enable_pipe (dev_priv , pipe_crtc -> pipe );
1683
1667
1684
- if (!new_crtc_state -> bigjoiner_pipes ) {
1685
- intel_encoders_pre_pll_enable (state , crtc );
1668
+ intel_encoders_pre_pll_enable (state , crtc );
1686
1669
1687
- if (new_crtc_state -> shared_dpll )
1688
- intel_enable_shared_dpll (new_crtc_state );
1670
+ for_each_intel_crtc_in_pipe_mask_reverse (& dev_priv -> drm , pipe_crtc ,
1671
+ intel_crtc_joined_pipe_mask (new_crtc_state )) {
1672
+ const struct intel_crtc_state * pipe_crtc_state =
1673
+ intel_atomic_get_new_crtc_state (state , pipe_crtc );
1689
1674
1690
- intel_encoders_pre_enable (state , crtc );
1691
- } else {
1692
- icl_ddi_bigjoiner_pre_enable (state , new_crtc_state );
1675
+ if (pipe_crtc_state -> shared_dpll )
1676
+ intel_enable_shared_dpll (pipe_crtc_state );
1693
1677
}
1694
1678
1695
- intel_dsc_enable ( new_crtc_state );
1679
+ intel_encoders_pre_enable ( state , crtc );
1696
1680
1697
- if (DISPLAY_VER (dev_priv ) >= 13 )
1698
- intel_uncompressed_joiner_enable (new_crtc_state );
1681
+ for_each_intel_crtc_in_pipe_mask_reverse (& dev_priv -> drm , pipe_crtc ,
1682
+ intel_crtc_joined_pipe_mask (new_crtc_state )) {
1683
+ const struct intel_crtc_state * pipe_crtc_state =
1684
+ intel_atomic_get_new_crtc_state (state , pipe_crtc );
1699
1685
1700
- intel_set_pipe_src_size (new_crtc_state );
1701
- if (DISPLAY_VER (dev_priv ) >= 9 || IS_BROADWELL (dev_priv ))
1702
- bdw_set_pipe_misc (new_crtc_state );
1686
+ intel_dsc_enable (pipe_crtc_state );
1703
1687
1704
- if (!intel_crtc_is_bigjoiner_slave (new_crtc_state ) &&
1705
- !transcoder_is_dsi (cpu_transcoder ))
1688
+ if (DISPLAY_VER (dev_priv ) >= 13 )
1689
+ intel_uncompressed_joiner_enable (pipe_crtc_state );
1690
+
1691
+ intel_set_pipe_src_size (pipe_crtc_state );
1692
+
1693
+ if (DISPLAY_VER (dev_priv ) >= 9 || IS_BROADWELL (dev_priv ))
1694
+ bdw_set_pipe_misc (pipe_crtc_state );
1695
+ }
1696
+
1697
+ if (!transcoder_is_dsi (cpu_transcoder ))
1706
1698
hsw_configure_cpu_transcoder (new_crtc_state );
1707
1699
1708
- crtc -> active = true;
1700
+ for_each_intel_crtc_in_pipe_mask_reverse (& dev_priv -> drm , pipe_crtc ,
1701
+ intel_crtc_joined_pipe_mask (new_crtc_state )) {
1702
+ const struct intel_crtc_state * pipe_crtc_state =
1703
+ intel_atomic_get_new_crtc_state (state , pipe_crtc );
1709
1704
1710
- if (glk_need_scaler_clock_gating_wa (new_crtc_state ))
1711
- glk_pipe_scaler_clock_gating_wa (crtc , true);
1705
+ pipe_crtc -> active = true;
1712
1706
1713
- if (DISPLAY_VER (dev_priv ) >= 9 )
1714
- skl_pfit_enable (new_crtc_state );
1715
- else
1716
- ilk_pfit_enable (new_crtc_state );
1707
+ if (glk_need_scaler_clock_gating_wa (pipe_crtc_state ))
1708
+ glk_pipe_scaler_clock_gating_wa (pipe_crtc , true);
1717
1709
1718
- /*
1719
- * On ILK+ LUT must be loaded before the pipe is running but with
1720
- * clocks enabled
1721
- */
1722
- intel_color_load_luts (new_crtc_state );
1723
- intel_color_commit_noarm (new_crtc_state );
1724
- intel_color_commit_arm (new_crtc_state );
1725
- /* update DSPCNTR to configure gamma/csc for pipe bottom color */
1726
- if (DISPLAY_VER (dev_priv ) < 9 )
1727
- intel_disable_primary_plane (new_crtc_state );
1710
+ if (DISPLAY_VER (dev_priv ) >= 9 )
1711
+ skl_pfit_enable (pipe_crtc_state );
1712
+ else
1713
+ ilk_pfit_enable (pipe_crtc_state );
1728
1714
1729
- hsw_set_linetime_wm (new_crtc_state );
1715
+ /*
1716
+ * On ILK+ LUT must be loaded before the pipe is running but with
1717
+ * clocks enabled
1718
+ */
1719
+ intel_color_load_luts (pipe_crtc_state );
1720
+ intel_color_commit_noarm (pipe_crtc_state );
1721
+ intel_color_commit_arm (pipe_crtc_state );
1722
+ /* update DSPCNTR to configure gamma/csc for pipe bottom color */
1723
+ if (DISPLAY_VER (dev_priv ) < 9 )
1724
+ intel_disable_primary_plane (pipe_crtc_state );
1730
1725
1731
- if (DISPLAY_VER (dev_priv ) >= 11 )
1732
- icl_set_pipe_chicken (new_crtc_state );
1726
+ hsw_set_linetime_wm (pipe_crtc_state );
1733
1727
1734
- intel_initial_watermarks (state , crtc );
1728
+ if (DISPLAY_VER (dev_priv ) >= 11 )
1729
+ icl_set_pipe_chicken (pipe_crtc_state );
1735
1730
1736
- if ( intel_crtc_is_bigjoiner_slave ( new_crtc_state ))
1737
- intel_crtc_vblank_on ( new_crtc_state );
1731
+ intel_initial_watermarks ( state , pipe_crtc );
1732
+ }
1738
1733
1739
1734
intel_encoders_enable (state , crtc );
1740
1735
1741
- if (glk_need_scaler_clock_gating_wa (new_crtc_state )) {
1742
- intel_crtc_wait_for_next_vblank (crtc );
1743
- glk_pipe_scaler_clock_gating_wa (crtc , false);
1744
- }
1736
+ for_each_intel_crtc_in_pipe_mask_reverse (& dev_priv -> drm , pipe_crtc ,
1737
+ intel_crtc_joined_pipe_mask (new_crtc_state )) {
1738
+ const struct intel_crtc_state * pipe_crtc_state =
1739
+ intel_atomic_get_new_crtc_state (state , pipe_crtc );
1740
+ enum pipe hsw_workaround_pipe ;
1745
1741
1746
- /* If we change the relative order between pipe/planes enabling, we need
1747
- * to change the workaround. */
1748
- hsw_workaround_pipe = new_crtc_state -> hsw_workaround_pipe ;
1749
- if (IS_HASWELL (dev_priv ) && hsw_workaround_pipe != INVALID_PIPE ) {
1750
- struct intel_crtc * wa_crtc ;
1742
+ if (glk_need_scaler_clock_gating_wa (pipe_crtc_state )) {
1743
+ intel_crtc_wait_for_next_vblank (pipe_crtc );
1744
+ glk_pipe_scaler_clock_gating_wa (pipe_crtc , false);
1745
+ }
1751
1746
1752
- wa_crtc = intel_crtc_for_pipe (dev_priv , hsw_workaround_pipe );
1747
+ /*
1748
+ * If we change the relative order between pipe/planes
1749
+ * enabling, we need to change the workaround.
1750
+ */
1751
+ hsw_workaround_pipe = pipe_crtc_state -> hsw_workaround_pipe ;
1752
+ if (IS_HASWELL (dev_priv ) && hsw_workaround_pipe != INVALID_PIPE ) {
1753
+ struct intel_crtc * wa_crtc =
1754
+ intel_crtc_for_pipe (dev_priv , hsw_workaround_pipe );
1753
1755
1754
- intel_crtc_wait_for_next_vblank (wa_crtc );
1755
- intel_crtc_wait_for_next_vblank (wa_crtc );
1756
+ intel_crtc_wait_for_next_vblank (wa_crtc );
1757
+ intel_crtc_wait_for_next_vblank (wa_crtc );
1758
+ }
1756
1759
}
1757
1760
}
1758
1761
@@ -6763,17 +6766,21 @@ static void intel_enable_crtc(struct intel_atomic_state *state,
6763
6766
struct drm_i915_private * dev_priv = to_i915 (state -> base .dev );
6764
6767
const struct intel_crtc_state * new_crtc_state =
6765
6768
intel_atomic_get_new_crtc_state (state , crtc );
6769
+ struct intel_crtc * pipe_crtc ;
6766
6770
6767
6771
if (!intel_crtc_needs_modeset (new_crtc_state ))
6768
6772
return ;
6769
6773
6770
- /* VRR will be enable later, if required */
6771
- intel_crtc_update_active_timings (new_crtc_state , false);
6774
+ for_each_intel_crtc_in_pipe_mask_reverse (& dev_priv -> drm , pipe_crtc ,
6775
+ intel_crtc_joined_pipe_mask (new_crtc_state )) {
6776
+ const struct intel_crtc_state * pipe_crtc_state =
6777
+ intel_atomic_get_new_crtc_state (state , pipe_crtc );
6772
6778
6773
- dev_priv -> display .funcs .display -> crtc_enable (state , crtc );
6779
+ /* VRR will be enable later, if required */
6780
+ intel_crtc_update_active_timings (pipe_crtc_state , false);
6781
+ }
6774
6782
6775
- if (intel_crtc_is_bigjoiner_slave (new_crtc_state ))
6776
- return ;
6783
+ dev_priv -> display .funcs .display -> crtc_enable (state , crtc );
6777
6784
6778
6785
/* vblanks work again, re-enable pipe CRC. */
6779
6786
intel_crtc_enable_pipe_crc (crtc );
@@ -7079,12 +7086,14 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state)
7079
7086
if ((modeset_pipes & BIT (pipe )) == 0 )
7080
7087
continue ;
7081
7088
7089
+ if (intel_crtc_is_bigjoiner_slave (new_crtc_state ))
7090
+ continue ;
7091
+
7082
7092
if (intel_dp_mst_is_slave_trans (new_crtc_state ) ||
7083
- is_trans_port_sync_master (new_crtc_state ) ||
7084
- intel_crtc_is_bigjoiner_master (new_crtc_state ))
7093
+ is_trans_port_sync_master (new_crtc_state ))
7085
7094
continue ;
7086
7095
7087
- modeset_pipes &= ~BIT ( pipe );
7096
+ modeset_pipes &= ~intel_crtc_joined_pipe_mask ( new_crtc_state );
7088
7097
7089
7098
intel_enable_crtc (state , crtc );
7090
7099
}
@@ -7099,7 +7108,10 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state)
7099
7108
if ((modeset_pipes & BIT (pipe )) == 0 )
7100
7109
continue ;
7101
7110
7102
- modeset_pipes &= ~BIT (pipe );
7111
+ if (intel_crtc_is_bigjoiner_slave (new_crtc_state ))
7112
+ continue ;
7113
+
7114
+ modeset_pipes &= ~intel_crtc_joined_pipe_mask (new_crtc_state );
7103
7115
7104
7116
intel_enable_crtc (state , crtc );
7105
7117
}
0 commit comments