xref: /linux/drivers/gpu/drm/msm/dp/dp_drm.h (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
4  */
5 
6 #ifndef _DP_DRM_H_
7 #define _DP_DRM_H_
8 
9 #include <linux/types.h>
10 #include <drm/drm_bridge.h>
11 
12 #include "msm_drv.h"
13 #include "dp_display.h"
14 
15 struct msm_dp_bridge {
16 	struct drm_bridge bridge;
17 	struct msm_dp *msm_dp_display;
18 };
19 
20 #define to_dp_bridge(x)     container_of((x), struct msm_dp_bridge, bridge)
21 
22 struct drm_connector *msm_dp_drm_connector_init(struct msm_dp *msm_dp_display,
23 					    struct drm_encoder *encoder);
24 int msm_dp_bridge_init(struct msm_dp *msm_dp_display, struct drm_device *dev,
25 		   struct drm_encoder *encoder,
26 		   bool yuv_supported);
27 
28 void msm_dp_bridge_atomic_enable(struct drm_bridge *drm_bridge,
29 			     struct drm_bridge_state *old_bridge_state);
30 void msm_dp_bridge_atomic_disable(struct drm_bridge *drm_bridge,
31 			      struct drm_bridge_state *old_bridge_state);
32 void msm_dp_bridge_atomic_post_disable(struct drm_bridge *drm_bridge,
33 				   struct drm_bridge_state *old_bridge_state);
34 enum drm_mode_status msm_dp_bridge_mode_valid(struct drm_bridge *bridge,
35 					  const struct drm_display_info *info,
36 					  const struct drm_display_mode *mode);
37 void msm_dp_bridge_mode_set(struct drm_bridge *drm_bridge,
38 			const struct drm_display_mode *mode,
39 			const struct drm_display_mode *adjusted_mode);
40 void msm_dp_bridge_hpd_enable(struct drm_bridge *bridge);
41 void msm_dp_bridge_hpd_disable(struct drm_bridge *bridge);
42 void msm_dp_bridge_hpd_notify(struct drm_bridge *bridge,
43 			  enum drm_connector_status status);
44 
45 #endif /* _DP_DRM_H_ */
46