forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/gpu/drm/nouveau/nouveau_encoder.h
....@@ -33,6 +33,7 @@
3333 #include <drm/drm_dp_mst_helper.h>
3434 #include "dispnv04/disp.h"
3535 struct nv50_head_atom;
36
+struct nouveau_connector;
3637
3738 #define NV_DPMS_CLEARED 0x80
3839
....@@ -52,6 +53,7 @@
5253 * actually programmed on the hw, not the proposed crtc */
5354 struct drm_crtc *crtc;
5455 u32 ctrl;
56
+ bool audio;
5557
5658 struct drm_display_mode mode;
5759 int last_dpms;
....@@ -63,13 +65,43 @@
6365 struct nv50_mstm *mstm;
6466 int link_nr;
6567 int link_bw;
68
+
69
+ /* Protects DP state that needs to be accessed outside
70
+ * connector reprobing contexts
71
+ */
72
+ struct mutex hpd_irq_lock;
73
+
74
+ u8 dpcd[DP_RECEIVER_CAP_SIZE];
75
+ u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
76
+ struct drm_dp_desc desc;
77
+
78
+ u8 sink_count;
6679 } dp;
6780 };
81
+
82
+ struct {
83
+ bool dp_interlace : 1;
84
+ } caps;
6885
6986 void (*enc_save)(struct drm_encoder *encoder);
7087 void (*enc_restore)(struct drm_encoder *encoder);
7188 void (*update)(struct nouveau_encoder *, u8 head,
7289 struct nv50_head_atom *, u8 proto, u8 depth);
90
+};
91
+
92
+struct nv50_mstm {
93
+ struct nouveau_encoder *outp;
94
+
95
+ struct drm_dp_mst_topology_mgr mgr;
96
+
97
+ /* Protected under nouveau_encoder->dp.hpd_irq_lock */
98
+ bool can_mst;
99
+ bool is_mst;
100
+ bool suspended;
101
+
102
+ bool modified;
103
+ bool disabled;
104
+ int links;
73105 };
74106
75107 struct nouveau_encoder *
....@@ -95,16 +127,29 @@
95127
96128 /* nouveau_dp.c */
97129 enum nouveau_dp_status {
130
+ NOUVEAU_DP_NONE,
98131 NOUVEAU_DP_SST,
99132 NOUVEAU_DP_MST,
100133 };
101134
102
-int nouveau_dp_detect(struct nouveau_encoder *);
135
+int nouveau_dp_detect(struct nouveau_connector *, struct nouveau_encoder *);
136
+void nouveau_dp_irq(struct nouveau_drm *drm,
137
+ struct nouveau_connector *nv_connector);
138
+enum drm_mode_status nv50_dp_mode_valid(struct drm_connector *,
139
+ struct nouveau_encoder *,
140
+ const struct drm_display_mode *,
141
+ unsigned *clock);
103142
104143 struct nouveau_connector *
105
-nouveau_encoder_connector_get(struct nouveau_encoder *encoder);
144
+nv50_outp_get_new_connector(struct nouveau_encoder *outp,
145
+ struct drm_atomic_state *state);
146
+struct nouveau_connector *
147
+nv50_outp_get_old_connector(struct nouveau_encoder *outp,
148
+ struct drm_atomic_state *state);
106149
107
-int nv50_mstm_detect(struct nv50_mstm *, u8 dpcd[8], int allow);
108
-void nv50_mstm_remove(struct nv50_mstm *);
109
-void nv50_mstm_service(struct nv50_mstm *);
150
+int nv50_mstm_detect(struct nouveau_encoder *encoder);
151
+void nv50_mstm_remove(struct nv50_mstm *mstm);
152
+bool nv50_mstm_service(struct nouveau_drm *drm,
153
+ struct nouveau_connector *nv_connector,
154
+ struct nv50_mstm *mstm);
110155 #endif /* __NOUVEAU_ENCODER_H__ */