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. */ 11*0a4410a7SBen Skeggs #define NVIF_OUTP_V0_TYPE_DAC 0x00 12*0a4410a7SBen Skeggs #define NVIF_OUTP_V0_TYPE_SOR 0x01 13*0a4410a7SBen Skeggs #define NVIF_OUTP_V0_TYPE_PIOR 0x02 14*0a4410a7SBen Skeggs __u8 type; 15*0a4410a7SBen Skeggs #define NVIF_OUTP_V0_PROTO_RGB_CRT 0x00 16*0a4410a7SBen Skeggs #define NVIF_OUTP_V0_PROTO_TMDS 0x01 17*0a4410a7SBen Skeggs #define NVIF_OUTP_V0_PROTO_LVDS 0x02 18*0a4410a7SBen Skeggs #define NVIF_OUTP_V0_PROTO_DP 0x03 19*0a4410a7SBen Skeggs __u8 proto; 20*0a4410a7SBen Skeggs __u8 heads; 21*0a4410a7SBen Skeggs __u8 ddc; 22*0a4410a7SBen Skeggs __u8 conn; 23*0a4410a7SBen Skeggs union { 24*0a4410a7SBen Skeggs struct { 25*0a4410a7SBen Skeggs __u32 freq_max; 26*0a4410a7SBen Skeggs } rgb_crt; 27*0a4410a7SBen Skeggs struct { 28*0a4410a7SBen Skeggs __u8 dual; 29*0a4410a7SBen Skeggs } tmds; 30*0a4410a7SBen Skeggs struct { 31*0a4410a7SBen Skeggs __u8 acpi_edid; 32*0a4410a7SBen Skeggs } lvds; 33*0a4410a7SBen Skeggs struct { 34*0a4410a7SBen Skeggs __u8 aux; 35*0a4410a7SBen Skeggs __u8 mst; 36*0a4410a7SBen Skeggs __u8 increased_wm; 37*0a4410a7SBen Skeggs __u8 link_nr; 38*0a4410a7SBen Skeggs __u32 link_bw; 39*0a4410a7SBen Skeggs } dp; 40*0a4410a7SBen Skeggs }; 411b255f1cSBen Skeggs } v0; 421b255f1cSBen Skeggs }; 43dfc4005fSBen Skeggs 44a69eeb37SBen Skeggs #define NVIF_OUTP_V0_DETECT 0x00 450cd7e071SBen Skeggs #define NVIF_OUTP_V0_EDID_GET 0x01 46a69eeb37SBen Skeggs 471b477f42SLyude Paul #define NVIF_OUTP_V0_INHERIT 0x10 4821636b1aSBen Skeggs #define NVIF_OUTP_V0_ACQUIRE 0x11 4921636b1aSBen Skeggs #define NVIF_OUTP_V0_RELEASE 0x12 5021636b1aSBen Skeggs 5121636b1aSBen Skeggs #define NVIF_OUTP_V0_LOAD_DETECT 0x20 5221636b1aSBen Skeggs 532274ce7eSBen Skeggs #define NVIF_OUTP_V0_BL_GET 0x30 542274ce7eSBen Skeggs #define NVIF_OUTP_V0_BL_SET 0x31 552274ce7eSBen Skeggs 565b9c0307SBen Skeggs #define NVIF_OUTP_V0_LVDS 0x40 575b9c0307SBen Skeggs 586c6abab2SBen Skeggs #define NVIF_OUTP_V0_HDMI 0x50 596c6abab2SBen Skeggs 6021636b1aSBen Skeggs #define NVIF_OUTP_V0_INFOFRAME 0x60 6121636b1aSBen Skeggs #define NVIF_OUTP_V0_HDA_ELD 0x61 6221636b1aSBen Skeggs 6321636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_AUX_PWR 0x70 64bd7a61bcSBen Skeggs #define NVIF_OUTP_V0_DP_AUX_XFER 0x71 65bfb03a07SBen Skeggs #define NVIF_OUTP_V0_DP_RATES 0x72 6663371650SBen Skeggs #define NVIF_OUTP_V0_DP_TRAIN 0x73 673147ce0dSBen Skeggs #define NVIF_OUTP_V0_DP_DRIVE 0x74 68e206cae1SBen Skeggs #define NVIF_OUTP_V0_DP_SST 0x75 691958d69fSBen Skeggs #define NVIF_OUTP_V0_DP_MST_ID_GET 0x76 701958d69fSBen Skeggs #define NVIF_OUTP_V0_DP_MST_ID_PUT 0x77 7121636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_MST_VCPI 0x78 72dfc4005fSBen Skeggs 73a69eeb37SBen Skeggs union nvif_outp_detect_args { 74a69eeb37SBen Skeggs struct nvif_outp_detect_v0 { 75a69eeb37SBen Skeggs __u8 version; 76a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_NOT_PRESENT 0x00 77a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_PRESENT 0x01 78a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_UNKNOWN 0x02 79a69eeb37SBen Skeggs __u8 status; 80a69eeb37SBen Skeggs } v0; 81a69eeb37SBen Skeggs }; 82a69eeb37SBen Skeggs 830cd7e071SBen Skeggs union nvif_outp_edid_get_args { 840cd7e071SBen Skeggs struct nvif_outp_edid_get_v0 { 850cd7e071SBen Skeggs __u8 version; 860cd7e071SBen Skeggs __u8 pad01; 870cd7e071SBen Skeggs __u16 size; 880cd7e071SBen Skeggs __u8 data[2048]; 890cd7e071SBen Skeggs } v0; 900cd7e071SBen Skeggs }; 910cd7e071SBen Skeggs 92dfc4005fSBen Skeggs union nvif_outp_load_detect_args { 93dfc4005fSBen Skeggs struct nvif_outp_load_detect_v0 { 94dfc4005fSBen Skeggs __u8 version; 95dfc4005fSBen Skeggs __u8 load; 96dfc4005fSBen Skeggs __u8 pad02[2]; 97dfc4005fSBen Skeggs __u32 data; /*TODO: move vbios loadval parsing into nvkm */ 98dfc4005fSBen Skeggs } v0; 99dfc4005fSBen Skeggs }; 100ea6143a8SBen Skeggs 101ea6143a8SBen Skeggs union nvif_outp_acquire_args { 102ea6143a8SBen Skeggs struct nvif_outp_acquire_v0 { 103ea6143a8SBen Skeggs __u8 version; 104724e0f3bSBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_DAC 0x00 105cefc3c14SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_SOR 0x01 106cefc3c14SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_PIOR 0x02 107724e0f3bSBen Skeggs __u8 type; 108ea6143a8SBen Skeggs __u8 or; 109ea6143a8SBen Skeggs __u8 link; 110ea6143a8SBen Skeggs __u8 pad04[4]; 111ea6143a8SBen Skeggs union { 112ea6143a8SBen Skeggs struct { 113cefc3c14SBen Skeggs __u8 hda; 114cefc3c14SBen Skeggs } sor; 115ea6143a8SBen Skeggs }; 116ea6143a8SBen Skeggs } v0; 117ea6143a8SBen Skeggs }; 118ea6143a8SBen Skeggs 1191b477f42SLyude Paul union nvif_outp_inherit_args { 1201b477f42SLyude Paul struct nvif_outp_inherit_v0 { 1211b477f42SLyude Paul __u8 version; 1221b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_RGB_CRT 0x00 1231b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_TV 0x01 1241b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_TMDS 0x02 1251b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_LVDS 0x03 1261b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_DP 0x04 1271b477f42SLyude Paul // In/out. Input is one of the above values, output is the actual hw protocol 1281b477f42SLyude Paul __u8 proto; 1291b477f42SLyude Paul __u8 or; 1301b477f42SLyude Paul __u8 link; 1311b477f42SLyude Paul __u8 head; 1321b477f42SLyude Paul union { 1331b477f42SLyude Paul struct { 1341b477f42SLyude Paul // TODO: Figure out padding, and whether we even want this field 1351b477f42SLyude Paul __u8 hda; 1361b477f42SLyude Paul } tmds; 1371b477f42SLyude Paul }; 1381b477f42SLyude Paul } v0; 1391b477f42SLyude Paul }; 1401b477f42SLyude Paul 141ea6143a8SBen Skeggs union nvif_outp_release_args { 142ea6143a8SBen Skeggs struct nvif_outp_release_vn { 143ea6143a8SBen Skeggs } vn; 144ea6143a8SBen Skeggs }; 145f530bc60SBen Skeggs 1462274ce7eSBen Skeggs union nvif_outp_bl_get_args { 1472274ce7eSBen Skeggs struct nvif_outp_bl_get_v0 { 1482274ce7eSBen Skeggs __u8 version; 1492274ce7eSBen Skeggs __u8 level; 1502274ce7eSBen Skeggs } v0; 1512274ce7eSBen Skeggs }; 1522274ce7eSBen Skeggs 1532274ce7eSBen Skeggs union nvif_outp_bl_set_args { 1542274ce7eSBen Skeggs struct nvif_outp_bl_set_v0 { 1552274ce7eSBen Skeggs __u8 version; 1562274ce7eSBen Skeggs __u8 level; 1572274ce7eSBen Skeggs } v0; 1582274ce7eSBen Skeggs }; 1592274ce7eSBen Skeggs 1605b9c0307SBen Skeggs union nvif_outp_lvds_args { 1615b9c0307SBen Skeggs struct nvif_outp_lvds_v0 { 1625b9c0307SBen Skeggs __u8 version; 1635b9c0307SBen Skeggs __u8 dual; 1645b9c0307SBen Skeggs __u8 bpc8; 1655b9c0307SBen Skeggs } v0; 1665b9c0307SBen Skeggs }; 1675b9c0307SBen Skeggs 1686c6abab2SBen Skeggs union nvif_outp_hdmi_args { 1696c6abab2SBen Skeggs struct nvif_outp_hdmi_v0 { 1706c6abab2SBen Skeggs __u8 version; 1716c6abab2SBen Skeggs __u8 head; 1726c6abab2SBen Skeggs __u8 enable; 1736c6abab2SBen Skeggs __u8 max_ac_packet; 1746c6abab2SBen Skeggs __u8 rekey; 1756c6abab2SBen Skeggs __u8 scdc; 1766c6abab2SBen Skeggs __u8 scdc_scrambling; 1776c6abab2SBen Skeggs __u8 scdc_low_rates; 1786c6abab2SBen Skeggs __u32 khz; 1796c6abab2SBen Skeggs } v0; 1806c6abab2SBen Skeggs }; 1816c6abab2SBen Skeggs 182f530bc60SBen Skeggs union nvif_outp_infoframe_args { 183f530bc60SBen Skeggs struct nvif_outp_infoframe_v0 { 184f530bc60SBen Skeggs __u8 version; 185f530bc60SBen Skeggs #define NVIF_OUTP_INFOFRAME_V0_AVI 0 186f530bc60SBen Skeggs #define NVIF_OUTP_INFOFRAME_V0_VSI 1 187f530bc60SBen Skeggs __u8 type; 188f530bc60SBen Skeggs __u8 head; 189f530bc60SBen Skeggs __u8 pad03[5]; 190f530bc60SBen Skeggs __u8 data[]; 191f530bc60SBen Skeggs } v0; 192f530bc60SBen Skeggs }; 193a9f5d772SBen Skeggs 194a9f5d772SBen Skeggs union nvif_outp_hda_eld_args { 195a9f5d772SBen Skeggs struct nvif_outp_hda_eld_v0 { 196a9f5d772SBen Skeggs __u8 version; 197a9f5d772SBen Skeggs __u8 head; 198a9f5d772SBen Skeggs __u8 pad02[6]; 199a9f5d772SBen Skeggs __u8 data[]; 200a9f5d772SBen Skeggs } v0; 201a9f5d772SBen Skeggs }; 202a62b7493SBen Skeggs 203a62b7493SBen Skeggs union nvif_outp_dp_aux_pwr_args { 204a62b7493SBen Skeggs struct nvif_outp_dp_aux_pwr_v0 { 205a62b7493SBen Skeggs __u8 version; 206a62b7493SBen Skeggs __u8 state; 207a62b7493SBen Skeggs __u8 pad02[6]; 208a62b7493SBen Skeggs } v0; 209a62b7493SBen Skeggs }; 2108bb30c88SBen Skeggs 211bd7a61bcSBen Skeggs union nvif_outp_dp_aux_xfer_args { 212bd7a61bcSBen Skeggs struct nvif_outp_dp_aux_xfer_v0 { 213bd7a61bcSBen Skeggs __u8 version; 214bd7a61bcSBen Skeggs __u8 pad01; 215bd7a61bcSBen Skeggs __u8 type; 216bd7a61bcSBen Skeggs __u8 size; 217bd7a61bcSBen Skeggs __u32 addr; 218bd7a61bcSBen Skeggs __u8 data[16]; 219bd7a61bcSBen Skeggs } v0; 220bd7a61bcSBen Skeggs }; 221bd7a61bcSBen Skeggs 222bfb03a07SBen Skeggs union nvif_outp_dp_rates_args { 223bfb03a07SBen Skeggs struct nvif_outp_dp_rates_v0 { 224bfb03a07SBen Skeggs __u8 version; 225bfb03a07SBen Skeggs __u8 pad01[6]; 226bfb03a07SBen Skeggs __u8 rates; 227bfb03a07SBen Skeggs struct { 228bfb03a07SBen Skeggs __s8 dpcd; 229bfb03a07SBen Skeggs __u32 rate; 230bfb03a07SBen Skeggs } rate[8]; 231bfb03a07SBen Skeggs } v0; 232bfb03a07SBen Skeggs }; 233bfb03a07SBen Skeggs 23463371650SBen Skeggs union nvif_outp_dp_train_args { 23563371650SBen Skeggs struct nvif_outp_dp_train_v0 { 23663371650SBen Skeggs __u8 version; 23763371650SBen Skeggs __u8 retrain; 23863371650SBen Skeggs __u8 mst; 23963371650SBen Skeggs __u8 lttprs; 24063371650SBen Skeggs __u8 post_lt_adj; 24163371650SBen Skeggs __u8 link_nr; 24263371650SBen Skeggs __u32 link_bw; 24363371650SBen Skeggs __u8 dpcd[DP_RECEIVER_CAP_SIZE]; 24463371650SBen Skeggs } v0; 2458bb30c88SBen Skeggs }; 2468c7d980dSBen Skeggs 2473147ce0dSBen Skeggs union nvif_outp_dp_drive_args { 2483147ce0dSBen Skeggs struct nvif_outp_dp_drive_v0 { 2493147ce0dSBen Skeggs __u8 version; 2503147ce0dSBen Skeggs __u8 pad01[2]; 2513147ce0dSBen Skeggs __u8 lanes; 2523147ce0dSBen Skeggs __u8 pe[4]; 2533147ce0dSBen Skeggs __u8 vs[4]; 2543147ce0dSBen Skeggs } v0; 2553147ce0dSBen Skeggs }; 2563147ce0dSBen Skeggs 257e206cae1SBen Skeggs union nvif_outp_dp_sst_args { 258e206cae1SBen Skeggs struct nvif_outp_dp_sst_v0 { 259e206cae1SBen Skeggs __u8 version; 260e206cae1SBen Skeggs __u8 head; 261e206cae1SBen Skeggs __u8 pad02[2]; 262e206cae1SBen Skeggs __u32 watermark; 263e206cae1SBen Skeggs __u32 hblanksym; 264e206cae1SBen Skeggs __u32 vblanksym; 265e206cae1SBen Skeggs } v0; 266e206cae1SBen Skeggs }; 267e206cae1SBen Skeggs 2681958d69fSBen Skeggs union nvif_outp_dp_mst_id_put_args { 2691958d69fSBen Skeggs struct nvif_outp_dp_mst_id_put_v0 { 2701958d69fSBen Skeggs __u8 version; 2711958d69fSBen Skeggs __u8 pad01[3]; 2721958d69fSBen Skeggs __u32 id; 2731958d69fSBen Skeggs } v0; 2741958d69fSBen Skeggs }; 2751958d69fSBen Skeggs 2761958d69fSBen Skeggs union nvif_outp_dp_mst_id_get_args { 2771958d69fSBen Skeggs struct nvif_outp_dp_mst_id_get_v0 { 2781958d69fSBen Skeggs __u8 version; 2791958d69fSBen Skeggs __u8 pad01[3]; 2801958d69fSBen Skeggs __u32 id; 2811958d69fSBen Skeggs } v0; 2821958d69fSBen Skeggs }; 2831958d69fSBen Skeggs 2848c7d980dSBen Skeggs union nvif_outp_dp_mst_vcpi_args { 2858c7d980dSBen Skeggs struct nvif_outp_dp_mst_vcpi_v0 { 2868c7d980dSBen Skeggs __u8 version; 2878c7d980dSBen Skeggs __u8 head; 2888c7d980dSBen Skeggs __u8 start_slot; 2898c7d980dSBen Skeggs __u8 num_slots; 2908c7d980dSBen Skeggs __u16 pbn; 2918c7d980dSBen Skeggs __u16 aligned_pbn; 2928c7d980dSBen Skeggs } v0; 2938c7d980dSBen Skeggs }; 2941b255f1cSBen Skeggs #endif 295