xref: /linux/drivers/gpu/drm/nouveau/include/nvif/if0012.h (revision 5b9c0307a103bde953b47b4ec86ca5f0a01ce516)
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 
27*5b9c0307SBen Skeggs #define NVIF_OUTP_V0_LVDS          0x40
28*5b9c0307SBen 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
3521636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_RETRAIN    0x73
3621636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_MST_VCPI   0x78
37dfc4005fSBen Skeggs 
38a69eeb37SBen Skeggs union nvif_outp_detect_args {
39a69eeb37SBen Skeggs 	struct nvif_outp_detect_v0 {
40a69eeb37SBen Skeggs 		__u8 version;
41a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_NOT_PRESENT 0x00
42a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_PRESENT     0x01
43a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_UNKNOWN     0x02
44a69eeb37SBen Skeggs 		__u8 status;
45a69eeb37SBen Skeggs 	} v0;
46a69eeb37SBen Skeggs };
47a69eeb37SBen Skeggs 
480cd7e071SBen Skeggs union nvif_outp_edid_get_args {
490cd7e071SBen Skeggs 	struct nvif_outp_edid_get_v0 {
500cd7e071SBen Skeggs 		__u8  version;
510cd7e071SBen Skeggs 		__u8  pad01;
520cd7e071SBen Skeggs 		__u16 size;
530cd7e071SBen Skeggs 		__u8  data[2048];
540cd7e071SBen Skeggs 	} v0;
550cd7e071SBen Skeggs };
560cd7e071SBen Skeggs 
57dfc4005fSBen Skeggs union nvif_outp_load_detect_args {
58dfc4005fSBen Skeggs 	struct nvif_outp_load_detect_v0 {
59dfc4005fSBen Skeggs 		__u8  version;
60dfc4005fSBen Skeggs 		__u8  load;
61dfc4005fSBen Skeggs 		__u8  pad02[2];
62dfc4005fSBen Skeggs 		__u32 data; /*TODO: move vbios loadval parsing into nvkm */
63dfc4005fSBen Skeggs 	} v0;
64dfc4005fSBen Skeggs };
65ea6143a8SBen Skeggs 
66ea6143a8SBen Skeggs union nvif_outp_acquire_args {
67ea6143a8SBen Skeggs 	struct nvif_outp_acquire_v0 {
68ea6143a8SBen Skeggs 		__u8 version;
69724e0f3bSBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_DAC  0x00
70cefc3c14SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_SOR  0x01
71cefc3c14SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_PIOR 0x02
72ea6143a8SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_DP      0x04
73724e0f3bSBen Skeggs 		__u8 type;
74ea6143a8SBen Skeggs 		__u8 or;
75ea6143a8SBen Skeggs 		__u8 link;
76ea6143a8SBen Skeggs 		__u8 pad04[4];
77ea6143a8SBen Skeggs 		union {
78ea6143a8SBen Skeggs 			struct {
79cefc3c14SBen Skeggs 				__u8 hda;
80cefc3c14SBen Skeggs 			} sor;
81cefc3c14SBen Skeggs 			struct {
8281344372SBen Skeggs 				__u8 link_nr; /* 0 = highest possible. */
8381344372SBen Skeggs 				__u8 link_bw; /* 0 = highest possible, DP BW code otherwise. */
84ea6143a8SBen Skeggs 				__u8 hda;
8581344372SBen Skeggs 				__u8 mst;
8681344372SBen Skeggs 				__u8 pad04[4];
8725feda6fSKees Cook 				__u8 dpcd[DP_RECEIVER_CAP_SIZE];
88ea6143a8SBen Skeggs 			} dp;
89ea6143a8SBen Skeggs 		};
90ea6143a8SBen Skeggs 	} v0;
91ea6143a8SBen Skeggs };
92ea6143a8SBen Skeggs 
931b477f42SLyude Paul union nvif_outp_inherit_args {
941b477f42SLyude Paul 	struct nvif_outp_inherit_v0 {
951b477f42SLyude Paul 		__u8 version;
961b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_RGB_CRT 0x00
971b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_TV      0x01
981b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_TMDS    0x02
991b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_LVDS    0x03
1001b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_DP      0x04
1011b477f42SLyude Paul 		// In/out. Input is one of the above values, output is the actual hw protocol
1021b477f42SLyude Paul 		__u8 proto;
1031b477f42SLyude Paul 		__u8 or;
1041b477f42SLyude Paul 		__u8 link;
1051b477f42SLyude Paul 		__u8 head;
1061b477f42SLyude Paul 		union {
1071b477f42SLyude Paul 			struct {
1081b477f42SLyude Paul 				// TODO: Figure out padding, and whether we even want this field
1091b477f42SLyude Paul 				__u8 hda;
1101b477f42SLyude Paul 			} tmds;
1111b477f42SLyude Paul 		};
1121b477f42SLyude Paul 	} v0;
1131b477f42SLyude Paul };
1141b477f42SLyude Paul 
115ea6143a8SBen Skeggs union nvif_outp_release_args {
116ea6143a8SBen Skeggs 	struct nvif_outp_release_vn {
117ea6143a8SBen Skeggs 	} vn;
118ea6143a8SBen Skeggs };
119f530bc60SBen Skeggs 
1202274ce7eSBen Skeggs union nvif_outp_bl_get_args {
1212274ce7eSBen Skeggs 	struct nvif_outp_bl_get_v0 {
1222274ce7eSBen Skeggs 		__u8  version;
1232274ce7eSBen Skeggs 		__u8  level;
1242274ce7eSBen Skeggs 	} v0;
1252274ce7eSBen Skeggs };
1262274ce7eSBen Skeggs 
1272274ce7eSBen Skeggs union nvif_outp_bl_set_args {
1282274ce7eSBen Skeggs 	struct nvif_outp_bl_set_v0 {
1292274ce7eSBen Skeggs 		__u8  version;
1302274ce7eSBen Skeggs 		__u8  level;
1312274ce7eSBen Skeggs 	} v0;
1322274ce7eSBen Skeggs };
1332274ce7eSBen Skeggs 
134*5b9c0307SBen Skeggs union nvif_outp_lvds_args {
135*5b9c0307SBen Skeggs 	struct nvif_outp_lvds_v0 {
136*5b9c0307SBen Skeggs 		__u8  version;
137*5b9c0307SBen Skeggs 		__u8  dual;
138*5b9c0307SBen Skeggs 		__u8  bpc8;
139*5b9c0307SBen Skeggs 	} v0;
140*5b9c0307SBen Skeggs };
141*5b9c0307SBen Skeggs 
1426c6abab2SBen Skeggs union nvif_outp_hdmi_args {
1436c6abab2SBen Skeggs 	struct nvif_outp_hdmi_v0 {
1446c6abab2SBen Skeggs 		__u8 version;
1456c6abab2SBen Skeggs 		__u8 head;
1466c6abab2SBen Skeggs 		__u8 enable;
1476c6abab2SBen Skeggs 		__u8 max_ac_packet;
1486c6abab2SBen Skeggs 		__u8 rekey;
1496c6abab2SBen Skeggs 		__u8 scdc;
1506c6abab2SBen Skeggs 		__u8 scdc_scrambling;
1516c6abab2SBen Skeggs 		__u8 scdc_low_rates;
1526c6abab2SBen Skeggs 		__u32 khz;
1536c6abab2SBen Skeggs 	} v0;
1546c6abab2SBen Skeggs };
1556c6abab2SBen Skeggs 
156f530bc60SBen Skeggs union nvif_outp_infoframe_args {
157f530bc60SBen Skeggs 	struct nvif_outp_infoframe_v0 {
158f530bc60SBen Skeggs 		__u8 version;
159f530bc60SBen Skeggs #define NVIF_OUTP_INFOFRAME_V0_AVI 0
160f530bc60SBen Skeggs #define NVIF_OUTP_INFOFRAME_V0_VSI 1
161f530bc60SBen Skeggs 		__u8 type;
162f530bc60SBen Skeggs 		__u8 head;
163f530bc60SBen Skeggs 		__u8 pad03[5];
164f530bc60SBen Skeggs 		__u8 data[];
165f530bc60SBen Skeggs 	} v0;
166f530bc60SBen Skeggs };
167a9f5d772SBen Skeggs 
168a9f5d772SBen Skeggs union nvif_outp_hda_eld_args {
169a9f5d772SBen Skeggs 	struct nvif_outp_hda_eld_v0 {
170a9f5d772SBen Skeggs 		__u8  version;
171a9f5d772SBen Skeggs 		__u8  head;
172a9f5d772SBen Skeggs 		__u8  pad02[6];
173a9f5d772SBen Skeggs 		__u8  data[];
174a9f5d772SBen Skeggs 	} v0;
175a9f5d772SBen Skeggs };
176a62b7493SBen Skeggs 
177a62b7493SBen Skeggs union nvif_outp_dp_aux_pwr_args {
178a62b7493SBen Skeggs 	struct nvif_outp_dp_aux_pwr_v0 {
179a62b7493SBen Skeggs 		__u8 version;
180a62b7493SBen Skeggs 		__u8 state;
181a62b7493SBen Skeggs 		__u8 pad02[6];
182a62b7493SBen Skeggs 	} v0;
183a62b7493SBen Skeggs };
1848bb30c88SBen Skeggs 
1858bb30c88SBen Skeggs union nvif_outp_dp_retrain_args {
1868bb30c88SBen Skeggs 	struct nvif_outp_dp_retrain_vn {
1878bb30c88SBen Skeggs 	} vn;
1888bb30c88SBen Skeggs };
1898c7d980dSBen Skeggs 
1908c7d980dSBen Skeggs union nvif_outp_dp_mst_vcpi_args {
1918c7d980dSBen Skeggs 	struct nvif_outp_dp_mst_vcpi_v0 {
1928c7d980dSBen Skeggs 		__u8  version;
1938c7d980dSBen Skeggs 		__u8  head;
1948c7d980dSBen Skeggs 		__u8  start_slot;
1958c7d980dSBen Skeggs 		__u8  num_slots;
1968c7d980dSBen Skeggs 		__u16 pbn;
1978c7d980dSBen Skeggs 		__u16 aligned_pbn;
1988c7d980dSBen Skeggs 	} v0;
1998c7d980dSBen Skeggs };
2001b255f1cSBen Skeggs #endif
201