xref: /linux/drivers/gpu/drm/nouveau/include/nvif/if0012.h (revision 633716501c94cc45e504a1f14fcef717f1ac5e9b)
11b255f1cSBen Skeggs /* SPDX-License-Identifier: MIT */
21b255f1cSBen Skeggs #ifndef __NVIF_IF0012_H__
31b255f1cSBen Skeggs #define __NVIF_IF0012_H__
41b255f1cSBen Skeggs 
525feda6fSKees Cook #include <drm/display/drm_dp.h>
625feda6fSKees Cook 
71b255f1cSBen Skeggs union nvif_outp_args {
81b255f1cSBen Skeggs 	struct nvif_outp_v0 {
91b255f1cSBen Skeggs 		__u8 version;
101b255f1cSBen Skeggs 		__u8 id;	/* DCB device index. */
111b255f1cSBen Skeggs 		__u8 pad02[6];
121b255f1cSBen Skeggs 	} v0;
131b255f1cSBen Skeggs };
14dfc4005fSBen Skeggs 
15a69eeb37SBen Skeggs #define NVIF_OUTP_V0_DETECT        0x00
160cd7e071SBen Skeggs #define NVIF_OUTP_V0_EDID_GET      0x01
17a69eeb37SBen Skeggs 
181b477f42SLyude Paul #define NVIF_OUTP_V0_INHERIT       0x10
1921636b1aSBen Skeggs #define NVIF_OUTP_V0_ACQUIRE       0x11
2021636b1aSBen Skeggs #define NVIF_OUTP_V0_RELEASE       0x12
2121636b1aSBen Skeggs 
2221636b1aSBen Skeggs #define NVIF_OUTP_V0_LOAD_DETECT   0x20
2321636b1aSBen Skeggs 
242274ce7eSBen Skeggs #define NVIF_OUTP_V0_BL_GET        0x30
252274ce7eSBen Skeggs #define NVIF_OUTP_V0_BL_SET        0x31
262274ce7eSBen Skeggs 
275b9c0307SBen Skeggs #define NVIF_OUTP_V0_LVDS          0x40
285b9c0307SBen Skeggs 
296c6abab2SBen Skeggs #define NVIF_OUTP_V0_HDMI          0x50
306c6abab2SBen Skeggs 
3121636b1aSBen Skeggs #define NVIF_OUTP_V0_INFOFRAME     0x60
3221636b1aSBen Skeggs #define NVIF_OUTP_V0_HDA_ELD       0x61
3321636b1aSBen Skeggs 
3421636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_AUX_PWR    0x70
35bd7a61bcSBen Skeggs #define NVIF_OUTP_V0_DP_AUX_XFER   0x71
36bfb03a07SBen Skeggs #define NVIF_OUTP_V0_DP_RATES      0x72
37*63371650SBen Skeggs #define NVIF_OUTP_V0_DP_TRAIN      0x73
3821636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_MST_VCPI   0x78
39dfc4005fSBen Skeggs 
40a69eeb37SBen Skeggs union nvif_outp_detect_args {
41a69eeb37SBen Skeggs 	struct nvif_outp_detect_v0 {
42a69eeb37SBen Skeggs 		__u8 version;
43a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_NOT_PRESENT 0x00
44a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_PRESENT     0x01
45a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_UNKNOWN     0x02
46a69eeb37SBen Skeggs 		__u8 status;
47a69eeb37SBen Skeggs 	} v0;
48a69eeb37SBen Skeggs };
49a69eeb37SBen Skeggs 
500cd7e071SBen Skeggs union nvif_outp_edid_get_args {
510cd7e071SBen Skeggs 	struct nvif_outp_edid_get_v0 {
520cd7e071SBen Skeggs 		__u8  version;
530cd7e071SBen Skeggs 		__u8  pad01;
540cd7e071SBen Skeggs 		__u16 size;
550cd7e071SBen Skeggs 		__u8  data[2048];
560cd7e071SBen Skeggs 	} v0;
570cd7e071SBen Skeggs };
580cd7e071SBen Skeggs 
59dfc4005fSBen Skeggs union nvif_outp_load_detect_args {
60dfc4005fSBen Skeggs 	struct nvif_outp_load_detect_v0 {
61dfc4005fSBen Skeggs 		__u8  version;
62dfc4005fSBen Skeggs 		__u8  load;
63dfc4005fSBen Skeggs 		__u8  pad02[2];
64dfc4005fSBen Skeggs 		__u32 data; /*TODO: move vbios loadval parsing into nvkm */
65dfc4005fSBen Skeggs 	} v0;
66dfc4005fSBen Skeggs };
67ea6143a8SBen Skeggs 
68ea6143a8SBen Skeggs union nvif_outp_acquire_args {
69ea6143a8SBen Skeggs 	struct nvif_outp_acquire_v0 {
70ea6143a8SBen Skeggs 		__u8 version;
71724e0f3bSBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_DAC  0x00
72cefc3c14SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_SOR  0x01
73cefc3c14SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_PIOR 0x02
74724e0f3bSBen Skeggs 		__u8 type;
75ea6143a8SBen Skeggs 		__u8 or;
76ea6143a8SBen Skeggs 		__u8 link;
77ea6143a8SBen Skeggs 		__u8 pad04[4];
78ea6143a8SBen Skeggs 		union {
79ea6143a8SBen Skeggs 			struct {
80cefc3c14SBen Skeggs 				__u8 hda;
81cefc3c14SBen Skeggs 			} sor;
82ea6143a8SBen Skeggs 		};
83ea6143a8SBen Skeggs 	} v0;
84ea6143a8SBen Skeggs };
85ea6143a8SBen Skeggs 
861b477f42SLyude Paul union nvif_outp_inherit_args {
871b477f42SLyude Paul 	struct nvif_outp_inherit_v0 {
881b477f42SLyude Paul 		__u8 version;
891b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_RGB_CRT 0x00
901b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_TV      0x01
911b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_TMDS    0x02
921b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_LVDS    0x03
931b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_DP      0x04
941b477f42SLyude Paul 		// In/out. Input is one of the above values, output is the actual hw protocol
951b477f42SLyude Paul 		__u8 proto;
961b477f42SLyude Paul 		__u8 or;
971b477f42SLyude Paul 		__u8 link;
981b477f42SLyude Paul 		__u8 head;
991b477f42SLyude Paul 		union {
1001b477f42SLyude Paul 			struct {
1011b477f42SLyude Paul 				// TODO: Figure out padding, and whether we even want this field
1021b477f42SLyude Paul 				__u8 hda;
1031b477f42SLyude Paul 			} tmds;
1041b477f42SLyude Paul 		};
1051b477f42SLyude Paul 	} v0;
1061b477f42SLyude Paul };
1071b477f42SLyude Paul 
108ea6143a8SBen Skeggs union nvif_outp_release_args {
109ea6143a8SBen Skeggs 	struct nvif_outp_release_vn {
110ea6143a8SBen Skeggs 	} vn;
111ea6143a8SBen Skeggs };
112f530bc60SBen Skeggs 
1132274ce7eSBen Skeggs union nvif_outp_bl_get_args {
1142274ce7eSBen Skeggs 	struct nvif_outp_bl_get_v0 {
1152274ce7eSBen Skeggs 		__u8  version;
1162274ce7eSBen Skeggs 		__u8  level;
1172274ce7eSBen Skeggs 	} v0;
1182274ce7eSBen Skeggs };
1192274ce7eSBen Skeggs 
1202274ce7eSBen Skeggs union nvif_outp_bl_set_args {
1212274ce7eSBen Skeggs 	struct nvif_outp_bl_set_v0 {
1222274ce7eSBen Skeggs 		__u8  version;
1232274ce7eSBen Skeggs 		__u8  level;
1242274ce7eSBen Skeggs 	} v0;
1252274ce7eSBen Skeggs };
1262274ce7eSBen Skeggs 
1275b9c0307SBen Skeggs union nvif_outp_lvds_args {
1285b9c0307SBen Skeggs 	struct nvif_outp_lvds_v0 {
1295b9c0307SBen Skeggs 		__u8  version;
1305b9c0307SBen Skeggs 		__u8  dual;
1315b9c0307SBen Skeggs 		__u8  bpc8;
1325b9c0307SBen Skeggs 	} v0;
1335b9c0307SBen Skeggs };
1345b9c0307SBen Skeggs 
1356c6abab2SBen Skeggs union nvif_outp_hdmi_args {
1366c6abab2SBen Skeggs 	struct nvif_outp_hdmi_v0 {
1376c6abab2SBen Skeggs 		__u8 version;
1386c6abab2SBen Skeggs 		__u8 head;
1396c6abab2SBen Skeggs 		__u8 enable;
1406c6abab2SBen Skeggs 		__u8 max_ac_packet;
1416c6abab2SBen Skeggs 		__u8 rekey;
1426c6abab2SBen Skeggs 		__u8 scdc;
1436c6abab2SBen Skeggs 		__u8 scdc_scrambling;
1446c6abab2SBen Skeggs 		__u8 scdc_low_rates;
1456c6abab2SBen Skeggs 		__u32 khz;
1466c6abab2SBen Skeggs 	} v0;
1476c6abab2SBen Skeggs };
1486c6abab2SBen Skeggs 
149f530bc60SBen Skeggs union nvif_outp_infoframe_args {
150f530bc60SBen Skeggs 	struct nvif_outp_infoframe_v0 {
151f530bc60SBen Skeggs 		__u8 version;
152f530bc60SBen Skeggs #define NVIF_OUTP_INFOFRAME_V0_AVI 0
153f530bc60SBen Skeggs #define NVIF_OUTP_INFOFRAME_V0_VSI 1
154f530bc60SBen Skeggs 		__u8 type;
155f530bc60SBen Skeggs 		__u8 head;
156f530bc60SBen Skeggs 		__u8 pad03[5];
157f530bc60SBen Skeggs 		__u8 data[];
158f530bc60SBen Skeggs 	} v0;
159f530bc60SBen Skeggs };
160a9f5d772SBen Skeggs 
161a9f5d772SBen Skeggs union nvif_outp_hda_eld_args {
162a9f5d772SBen Skeggs 	struct nvif_outp_hda_eld_v0 {
163a9f5d772SBen Skeggs 		__u8  version;
164a9f5d772SBen Skeggs 		__u8  head;
165a9f5d772SBen Skeggs 		__u8  pad02[6];
166a9f5d772SBen Skeggs 		__u8  data[];
167a9f5d772SBen Skeggs 	} v0;
168a9f5d772SBen Skeggs };
169a62b7493SBen Skeggs 
170a62b7493SBen Skeggs union nvif_outp_dp_aux_pwr_args {
171a62b7493SBen Skeggs 	struct nvif_outp_dp_aux_pwr_v0 {
172a62b7493SBen Skeggs 		__u8 version;
173a62b7493SBen Skeggs 		__u8 state;
174a62b7493SBen Skeggs 		__u8 pad02[6];
175a62b7493SBen Skeggs 	} v0;
176a62b7493SBen Skeggs };
1778bb30c88SBen Skeggs 
178bd7a61bcSBen Skeggs union nvif_outp_dp_aux_xfer_args {
179bd7a61bcSBen Skeggs 	struct nvif_outp_dp_aux_xfer_v0 {
180bd7a61bcSBen Skeggs 		__u8  version;
181bd7a61bcSBen Skeggs 		__u8  pad01;
182bd7a61bcSBen Skeggs 		__u8  type;
183bd7a61bcSBen Skeggs 		__u8  size;
184bd7a61bcSBen Skeggs 		__u32 addr;
185bd7a61bcSBen Skeggs 		__u8  data[16];
186bd7a61bcSBen Skeggs 	} v0;
187bd7a61bcSBen Skeggs };
188bd7a61bcSBen Skeggs 
189bfb03a07SBen Skeggs union nvif_outp_dp_rates_args {
190bfb03a07SBen Skeggs 	struct nvif_outp_dp_rates_v0 {
191bfb03a07SBen Skeggs 		__u8  version;
192bfb03a07SBen Skeggs 		__u8  pad01[6];
193bfb03a07SBen Skeggs 		__u8  rates;
194bfb03a07SBen Skeggs 		struct {
195bfb03a07SBen Skeggs 			__s8  dpcd;
196bfb03a07SBen Skeggs 			__u32 rate;
197bfb03a07SBen Skeggs 		} rate[8];
198bfb03a07SBen Skeggs 	} v0;
199bfb03a07SBen Skeggs };
200bfb03a07SBen Skeggs 
201*63371650SBen Skeggs union nvif_outp_dp_train_args {
202*63371650SBen Skeggs 	struct nvif_outp_dp_train_v0 {
203*63371650SBen Skeggs 		__u8  version;
204*63371650SBen Skeggs 		__u8  retrain;
205*63371650SBen Skeggs 		__u8  mst;
206*63371650SBen Skeggs 		__u8  lttprs;
207*63371650SBen Skeggs 		__u8  post_lt_adj;
208*63371650SBen Skeggs 		__u8  link_nr;
209*63371650SBen Skeggs 		__u32 link_bw;
210*63371650SBen Skeggs 		__u8 dpcd[DP_RECEIVER_CAP_SIZE];
211*63371650SBen Skeggs 	} v0;
2128bb30c88SBen Skeggs };
2138c7d980dSBen Skeggs 
2148c7d980dSBen Skeggs union nvif_outp_dp_mst_vcpi_args {
2158c7d980dSBen Skeggs 	struct nvif_outp_dp_mst_vcpi_v0 {
2168c7d980dSBen Skeggs 		__u8  version;
2178c7d980dSBen Skeggs 		__u8  head;
2188c7d980dSBen Skeggs 		__u8  start_slot;
2198c7d980dSBen Skeggs 		__u8  num_slots;
2208c7d980dSBen Skeggs 		__u16 pbn;
2218c7d980dSBen Skeggs 		__u16 aligned_pbn;
2228c7d980dSBen Skeggs 	} v0;
2238c7d980dSBen Skeggs };
2241b255f1cSBen Skeggs #endif
225