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 24*2274ce7eSBen Skeggs #define NVIF_OUTP_V0_BL_GET 0x30 25*2274ce7eSBen Skeggs #define NVIF_OUTP_V0_BL_SET 0x31 26*2274ce7eSBen Skeggs 276c6abab2SBen Skeggs #define NVIF_OUTP_V0_HDMI 0x50 286c6abab2SBen Skeggs 2921636b1aSBen Skeggs #define NVIF_OUTP_V0_INFOFRAME 0x60 3021636b1aSBen Skeggs #define NVIF_OUTP_V0_HDA_ELD 0x61 3121636b1aSBen Skeggs 3221636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_AUX_PWR 0x70 3321636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_RETRAIN 0x73 3421636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_MST_VCPI 0x78 35dfc4005fSBen Skeggs 36a69eeb37SBen Skeggs union nvif_outp_detect_args { 37a69eeb37SBen Skeggs struct nvif_outp_detect_v0 { 38a69eeb37SBen Skeggs __u8 version; 39a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_NOT_PRESENT 0x00 40a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_PRESENT 0x01 41a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_UNKNOWN 0x02 42a69eeb37SBen Skeggs __u8 status; 43a69eeb37SBen Skeggs } v0; 44a69eeb37SBen Skeggs }; 45a69eeb37SBen Skeggs 460cd7e071SBen Skeggs union nvif_outp_edid_get_args { 470cd7e071SBen Skeggs struct nvif_outp_edid_get_v0 { 480cd7e071SBen Skeggs __u8 version; 490cd7e071SBen Skeggs __u8 pad01; 500cd7e071SBen Skeggs __u16 size; 510cd7e071SBen Skeggs __u8 data[2048]; 520cd7e071SBen Skeggs } v0; 530cd7e071SBen Skeggs }; 540cd7e071SBen Skeggs 55dfc4005fSBen Skeggs union nvif_outp_load_detect_args { 56dfc4005fSBen Skeggs struct nvif_outp_load_detect_v0 { 57dfc4005fSBen Skeggs __u8 version; 58dfc4005fSBen Skeggs __u8 load; 59dfc4005fSBen Skeggs __u8 pad02[2]; 60dfc4005fSBen Skeggs __u32 data; /*TODO: move vbios loadval parsing into nvkm */ 61dfc4005fSBen Skeggs } v0; 62dfc4005fSBen Skeggs }; 63ea6143a8SBen Skeggs 64ea6143a8SBen Skeggs union nvif_outp_acquire_args { 65ea6143a8SBen Skeggs struct nvif_outp_acquire_v0 { 66ea6143a8SBen Skeggs __u8 version; 67724e0f3bSBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_DAC 0x00 68cefc3c14SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_SOR 0x01 69cefc3c14SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_PIOR 0x02 70ea6143a8SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_LVDS 0x03 71ea6143a8SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_DP 0x04 72724e0f3bSBen Skeggs __u8 type; 73ea6143a8SBen Skeggs __u8 or; 74ea6143a8SBen Skeggs __u8 link; 75ea6143a8SBen Skeggs __u8 pad04[4]; 76ea6143a8SBen Skeggs union { 77ea6143a8SBen Skeggs struct { 78cefc3c14SBen Skeggs __u8 hda; 79cefc3c14SBen Skeggs } sor; 80cefc3c14SBen Skeggs struct { 819793083fSBen Skeggs __u8 dual; 829793083fSBen Skeggs __u8 bpc8; 839793083fSBen Skeggs __u8 pad02[6]; 849793083fSBen Skeggs } lvds; 859793083fSBen Skeggs struct { 8681344372SBen Skeggs __u8 link_nr; /* 0 = highest possible. */ 8781344372SBen Skeggs __u8 link_bw; /* 0 = highest possible, DP BW code otherwise. */ 88ea6143a8SBen Skeggs __u8 hda; 8981344372SBen Skeggs __u8 mst; 9081344372SBen Skeggs __u8 pad04[4]; 9125feda6fSKees Cook __u8 dpcd[DP_RECEIVER_CAP_SIZE]; 92ea6143a8SBen Skeggs } dp; 93ea6143a8SBen Skeggs }; 94ea6143a8SBen Skeggs } v0; 95ea6143a8SBen Skeggs }; 96ea6143a8SBen Skeggs 971b477f42SLyude Paul union nvif_outp_inherit_args { 981b477f42SLyude Paul struct nvif_outp_inherit_v0 { 991b477f42SLyude Paul __u8 version; 1001b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_RGB_CRT 0x00 1011b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_TV 0x01 1021b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_TMDS 0x02 1031b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_LVDS 0x03 1041b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_DP 0x04 1051b477f42SLyude Paul // In/out. Input is one of the above values, output is the actual hw protocol 1061b477f42SLyude Paul __u8 proto; 1071b477f42SLyude Paul __u8 or; 1081b477f42SLyude Paul __u8 link; 1091b477f42SLyude Paul __u8 head; 1101b477f42SLyude Paul union { 1111b477f42SLyude Paul struct { 1121b477f42SLyude Paul // TODO: Figure out padding, and whether we even want this field 1131b477f42SLyude Paul __u8 hda; 1141b477f42SLyude Paul } tmds; 1151b477f42SLyude Paul }; 1161b477f42SLyude Paul } v0; 1171b477f42SLyude Paul }; 1181b477f42SLyude Paul 119ea6143a8SBen Skeggs union nvif_outp_release_args { 120ea6143a8SBen Skeggs struct nvif_outp_release_vn { 121ea6143a8SBen Skeggs } vn; 122ea6143a8SBen Skeggs }; 123f530bc60SBen Skeggs 124*2274ce7eSBen Skeggs union nvif_outp_bl_get_args { 125*2274ce7eSBen Skeggs struct nvif_outp_bl_get_v0 { 126*2274ce7eSBen Skeggs __u8 version; 127*2274ce7eSBen Skeggs __u8 level; 128*2274ce7eSBen Skeggs } v0; 129*2274ce7eSBen Skeggs }; 130*2274ce7eSBen Skeggs 131*2274ce7eSBen Skeggs union nvif_outp_bl_set_args { 132*2274ce7eSBen Skeggs struct nvif_outp_bl_set_v0 { 133*2274ce7eSBen Skeggs __u8 version; 134*2274ce7eSBen Skeggs __u8 level; 135*2274ce7eSBen Skeggs } v0; 136*2274ce7eSBen Skeggs }; 137*2274ce7eSBen Skeggs 1386c6abab2SBen Skeggs union nvif_outp_hdmi_args { 1396c6abab2SBen Skeggs struct nvif_outp_hdmi_v0 { 1406c6abab2SBen Skeggs __u8 version; 1416c6abab2SBen Skeggs __u8 head; 1426c6abab2SBen Skeggs __u8 enable; 1436c6abab2SBen Skeggs __u8 max_ac_packet; 1446c6abab2SBen Skeggs __u8 rekey; 1456c6abab2SBen Skeggs __u8 scdc; 1466c6abab2SBen Skeggs __u8 scdc_scrambling; 1476c6abab2SBen Skeggs __u8 scdc_low_rates; 1486c6abab2SBen Skeggs __u32 khz; 1496c6abab2SBen Skeggs } v0; 1506c6abab2SBen Skeggs }; 1516c6abab2SBen Skeggs 152f530bc60SBen Skeggs union nvif_outp_infoframe_args { 153f530bc60SBen Skeggs struct nvif_outp_infoframe_v0 { 154f530bc60SBen Skeggs __u8 version; 155f530bc60SBen Skeggs #define NVIF_OUTP_INFOFRAME_V0_AVI 0 156f530bc60SBen Skeggs #define NVIF_OUTP_INFOFRAME_V0_VSI 1 157f530bc60SBen Skeggs __u8 type; 158f530bc60SBen Skeggs __u8 head; 159f530bc60SBen Skeggs __u8 pad03[5]; 160f530bc60SBen Skeggs __u8 data[]; 161f530bc60SBen Skeggs } v0; 162f530bc60SBen Skeggs }; 163a9f5d772SBen Skeggs 164a9f5d772SBen Skeggs union nvif_outp_hda_eld_args { 165a9f5d772SBen Skeggs struct nvif_outp_hda_eld_v0 { 166a9f5d772SBen Skeggs __u8 version; 167a9f5d772SBen Skeggs __u8 head; 168a9f5d772SBen Skeggs __u8 pad02[6]; 169a9f5d772SBen Skeggs __u8 data[]; 170a9f5d772SBen Skeggs } v0; 171a9f5d772SBen Skeggs }; 172a62b7493SBen Skeggs 173a62b7493SBen Skeggs union nvif_outp_dp_aux_pwr_args { 174a62b7493SBen Skeggs struct nvif_outp_dp_aux_pwr_v0 { 175a62b7493SBen Skeggs __u8 version; 176a62b7493SBen Skeggs __u8 state; 177a62b7493SBen Skeggs __u8 pad02[6]; 178a62b7493SBen Skeggs } v0; 179a62b7493SBen Skeggs }; 1808bb30c88SBen Skeggs 1818bb30c88SBen Skeggs union nvif_outp_dp_retrain_args { 1828bb30c88SBen Skeggs struct nvif_outp_dp_retrain_vn { 1838bb30c88SBen Skeggs } vn; 1848bb30c88SBen Skeggs }; 1858c7d980dSBen Skeggs 1868c7d980dSBen Skeggs union nvif_outp_dp_mst_vcpi_args { 1878c7d980dSBen Skeggs struct nvif_outp_dp_mst_vcpi_v0 { 1888c7d980dSBen Skeggs __u8 version; 1898c7d980dSBen Skeggs __u8 head; 1908c7d980dSBen Skeggs __u8 start_slot; 1918c7d980dSBen Skeggs __u8 num_slots; 1928c7d980dSBen Skeggs __u16 pbn; 1938c7d980dSBen Skeggs __u16 aligned_pbn; 1948c7d980dSBen Skeggs } v0; 1958c7d980dSBen Skeggs }; 1961b255f1cSBen Skeggs #endif 197