@@ -6585,6 +6585,140 @@ void intel_dp_encoder_reset(struct drm_encoder *encoder)
6585
6585
}
6586
6586
}
6587
6587
6588
+ static int intel_modeset_tile_group (struct intel_atomic_state * state ,
6589
+ int tile_group_id )
6590
+ {
6591
+ struct drm_i915_private * dev_priv = to_i915 (state -> base .dev );
6592
+ struct drm_connector_list_iter conn_iter ;
6593
+ struct drm_connector * connector ;
6594
+ int ret = 0 ;
6595
+
6596
+ drm_connector_list_iter_begin (& dev_priv -> drm , & conn_iter );
6597
+ drm_for_each_connector_iter (connector , & conn_iter ) {
6598
+ struct drm_connector_state * conn_state ;
6599
+ struct intel_crtc_state * crtc_state ;
6600
+ struct intel_crtc * crtc ;
6601
+
6602
+ if (!connector -> has_tile ||
6603
+ connector -> tile_group -> id != tile_group_id )
6604
+ continue ;
6605
+
6606
+ conn_state = drm_atomic_get_connector_state (& state -> base ,
6607
+ connector );
6608
+ if (IS_ERR (conn_state )) {
6609
+ ret = PTR_ERR (conn_state );
6610
+ break ;
6611
+ }
6612
+
6613
+ crtc = to_intel_crtc (conn_state -> crtc );
6614
+
6615
+ if (!crtc )
6616
+ continue ;
6617
+
6618
+ crtc_state = intel_atomic_get_new_crtc_state (state , crtc );
6619
+ crtc_state -> uapi .mode_changed = true;
6620
+
6621
+ ret = drm_atomic_add_affected_planes (& state -> base , & crtc -> base );
6622
+ if (ret )
6623
+ break ;
6624
+ }
6625
+ drm_connector_list_iter_begin (& dev_priv -> drm , & conn_iter );
6626
+
6627
+ return ret ;
6628
+ }
6629
+
6630
+ static int intel_modeset_affected_transcoders (struct intel_atomic_state * state , u8 transcoders )
6631
+ {
6632
+ struct drm_i915_private * dev_priv = to_i915 (state -> base .dev );
6633
+ struct intel_crtc * crtc ;
6634
+
6635
+ if (transcoders == 0 )
6636
+ return 0 ;
6637
+
6638
+ for_each_intel_crtc (& dev_priv -> drm , crtc ) {
6639
+ struct intel_crtc_state * crtc_state ;
6640
+ int ret ;
6641
+
6642
+ crtc_state = intel_atomic_get_crtc_state (& state -> base , crtc );
6643
+ if (IS_ERR (crtc_state ))
6644
+ return PTR_ERR (crtc_state );
6645
+
6646
+ if (!crtc_state -> hw .enable )
6647
+ continue ;
6648
+
6649
+ if (!(transcoders & BIT (crtc_state -> cpu_transcoder )))
6650
+ continue ;
6651
+
6652
+ crtc_state -> uapi .mode_changed = true;
6653
+
6654
+ ret = drm_atomic_add_affected_connectors (& state -> base , & crtc -> base );
6655
+ if (ret )
6656
+ return ret ;
6657
+
6658
+ ret = drm_atomic_add_affected_planes (& state -> base , & crtc -> base );
6659
+ if (ret )
6660
+ return ret ;
6661
+
6662
+ transcoders &= ~BIT (crtc_state -> cpu_transcoder );
6663
+ }
6664
+
6665
+ WARN_ON (transcoders != 0 );
6666
+
6667
+ return 0 ;
6668
+ }
6669
+
6670
+ static int intel_modeset_synced_crtcs (struct intel_atomic_state * state ,
6671
+ struct drm_connector * connector )
6672
+ {
6673
+ const struct drm_connector_state * old_conn_state =
6674
+ drm_atomic_get_old_connector_state (& state -> base , connector );
6675
+ const struct intel_crtc_state * old_crtc_state ;
6676
+ struct intel_crtc * crtc ;
6677
+ u8 transcoders ;
6678
+
6679
+ crtc = to_intel_crtc (old_conn_state -> crtc );
6680
+ if (!crtc )
6681
+ return 0 ;
6682
+
6683
+ old_crtc_state = intel_atomic_get_old_crtc_state (state , crtc );
6684
+
6685
+ if (!old_crtc_state -> hw .active )
6686
+ return 0 ;
6687
+
6688
+ transcoders = old_crtc_state -> sync_mode_slaves_mask ;
6689
+ if (old_crtc_state -> master_transcoder != INVALID_TRANSCODER )
6690
+ transcoders |= BIT (old_crtc_state -> master_transcoder );
6691
+
6692
+ return intel_modeset_affected_transcoders (state ,
6693
+ transcoders );
6694
+ }
6695
+
6696
+ static int intel_dp_connector_atomic_check (struct drm_connector * conn ,
6697
+ struct drm_atomic_state * _state )
6698
+ {
6699
+ struct drm_i915_private * dev_priv = to_i915 (conn -> dev );
6700
+ struct intel_atomic_state * state = to_intel_atomic_state (_state );
6701
+ int ret ;
6702
+
6703
+ ret = intel_digital_connector_atomic_check (conn , & state -> base );
6704
+ if (ret )
6705
+ return ret ;
6706
+
6707
+ if (INTEL_GEN (dev_priv ) < 11 )
6708
+ return 0 ;
6709
+
6710
+ if (!intel_connector_needs_modeset (state , conn ))
6711
+ return 0 ;
6712
+
6713
+ if (conn -> has_tile ) {
6714
+ ret = intel_modeset_tile_group (state , conn -> tile_group -> id );
6715
+ if (ret )
6716
+ return ret ;
6717
+ }
6718
+
6719
+ return intel_modeset_synced_crtcs (state , conn );
6720
+ }
6721
+
6588
6722
static const struct drm_connector_funcs intel_dp_connector_funcs = {
6589
6723
.force = intel_dp_force ,
6590
6724
.fill_modes = drm_helper_probe_single_connector_modes ,
@@ -6601,7 +6735,7 @@ static const struct drm_connector_helper_funcs intel_dp_connector_helper_funcs =
6601
6735
.detect_ctx = intel_dp_detect ,
6602
6736
.get_modes = intel_dp_get_modes ,
6603
6737
.mode_valid = intel_dp_mode_valid ,
6604
- .atomic_check = intel_digital_connector_atomic_check ,
6738
+ .atomic_check = intel_dp_connector_atomic_check ,
6605
6739
};
6606
6740
6607
6741
static const struct drm_encoder_funcs intel_dp_enc_funcs = {
0 commit comments