@@ -181,6 +181,7 @@ struct dw_hdmi {
181
181
182
182
struct mutex mutex ; /* for state below and previous_mode */
183
183
enum drm_connector_force force ; /* mutex-protected force state */
184
+ struct drm_connector * curr_conn ;/* current connector (only valid when !disabled) */
184
185
bool disabled ; /* DRM has disabled our bridge */
185
186
bool bridge_is_on ; /* indicates the bridge is on */
186
187
bool rxsense ; /* rxsense state */
@@ -2823,23 +2824,32 @@ static void dw_hdmi_bridge_mode_set(struct drm_bridge *bridge,
2823
2824
mutex_unlock (& hdmi -> mutex );
2824
2825
}
2825
2826
2826
- static void dw_hdmi_bridge_disable (struct drm_bridge * bridge )
2827
+ static void dw_hdmi_bridge_atomic_disable (struct drm_bridge * bridge ,
2828
+ struct drm_bridge_state * old_state )
2827
2829
{
2828
2830
struct dw_hdmi * hdmi = bridge -> driver_private ;
2829
2831
2830
2832
mutex_lock (& hdmi -> mutex );
2831
2833
hdmi -> disabled = true;
2834
+ hdmi -> curr_conn = NULL ;
2832
2835
dw_hdmi_update_power (hdmi );
2833
2836
dw_hdmi_update_phy_mask (hdmi );
2834
2837
mutex_unlock (& hdmi -> mutex );
2835
2838
}
2836
2839
2837
- static void dw_hdmi_bridge_enable (struct drm_bridge * bridge )
2840
+ static void dw_hdmi_bridge_atomic_enable (struct drm_bridge * bridge ,
2841
+ struct drm_bridge_state * old_state )
2838
2842
{
2839
2843
struct dw_hdmi * hdmi = bridge -> driver_private ;
2844
+ struct drm_atomic_state * state = old_state -> base .state ;
2845
+ struct drm_connector * connector ;
2846
+
2847
+ connector = drm_atomic_get_new_connector_for_encoder (state ,
2848
+ bridge -> encoder );
2840
2849
2841
2850
mutex_lock (& hdmi -> mutex );
2842
2851
hdmi -> disabled = false;
2852
+ hdmi -> curr_conn = connector ;
2843
2853
dw_hdmi_update_power (hdmi );
2844
2854
dw_hdmi_update_phy_mask (hdmi );
2845
2855
mutex_unlock (& hdmi -> mutex );
@@ -2854,8 +2864,8 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = {
2854
2864
.atomic_check = dw_hdmi_bridge_atomic_check ,
2855
2865
.atomic_get_output_bus_fmts = dw_hdmi_bridge_atomic_get_output_bus_fmts ,
2856
2866
.atomic_get_input_bus_fmts = dw_hdmi_bridge_atomic_get_input_bus_fmts ,
2857
- .enable = dw_hdmi_bridge_enable ,
2858
- .disable = dw_hdmi_bridge_disable ,
2867
+ .atomic_enable = dw_hdmi_bridge_atomic_enable ,
2868
+ .atomic_disable = dw_hdmi_bridge_atomic_disable ,
2859
2869
.mode_set = dw_hdmi_bridge_mode_set ,
2860
2870
.mode_valid = dw_hdmi_bridge_mode_valid ,
2861
2871
};
0 commit comments