diff --git a/.github/workflows/pr_master.yml b/.github/workflows/pr_master.yml index b7cd4c7c1..90cd03a89 100644 --- a/.github/workflows/pr_master.yml +++ b/.github/workflows/pr_master.yml @@ -83,6 +83,9 @@ jobs: run: | cargo xtask zip --profile ${{ env.CARGO_PROFILE }} Expand-Archive -Path target/${{ env.CARGO_PROFILE }}/zluda.zip -DestinationPath target/${{ env.CARGO_PROFILE }}/zluda + cargo xtask zip --profile ${{ env.CARGO_PROFILE }} --target=i686-pc-windows-msvc + Expand-Archive -Path target/i686-pc-windows-msvc/${{ env.CARGO_PROFILE }}/zluda.zip -DestinationPath target/${{ env.CARGO_PROFILE }}/zluda/32 + Move-Item -Path target/${{ env.CARGO_PROFILE }}/zluda/32/zluda -Destination target/${{ env.CARGO_PROFILE }}/zluda/zluda/32 - name: Set revision hash run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV - name: Upload @@ -121,7 +124,11 @@ jobs: --exclude cuda_macros \ --exclude ptx_parser_macros \ --exclude zluda_inject \ - --exclude zluda_redirect + --exclude zluda_redirect \ + --exclude zluda32 \ + --exclude zluda64_server \ + --exclude nvapi \ + --exclude nvapi_trace mkdir -p target/amdgpu bash .github/workflows/move_tests.sh target/tests amdgpu strip target/amdgpu/* diff --git a/.github/workflows/push_master.yml b/.github/workflows/push_master.yml index eac12a07f..0eb15d302 100644 --- a/.github/workflows/push_master.yml +++ b/.github/workflows/push_master.yml @@ -81,6 +81,9 @@ jobs: run: | cargo xtask zip --profile ${{ env.CARGO_PROFILE }} Expand-Archive -Path target/${{ env.CARGO_PROFILE }}/zluda.zip -DestinationPath target/${{ env.CARGO_PROFILE }}/zluda + cargo xtask zip --profile ${{ env.CARGO_PROFILE }} --target=i686-pc-windows-msvc + Expand-Archive -Path target/i686-pc-windows-msvc/${{ env.CARGO_PROFILE }}/zluda.zip -DestinationPath target/${{ env.CARGO_PROFILE }}/zluda/32 + Move-Item -Path target/${{ env.CARGO_PROFILE }}/zluda/32/zluda -Destination target/${{ env.CARGO_PROFILE }}/zluda/zluda/32 - name: Set revision hash run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV - name: Upload @@ -138,7 +141,11 @@ jobs: --exclude cuda_macros \ --exclude ptx_parser_macros \ --exclude zluda_inject \ - --exclude zluda_redirect + --exclude zluda_redirect \ + --exclude zluda32 \ + --exclude zluda64_server \ + --exclude nvapi \ + --exclude nvapi_trace mkdir -p target/amdgpu bash .github/workflows/move_tests.sh target/tests amdgpu strip target/amdgpu/* diff --git a/Cargo.lock b/Cargo.lock index a83ce01f1..30af03a85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,7 +84,7 @@ dependencies = [ "argh_shared", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -108,6 +108,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + [[package]] name = "autocfg" version = "1.4.0" @@ -126,7 +132,7 @@ version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "cexpr", "clang-sys", "itertools 0.13.0", @@ -137,7 +143,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -146,7 +152,7 @@ version = "0.71.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "cexpr", "clang-sys", "itertools 0.13.0", @@ -155,9 +161,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash 2.1.1", + "rustc-hash 2.1.2", "shlex", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -174,9 +180,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.1" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" [[package]] name = "blake3" @@ -219,7 +225,7 @@ checksum = "fefb4feeec9a091705938922f26081aad77c64cd2e76cd1c4a9ece8e42e1618a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -259,7 +265,7 @@ checksum = "89385e82b5d1821d2219e0b095efa2cc1f246cbf99080f3be46a1a85c0d392d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -279,7 +285,7 @@ checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -314,7 +320,7 @@ dependencies = [ "gemm", "half", "libm", - "memmap2 0.9.7", + "memmap2", "num-traits", "num_cpus", "rand", @@ -376,6 +382,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "cglue" version = "0.3.5" @@ -453,6 +465,143 @@ dependencies = [ "thiserror 2.0.12", ] +[[package]] +name = "compio" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b84ee96a86948d04388f3a0b8c36b9f0a6b40b3528ac0d65737e53632fb37fe" +dependencies = [ + "compio-buf", + "compio-driver", + "compio-fs", + "compio-io", + "compio-log", + "compio-macros", + "compio-runtime", +] + +[[package]] +name = "compio-buf" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b51a2c35873865376ed4cdb6cfeb602b6cf569815f017ddd7bd8f86ad49b34c7" +dependencies = [ + "arrayvec", + "bytes", + "libc", +] + +[[package]] +name = "compio-driver" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d42d98dc890ee4db00c1e68a723391711aab6d67085880d716b72830f7c715" +dependencies = [ + "cfg-if", + "cfg_aliases", + "compio-buf", + "compio-log", + "crossbeam-queue", + "flume", + "futures-util", + "io-uring", + "io_uring_buf_ring", + "libc", + "once_cell", + "paste", + "pin-project-lite", + "polling", + "slab", + "smallvec", + "socket2", + "synchrony", + "thin-cell", + "windows-sys 0.61.2", +] + +[[package]] +name = "compio-fs" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65ee36e1acf2cec4835efe9a986c012b2462c5ef53580e4ee84ae6d5a3d8e3b3" +dependencies = [ + "cfg-if", + "cfg_aliases", + "compio-buf", + "compio-driver", + "compio-io", + "compio-runtime", + "libc", + "os_pipe", + "pin-project-lite", + "widestring", + "windows-sys 0.61.2", +] + +[[package]] +name = "compio-io" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637522f28a64fd5f7dcceaa4ddef13fa8d8020025e8c993f7a069e237835580e" +dependencies = [ + "compio-buf", + "futures-util", + "paste", + "synchrony", +] + +[[package]] +name = "compio-log" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4e560213c1996b618da369b7c9109564b41af9033802ae534465c4ee4e132f" +dependencies = [ + "tracing", +] + +[[package]] +name = "compio-macros" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05ed201484967dc70de77a8f7a02b29aaa8e6c81cbea2e75492ee0c8d97766b" +dependencies = [ + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "compio-runtime" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6c1c71f011bdd9c8f30e97d877b606505ee6d241c7782cfaed172f66acbd9cd" +dependencies = [ + "async-task", + "compio-buf", + "compio-driver", + "compio-log", + "core_affinity", + "crossbeam-queue", + "futures-util", + "libc", + "once_cell", + "pin-project-lite", + "scoped-tls", + "slab", + "socket2", + "windows-sys 0.61.2", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "console" version = "0.16.1" @@ -481,6 +630,17 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "core_affinity" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a034b3a7b624016c6e13f5df875747cc25f884156aad2abd12b6c46797971342" +dependencies = [ + "libc", + "num_cpus", + "winapi", +] + [[package]] name = "cpufeatures" version = "0.2.17" @@ -518,6 +678,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.21" @@ -559,15 +728,15 @@ version = "0.0.0" dependencies = [ "proc-macro2", "quote", - "rustc-hash 2.1.1", - "syn 2.0.89", + "rustc-hash 2.1.2", + "syn 2.0.117", ] [[package]] name = "cuda_types" version = "0.0.0" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "cuda_macros", "hip_runtime-sys", "hipblaslt-sys", @@ -587,6 +756,7 @@ dependencies = [ "format", "lz4-sys", "paste", + "rkyv", "uuid", "zstd-safe", ] @@ -612,7 +782,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -623,7 +793,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -668,7 +838,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -689,7 +859,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -699,7 +869,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -719,7 +889,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", "unicode-xid", ] @@ -752,7 +922,7 @@ dependencies = [ "dsl_auto_type", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -772,7 +942,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -820,7 +990,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -834,7 +1004,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -876,28 +1046,29 @@ checksum = "e1d926b4d407d372f141f93bb444696142c29d32962ccbd3531117cf3aa0bfa9" [[package]] name = "dynasm" -version = "1.2.3" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" +checksum = "df4bf11ba8aecc00489b7ec4e8963cd3860651c3ea2a114394f8ba7e92a0e94a" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.11.1", "byteorder", "lazy_static", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.117", ] [[package]] name = "dynasmrt" -version = "1.2.3" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" +checksum = "b38e5331d851567729d892ed28d898d22f49a96940b29e23b5c3e681bd30ffb3" dependencies = [ "byteorder", "dynasm", - "memmap2 0.5.10", + "fnv", + "memmap2", ] [[package]] @@ -944,7 +1115,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -1035,6 +1206,15 @@ dependencies = [ "rand_distr", ] +[[package]] +name = "flume" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e139bc46ca777eb5efaf62df0ab8cc5fd400866427e56c68b22e414e53bd3be" +dependencies = [ + "spin", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1070,6 +1250,49 @@ dependencies = [ "uuid", ] +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "slab", +] + [[package]] name = "gemm" version = "0.19.0" @@ -1189,6 +1412,21 @@ dependencies = [ "seq-macro", ] +[[package]] +name = "generator" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f04ae4152da20c76fe800fa48659201d5cf627c5149ca0b707b69d7eef6cf9" +dependencies = [ + "cc", + "cfg-if", + "libc", + "log", + "rustversion", + "windows-link", + "windows-result", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1345,7 +1583,7 @@ dependencies = [ "bstr", "gix-chunk", "gix-hash 0.17.0", - "memmap2 0.9.7", + "memmap2", "thiserror 2.0.12", ] @@ -1376,7 +1614,7 @@ version = "0.14.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8dc2c844c4cf141884678cabef736fd91dd73068b9146e6f004ba1a0457944b6" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "bstr", "gix-path", "libc", @@ -1540,7 +1778,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20972499c03473e773a2099e5fd0c695b9b72465837797a51a43391a1635a030" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "bstr", "gix-features 0.41.1", "gix-path", @@ -1600,7 +1838,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "855bece2d4153453aa5d0a80d51deea1ce8cd6a3b4cf213da85ac344ccb908a7" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "bstr", "filetime", "fnv", @@ -1616,7 +1854,7 @@ dependencies = [ "hashbrown 0.14.5", "itoa", "libc", - "memmap2 0.9.7", + "memmap2", "rustix 0.38.37", "smallvec", "thiserror 2.0.12", @@ -1688,7 +1926,7 @@ dependencies = [ "gix-hashtable", "gix-object", "gix-path", - "memmap2 0.9.7", + "memmap2", "smallvec", "thiserror 2.0.12", ] @@ -1737,7 +1975,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fef8422c3c9066d649074b24025125963f85232bfad32d6d16aea9453b82ec14" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "bstr", "gix-attributes", "gix-config-value", @@ -1792,7 +2030,7 @@ dependencies = [ "gix-tempfile", "gix-utils 0.2.0", "gix-validate 0.9.4", - "memmap2 0.9.7", + "memmap2", "thiserror 2.0.12", "winnow 0.7.10", ] @@ -1817,7 +2055,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "342caa4e158df3020cadf62f656307c3948fe4eacfdf67171d7212811860c3e9" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "bstr", "gix-commitgraph", "gix-date", @@ -1850,7 +2088,7 @@ version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47aeb0f13de9ef2f3033f5ff218de30f44db827ac9f1286f9ef050aacddd5888" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "gix-path", "libc", "windows-sys 0.52.0", @@ -1950,7 +2188,7 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36c0b049f8bdb61b20016694102f7b507f2e1727e83e9c5e6dad4f7d84ff7384" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "gix-commitgraph", "gix-date", "gix-hash 0.17.0", @@ -2323,10 +2561,32 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.89", + "syn 2.0.117", "version_check", ] +[[package]] +name = "io-uring" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9080b15e63775b9a2ac7dca720f7050a8b955e092ea0f6020a4a80f69998cdc0" +dependencies = [ + "bitflags 2.11.1", + "cfg-if", + "libc", +] + +[[package]] +name = "io_uring_buf_ring" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1838759bb8c2f24cf05a35429d83145c4aa6af43f8ad38477295e12a7320a80e" +dependencies = [ + "bytes", + "io-uring", + "rustix 1.1.4", +] + [[package]] name = "is-terminal" version = "0.4.17" @@ -2444,9 +2704,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.174" +version = "0.2.184" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" [[package]] name = "libloading" @@ -2470,7 +2730,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "libc", "redox_syscall", ] @@ -2503,9 +2763,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" @@ -2581,7 +2841,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -2593,6 +2853,20 @@ dependencies = [ "logos-codegen", ] +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "pin-utils", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lz4-sys" version = "1.11.1+lz4-1.10.0" @@ -2603,6 +2877,15 @@ dependencies = [ "libc", ] +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + [[package]] name = "maybe-async" version = "0.2.10" @@ -2611,7 +2894,7 @@ checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -2622,18 +2905,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - -[[package]] -name = "memmap2" -version = "0.9.7" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "483758ad303d734cec05e5c12b41d7e93e6a6390c5e9dae6bdeb7c1259012d28" +checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3" dependencies = [ "libc", "stable_deref_trait", @@ -2699,7 +2973,7 @@ checksum = "4568f25ccbd45ab5d5603dc34318c1ec56b117531781260002151b8530a9f931" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -2718,6 +2992,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "num" version = "0.4.3" @@ -2828,6 +3111,40 @@ dependencies = [ "libc", ] +[[package]] +name = "nvapi" +version = "0.0.0" +dependencies = [ + "cglue", + "cuda_macros", + "cuda_types", + "dark_api", + "format", + "libloading", + "paste", + "rustc-hash 2.1.2", + "unwrap_or", + "zluda_trace_common", +] + +[[package]] +name = "nvapi_trace" +version = "0.0.0" +dependencies = [ + "cglue", + "cuda_macros", + "cuda_types", + "dark_api", + "dynasm", + "dynasmrt", + "format", + "libloading", + "paste", + "rustc-hash 2.1.2", + "unwrap_or", + "zluda_trace_common", +] + [[package]] name = "object" version = "0.38.1" @@ -2854,6 +3171,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "os_pipe" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + [[package]] name = "owo-colors" version = "4.2.3" @@ -2915,6 +3242,18 @@ dependencies = [ "indexmap", ] +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkg-config" version = "0.3.32" @@ -2927,6 +3266,20 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix 1.1.4", + "windows-sys 0.61.2", +] + [[package]] name = "portable-atomic" version = "1.11.1" @@ -2983,7 +3336,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -3005,34 +3358,32 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "proc-macro-error-attr2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" dependencies = [ - "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", - "version_check", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ + "proc-macro-error-attr2", "proc-macro2", "quote", - "version_check", + "syn 2.0.117", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] @@ -3045,7 +3396,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", "version_check", "yansi", ] @@ -3077,7 +3428,7 @@ checksum = "7347867d0a7e1208d93b46767be83e2b8f978c3dad35f775ac8d8847551d6fe1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -3101,10 +3452,10 @@ dependencies = [ "pretty_assertions", "ptx_parser", "quick-error", - "rustc-hash 2.1.1", + "rustc-hash 2.1.2", "smallvec", - "strum 0.28.0", - "strum_macros 0.28.0", + "strum", + "strum_macros", "tempfile", "thiserror 1.0.64", "unwrap_or", @@ -3118,8 +3469,8 @@ dependencies = [ "derive_more", "logos", "ptx_parser_macros", - "rustc-hash 2.1.1", - "strum 0.27.1", + "rustc-hash 2.1.2", + "strum", "thiserror 1.0.64", "winnow 0.6.20", ] @@ -3133,8 +3484,8 @@ dependencies = [ "proc-macro2", "ptx_parser_macros_impl", "quote", - "rustc-hash 2.1.1", - "syn 2.0.89", + "rustc-hash 2.1.2", + "syn 2.0.117", ] [[package]] @@ -3143,8 +3494,8 @@ version = "0.0.0" dependencies = [ "proc-macro2", "quote", - "rustc-hash 2.1.1", - "syn 2.0.89", + "rustc-hash 2.1.2", + "syn 2.0.117", ] [[package]] @@ -3188,9 +3539,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.37" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] @@ -3249,13 +3600,19 @@ dependencies = [ "rand", ] +[[package]] +name = "range-alloc" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08" + [[package]] name = "raw-cpuid" version = "11.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", ] [[package]] @@ -3290,7 +3647,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", ] [[package]] @@ -3375,7 +3732,7 @@ checksum = "8100bb34c0a1d0f907143db3149e6b4eea3c33b9ee8b189720168e818303986f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -3404,9 +3761,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc-hash" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" [[package]] name = "rustc_version" @@ -3423,7 +3780,7 @@ version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "errno", "libc", "linux-raw-sys 0.4.14", @@ -3432,15 +3789,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.5" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "errno", "libc", - "linux-raw-sys 0.9.3", - "windows-sys 0.59.0", + "linux-raw-sys 0.12.1", + "windows-sys 0.61.2", ] [[package]] @@ -3484,6 +3841,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -3507,7 +3870,7 @@ checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -3552,7 +3915,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -3597,6 +3960,15 @@ dependencies = [ "sha1", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shell-words" version = "1.1.0" @@ -3640,12 +4012,37 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + [[package]] name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -3664,32 +4061,13 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "strum" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" -dependencies = [ - "strum_macros 0.27.1", -] - [[package]] name = "strum" version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" - -[[package]] -name = "strum_macros" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.89", + "strum_macros", ] [[package]] @@ -3701,7 +4079,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -3736,15 +4114,25 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.89" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "synchrony" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416090a4d8f6358526df5f9f65dfe28750b8b7bfd1fd8a5620f483fc4a75722c" +dependencies = [ + "futures-util", + "loom", +] + [[package]] name = "synstructure" version = "0.13.2" @@ -3753,7 +4141,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -3762,7 +4150,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01198a2debb237c62b6826ec7081082d951f46dbb64b0e8c7649a452230d1dfc" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", "byteorder", "enum-as-inner", "libc", @@ -3796,10 +4184,16 @@ dependencies = [ "fastrand", "getrandom 0.3.3", "once_cell", - "rustix 1.0.5", + "rustix 1.1.4", "windows-sys 0.59.0", ] +[[package]] +name = "thin-cell" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4164c6c316ba9733b0ab021e7f9852c788a4b991b49c25820f1be48e1d41345b" + [[package]] name = "thiserror" version = "1.0.64" @@ -3826,7 +4220,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -3837,7 +4231,16 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", ] [[package]] @@ -3963,6 +4366,55 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64" +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + [[package]] name = "trie-hard" version = "0.1.0" @@ -4065,6 +4517,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + [[package]] name = "vcpkg" version = "0.2.15" @@ -4183,7 +4641,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", "wasm-bindgen-shared", ] @@ -4205,7 +4663,7 @@ checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4319,7 +4777,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -4330,7 +4788,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -4501,7 +4959,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.1", ] [[package]] @@ -4517,7 +4975,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" dependencies = [ "libc", - "rustix 1.0.5", + "rustix 1.1.4", ] [[package]] @@ -4560,7 +5018,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", "synstructure", ] @@ -4581,7 +5039,7 @@ checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -4601,7 +5059,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", "synstructure", ] @@ -4635,7 +5093,7 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.117", ] [[package]] @@ -4692,7 +5150,7 @@ dependencies = [ "paste", "ptx", "ptx_parser", - "rustc-hash 2.1.1", + "rustc-hash 2.1.2", "serde", "serde_json", "tempfile", @@ -4703,6 +5161,41 @@ dependencies = [ "zluda_windows", ] +[[package]] +name = "zluda32" +version = "0.0.0" +dependencies = [ + "cuda_macros", + "cuda_types", + "dark_api", + "libc", + "paste", + "rand", + "rkyv", + "rustc-hash 2.1.2", + "unwrap_or", + "windows", + "zluda_common", + "zluda_server_common", + "zluda_windows", +] + +[[package]] +name = "zluda64_server" +version = "0.0.0" +dependencies = [ + "compio", + "cuda_macros", + "cuda_types", + "dark_api", + "range-alloc", + "rkyv", + "rustc-hash 2.1.2", + "slab", + "windows-sys 0.61.2", + "zluda_server_common", +] + [[package]] name = "zluda_bindgen" version = "0.1.0" @@ -4713,8 +5206,8 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "rustc-hash 2.1.1", - "syn 2.0.89", + "rustc-hash 2.1.2", + "syn 2.0.117", ] [[package]] @@ -4783,7 +5276,7 @@ dependencies = [ "hip_runtime-sys", "libloading", "miopen-sys", - "rustc-hash 2.1.1", + "rustc-hash 2.1.2", "static_assertions", "zluda_common", "zluda_windows", @@ -4834,7 +5327,7 @@ dependencies = [ "argh", "bpaf", "detours-sys", - "rustc-hash 2.1.1", + "rustc-hash 2.1.2", "tempfile", "widestring", "windows", @@ -4879,7 +5372,7 @@ name = "zluda_redirect" version = "0.0.0" dependencies = [ "detours-sys", - "rustc-hash 2.1.1", + "rustc-hash 2.1.2", "unwrap_or", "widestring", "windows", @@ -4888,6 +5381,19 @@ dependencies = [ "zluda_windows", ] +[[package]] +name = "zluda_server_common" +version = "0.0.0" +dependencies = [ + "cuda_macros", + "cuda_types", + "dark_api", + "paste", + "rkyv", + "strum", + "strum_macros", +] + [[package]] name = "zluda_sparse" version = "0.0.0" @@ -4919,10 +5425,9 @@ dependencies = [ "libloading", "parking_lot", "paste", - "ptx", "ptx_parser", "regex", - "rustc-hash 2.1.1", + "rustc-hash 2.1.2", "unwrap_or", "windows", "zluda_common", diff --git a/Cargo.toml b/Cargo.toml index d199126eb..066ca9602 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,8 @@ members = [ "ext/rocblas-sys", "format", "kernel_metadata", + "nvapi", + "nvapi_trace", "ptx_parser_macros_impl", "ptx_parser_macros", "ptx_parser", @@ -36,6 +38,7 @@ members = [ "zluda_ml", "zluda_precompile", "zluda_redirect", + "zluda_server_common", "zluda_sparse", "zluda_trace_blas", "zluda_trace_blaslt", @@ -47,6 +50,8 @@ members = [ "zluda_trace_sparse", "zluda_trace", "zluda", + "zluda32", + "zluda64_server", ] default-members = ["zluda", "zluda_ml", "zluda_inject", "zluda_redirect", "compiler"] diff --git a/cuda_check/Cargo.toml b/cuda_check/Cargo.toml index c0b9c3d4d..2c29cf7aa 100644 --- a/cuda_check/Cargo.toml +++ b/cuda_check/Cargo.toml @@ -13,7 +13,7 @@ cuda_types = { path = "../cuda_types" } zluda_windows = { path = "../zluda_windows" } bpaf = { version = "0.9.19", features = ["derive", "bright-color"] } owo-colors = { version = "4", features = ["supports-colors"] } -rand = "0.9.2" +rand = "0.9" libloading = "0.8" [target.'cfg(windows)'.dependencies] diff --git a/cuda_macros/src/lib.rs b/cuda_macros/src/lib.rs index 769a672b9..1267860b9 100644 --- a/cuda_macros/src/lib.rs +++ b/cuda_macros/src/lib.rs @@ -9,8 +9,7 @@ use syn::parse::{Parse, ParseStream}; use syn::punctuated::Punctuated; use syn::visit_mut::VisitMut; use syn::{ - bracketed, parse_macro_input, File, ForeignItem, ForeignItemFn, Ident, Item, Path, Signature, - Token + File, ForeignItem, ForeignItemFn, Ident, Item, PatType, Path, Signature, Token, TypeGroup, bracketed, parse_macro_input }; const CUDA_RS: &'static str = include_str! {"cuda.rs"}; @@ -301,6 +300,95 @@ pub fn nvml_normalize_fn(tokens: TokenStream) -> TokenStream { normalize_fn_impl("nvml", None, tokens) } +#[proc_macro] +pub fn generate_input_struct(tokens: TokenStream) -> TokenStream { + let input = parse_macro_input!(tokens as FnWithFields); + let struct_name = format_ident!("{}In", input.fn_name); + let fields = input.fields.iter().filter(|pat| is_input_field(&pat.ty)).map(use_wire_object); + quote! { + #[derive(Archive, Deserialize, Serialize, Debug, PartialEq)] + #[repr(C)] + pub struct #struct_name { + #(#fields),* + } + unsafe impl Portable for #struct_name {} + }.into() +} + +#[proc_macro] +pub fn generate_output_struct(tokens: TokenStream) -> TokenStream { + let input = parse_macro_input!(tokens as FnWithFields); + let struct_name = format_ident!("{}Out", input.fn_name); + let fields = input.fields.iter().filter(|pat| !is_input_field(&pat.ty)).map(strip_mut_ptr); + quote! { + #[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] + #[repr(C)] + pub struct #struct_name { + #(#fields),* + } + unsafe impl Portable for #struct_name {} + }.into() +} + +fn is_input_field(ty: &syn::Type) -> bool { + match ty { + syn::Type::Ptr(token) if token.mutability.is_some() => false, + syn::Type::Group(TypeGroup {elem, ..}) => is_input_field(&*elem), + _ => true + } +} + +fn use_wire_object(ty: &syn::PatType) -> proc_macro2::TokenStream { + let pat = &ty.pat; + let type_ = &ty.ty; + quote! { pub #pat : <#type_ as crate::CudaEncode>::WireObject } +} + +fn strip_mut_ptr(ty: &syn::PatType) -> proc_macro2::TokenStream { + fn strip_mut_ptr_from_type(ty: &syn::Type) -> proc_macro2::TokenStream { + match ty { + syn::Type::Ptr(token) => { + let elem = &token.elem; + quote! { #elem } + }, + _ => unreachable!() + } + } + let pat = &ty.pat; + match &*ty.ty { + syn::Type::Ptr(token) => { + let type_ = strip_mut_ptr_from_type(&*token.elem); + quote! { pub #pat : <#type_ as crate::CudaEncode>::WireObject } + }, + syn::Type::Group(TypeGroup {elem, ..}) => { + let type_ = strip_mut_ptr_from_type(&*elem); + quote! { pub #pat : <#type_ as crate::CudaEncode>::WireObject } + }, + _ => unreachable!() + } +} + +struct FnWithFields { + fn_name: Ident, + fields: Punctuated, +} + +impl Parse for FnWithFields { + fn parse(input: ParseStream) -> syn::Result { + let fn_name = input.parse::()?; + let fields = if input.is_empty() { + Punctuated::new() + } else { + input.parse::()?; + input.parse_terminated(PatType::parse, Token![,])? + }; + Ok(Self { + fn_name, + fields, + }) + } +} + fn split(fn_: &str) -> Vec { let mut result = Vec::new(); let mut chars: iter::Peekable<_> = fn_.chars().peekable(); diff --git a/cuda_types/src/dark_api.rs b/cuda_types/src/dark_api.rs index bb7b2cfbf..c73863efc 100644 --- a/cuda_types/src/dark_api.rs +++ b/cuda_types/src/dark_api.rs @@ -68,6 +68,8 @@ bitflags! { pub struct FatbinFileHeaderFlags: u64 { const Is64Bit = 0x0000000000000001; const Debug = 0x0000000000000002; + const CUDA = 0x0000000000000004; + const OpenCL = 0x0000000000000008; const Linux = 0x0000000000000010; const Mac = 0x0000000000000020; const Windows = 0x0000000000000040; diff --git a/dark_api/Cargo.toml b/dark_api/Cargo.toml index f65e53827..6b5452566 100644 --- a/dark_api/Cargo.toml +++ b/dark_api/Cargo.toml @@ -1,14 +1,15 @@ -[package] -name = "dark_api" -version = "0.0.0" -edition = "2021" - -[dependencies] -cuda_types = { path = "../cuda_types" } -format = { path = "../format" } -uuid = "1.16" -paste = "1.0" -bit-vec = "0.8.0" -cglue = "0.3.5" -lz4-sys = "1.9" -zstd-safe = { version = "7.2.4", features = ["std"] } +[package] +name = "dark_api" +version = "0.0.0" +edition = "2021" + +[dependencies] +cuda_types = { path = "../cuda_types" } +format = { path = "../format" } +uuid = "1.16" +paste = "1.0" +bit-vec = "0.8.0" +cglue = "0.3.5" +lz4-sys = "1.9" +zstd-safe = { version = "7.2.4", features = ["std"] } +rkyv = "0.8" diff --git a/dark_api/src/fatbin.rs b/dark_api/src/fatbin.rs index 9488499a2..06a64d86f 100644 --- a/dark_api/src/fatbin.rs +++ b/dark_api/src/fatbin.rs @@ -196,7 +196,10 @@ impl<'a> FatbinFile<'a> { std::slice::from_raw_parts(start, self.header.compressed_size as usize) } - pub unsafe fn get_or_decompress_content(self) -> Result, FatbinError> { + pub unsafe fn get_or_decompress_content( + self, + strip_trailing_zero: bool, + ) -> Result, FatbinError> { let mut payload = if self .header .flags @@ -212,9 +215,8 @@ impl<'a> FatbinFile<'a> { } else { Cow::Borrowed(unsafe { self.get_non_compressed_payload() }) }; - // Remove trailing zeros - if self.header.kind == FatbinFileHeader::HEADER_KIND_PTX { + if strip_trailing_zero && self.header.kind == FatbinFileHeader::HEADER_KIND_PTX { match payload { Cow::Borrowed(ref mut slice) => { while slice.last() == Some(&0) { diff --git a/dark_api/src/lib.rs b/dark_api/src/lib.rs index cfd8c928e..e3eac45fb 100644 --- a/dark_api/src/lib.rs +++ b/dark_api/src/lib.rs @@ -1,6 +1,7 @@ -use std::ffi::c_void; - use cuda_types::cuda::CUuuid; +use format::CudaDisplay; +use rkyv::traits::{Archive, Deserialize, Serialize}; +use std::ffi::c_void; pub mod fatbin; @@ -354,6 +355,7 @@ dark_api! { #[noformat] [0] = logged_call( fn_name: cglue::slice::CSliceRef<'static, u8>, + nvapi_interface: u32, args: crate::FnFfiRef, fn_: crate::FnFfiRef, internal_error: usize, @@ -362,6 +364,54 @@ dark_api! { } } +#[repr(C)] +#[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone, Copy)] +pub struct FunctionArgInfo { + pub size: u32, + pub align: u32, +} + +impl FunctionArgInfo { + pub fn to_layout(self) -> Option { + std::alloc::Layout::from_size_align(self.size as usize, self.align as usize).ok() + } +} + +impl CudaDisplay for FunctionArgInfo { + fn write( + &self, + _fn_name: &'static str, + _index: usize, + writer: &mut (impl std::io::Write + ?Sized), + ) -> std::io::Result<()> { + writer.write_all(b"{ size: ")?; + CudaDisplay::write(&self.size, "", 0, writer)?; + writer.write_all(b", align: ")?; + CudaDisplay::write(&self.align, "", 0, writer)?; + writer.write_all(b" }") + } +} + +// Purely for internal use by ZLUDA32 +dark_api! { + zluda32; + "{EE376A1B-B858-42EB-A52D-9A106D50D914}" => ZLUDA32_INTERNAL[2] { + [0] = get_module_globals( + names: *mut *mut u8, + initializers: *mut *const u8, + sizes: *mut u32, + alignments: *mut u32, + count: *mut u32, + module: cuda_types::cuda::CUmodule + ) -> cuda_types::cuda::CUresult, + [1] = get_function_info( + explicit_arguments: *mut crate::FunctionArgInfo, + explicit_argument_count: *mut u32, + func: cuda_types::cuda::CUfunction + ) -> cuda_types::cuda::CUresult + } +} + #[repr(C)] pub struct ByteVecFfi { ptr: *mut u8, diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 8f1daf799..a13ae2eea 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -10,6 +10,7 @@ - [Precompiling (slow start)](./precompiling.md) # Applications + - [PhysX (32 bit)](./physx32.md) - [llama.cpp](./llama_cpp.md) # For developers diff --git a/docs/src/physx32.md b/docs/src/physx32.md new file mode 100644 index 000000000..8fb7829c6 --- /dev/null +++ b/docs/src/physx32.md @@ -0,0 +1,63 @@ +# PhysX (32 bit) + +ZLUDA has a limited implementation of 32-bit CUDA tailored for PhysX. +There are three ways to use it: + +* Steam game + + Open the game's "Properties" and enter the following in "Launch Options": + + `"\32\zluda.exe" -- %command%` + + ![](steam.jpg) + +* Using launcher directly + + Open a command prompt and launch the game with 32-bit `zluda.exe`: + + `\32\zluda.exe -- ` + +* System install + + + This is not a recommended way to load ZLUDA. Use it only if nothing else works. + + + * Copy `nvapi.dll` and `nvcuda.dll` from the `32` directory to `C:\Windows\SysWOW64` (requires Administrator permissions) + * Set the `ZLUDA64_PATH` environment variable to the ZLUDA directory (it must contain `zluda64_server.exe`) + +## Known Issues + +* Reinitializing PhysX might fail. Changing in-game PhysX settings can crash or hang the game. + +## Troubleshooting + +If your game does not work, try collecting a trace. + +* When using a launcher (through Steam or directly) + + Add the `--zluda-trace` option to `zluda.exe`. + If you have access to an NVIDIA GPU, you can also collect a trace on NVIDIA with `--nvidia-trace`. + + ![](steam_trace.jpg) + +* When using a system install + + + This is not a recommended way to load ZLUDA. Use it only if nothing else works. + + + * Copy `nvapi.dll` and `nvcuda.dll` from `32\trace` to `C:\Windows\SysWOW64` + * Set environment variable `ZLUDA_NVAPI_LIB` to the full path to `32\nvapi.dll` + * Set environment variable `ZLUDA_CUDA_LIB` to the full path to `32\nvcuda.dll` + +Read more about traces [here](troubleshooting.md). + +## Supported games + +ZLUDA was tested with: +* Mirror's Edge +* Alice: Madness Returns +* Mafia II (Classic) + +Most games should work. If your game does not work, see the [Troubleshooting](#troubleshooting) section above. \ No newline at end of file diff --git a/docs/src/steam.jpg b/docs/src/steam.jpg new file mode 100644 index 000000000..bf2fdc90a Binary files /dev/null and b/docs/src/steam.jpg differ diff --git a/docs/src/steam_trace.jpg b/docs/src/steam_trace.jpg new file mode 100644 index 000000000..302efd610 Binary files /dev/null and b/docs/src/steam_trace.jpg differ diff --git a/kernel_metadata/src/lib.rs b/kernel_metadata/src/lib.rs index d4db9baf3..40b817141 100644 --- a/kernel_metadata/src/lib.rs +++ b/kernel_metadata/src/lib.rs @@ -43,7 +43,7 @@ pub struct Global32Bit { #[derive(Archive, Serialize, Deserialize, Debug)] pub struct ModuleMetadata32Bit { pub globals: Vec, - pub explicit_arg_count: Vec<(String, u32)>, + pub explicit_args_size_align: Vec<(String, Vec<(u32, u32)>)>, } // If the alignment is larger than u64, then we need different padding diff --git a/nvapi/Cargo.toml b/nvapi/Cargo.toml new file mode 100644 index 000000000..a3699b162 --- /dev/null +++ b/nvapi/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "nvapi" +version = "0.0.0" +authors = ["Andrzej Janik "] +edition = "2021" + +[lib] +name = "nvapi64" +crate-type = ["cdylib"] + +[dependencies] +format = { path = "../format" } +dark_api = { path = "../dark_api" } +cuda_macros = { path = "../cuda_macros" } +cuda_types = { path = "../cuda_types" } +zluda_trace_common = { path = "../zluda_trace_common" } +libloading = "0.8" +paste = "1.0" +unwrap_or = "1.0.1" +cglue = "0.3.5" +rustc-hash = "2.0.0" + +[package.metadata.zluda] +windows_only = true +windows32_paths = ["nvapi.dll"] +32bit = true diff --git a/nvapi/src/lib.rs b/nvapi/src/lib.rs new file mode 100644 index 000000000..7864f2b89 --- /dev/null +++ b/nvapi/src/lib.rs @@ -0,0 +1,719 @@ +use crate::nvapi::*; +use std::ffi::c_void; + +#[allow(warnings)] +mod nvapi; + +macro_rules! interface_to_name { + ($({ $name:ident, $id:literal }),* $(,)?) => { + fn interface_to_fn(interface: u32) -> Option<*mut c_void> { + match interface { + $( + $id => Some($name as *mut c_void), + )* + _ => None, + } + } + }; +} + +interface_to_name!( + { NvAPI_Initialize, 0x0150e828 }, + { NvAPI_Unload, 0xd22bdd7e }, + // { NvAPI_GetErrorMessage, 0x6c2d048c }, + // { NvAPI_GetInterfaceVersionString, 0x01053fa5 }, + // { NvAPI_GPU_GetEDID, 0x37d32e69 }, + // { NvAPI_SetView, 0x0957d7b6 }, + // { NvAPI_SetViewEx, 0x06b89e68 }, + { NvAPI_GetDisplayDriverVersion, 0xf951a4d1 }, + { NvAPI_SYS_GetDriverAndBranchVersion, 0x2926aaad }, + // { NvAPI_GPU_GetMemoryInfo, 0x07f9b368 }, + // { NvAPI_GPU_GetMemoryInfoEx, 0xc0599498 }, + // { NvAPI_OGL_ExpertModeSet, 0x3805ef7a }, + // { NvAPI_OGL_ExpertModeGet, 0x22ed9516 }, + // { NvAPI_OGL_ExpertModeDefaultsSet, 0xb47a657e }, + // { NvAPI_OGL_ExpertModeDefaultsGet, 0xae921f12 }, + // { NvAPI_EnumPhysicalGPUs, 0xe5ac921f }, + // { NvAPI_EnumTCCPhysicalGPUs, 0xd9930b07 }, + // { NvAPI_EnumLogicalGPUs, 0x48b3ea59 }, + // { NvAPI_GetPhysicalGPUsFromDisplay, 0x34ef9506 }, + // { NvAPI_GetPhysicalGPUFromUnAttachedDisplay, 0x5018ed61 }, + // { NvAPI_GetLogicalGPUFromDisplay, 0xee1370cf }, + // { NvAPI_GetLogicalGPUFromPhysicalGPU, 0xadd604d1 }, + // { NvAPI_GetPhysicalGPUsFromLogicalGPU, 0xaea3fa32 }, + { NvAPI_GetPhysicalGPUFromGPUID, 0x5380ad1a }, + { NvAPI_GetGPUIDfromPhysicalGPU, 0x6533ea3e }, + // { NvAPI_GPU_GetShaderSubPipeCount, 0x0be17923 }, + // { NvAPI_GPU_GetGpuCoreCount, 0xc7026a87 }, + // { NvAPI_GPU_GetAllOutputs, 0x7d554f8e }, + // { NvAPI_GPU_GetConnectedOutputs, 0x1730bfc9 }, + // { NvAPI_GPU_GetConnectedSLIOutputs, 0x0680de09 }, + // { NvAPI_GPU_GetConnectedDisplayIds, 0x0078dba2 }, + // { NvAPI_GPU_GetAllDisplayIds, 0x785210a2 }, + // { NvAPI_GPU_GetConnectedOutputsWithLidState, 0xcf8caf39 }, + // { NvAPI_GPU_GetConnectedSLIOutputsWithLidState, 0x96043cc7 }, + // { NvAPI_GPU_GetSystemType, 0xbaaabfcc }, + // { NvAPI_GPU_GetActiveOutputs, 0xe3e89b6f }, + // { NvAPI_GPU_SetEDID, 0xe83d6456 }, + // { NvAPI_GPU_GetOutputType, 0x40a505e4 }, + // { NvAPI_GPU_ValidateOutputCombination, 0x34c9c2d4 }, + // { NvAPI_GPU_GetFullName, 0xceee8e9f }, + // { NvAPI_GPU_GetPCIIdentifiers, 0x2ddfb66e }, + // { NvAPI_GPU_GetGPUType, 0xc33baeb1 }, + // { NvAPI_GPU_GetBusType, 0x1bb18724 }, + // { NvAPI_GPU_GetBusId, 0x1be0b8e5 }, + // { NvAPI_GPU_GetBusSlotId, 0x2a0a350f }, + // { NvAPI_GPU_GetIRQ, 0xe4715417 }, + // { NvAPI_GPU_GetVbiosRevision, 0xacc3da0a }, + // { NvAPI_GPU_GetVbiosOEMRevision, 0x2d43fb31 }, + // { NvAPI_GPU_GetVbiosVersionString, 0xa561fd7d }, + // { NvAPI_GPU_GetAGPAperture, 0x6e042794 }, + // { NvAPI_GPU_GetCurrentAGPRate, 0xc74925a0 }, + // { NvAPI_GPU_GetCurrentPCIEDownstreamWidth, 0xd048c3b1 }, + // { NvAPI_GPU_GetPhysicalFrameBufferSize, 0x46fbeb03 }, + // { NvAPI_GPU_GetVirtualFrameBufferSize, 0x5a04b644 }, + // { NvAPI_GPU_GetQuadroStatus, 0xe332fa47 }, + // { NvAPI_GPU_GetBoardInfo, 0x22d54523 }, + // { NvAPI_GPU_GetRamBusWidth, 0x7975c581 }, + // { NvAPI_GPU_GetArchInfo, 0xd8265d24 }, + // { NvAPI_I2CRead, 0x2fde12c5 }, + // { NvAPI_I2CWrite, 0xe812eb07 }, + // { NvAPI_GPU_WorkstationFeatureSetup, 0x6c1f3fe4 }, + // { NvAPI_GPU_WorkstationFeatureQuery, 0x004537df }, + // { NvAPI_GPU_GetHDCPSupportStatus, 0xf089eef5 }, + { NvAPI_GPU_CudaEnumComputeCapableGpus, 0x5786cc6e }, + // { NvAPI_GPU_GetTachReading, 0x5f608315 }, + // { NvAPI_GPU_GetECCStatusInfo, 0xca1ddaf3 }, + // { NvAPI_GPU_GetECCErrorInfo, 0xc71f85a6 }, + // { NvAPI_GPU_ResetECCErrorInfo, 0xc02eec20 }, + // { NvAPI_GPU_GetECCConfigurationInfo, 0x77a796f3 }, + // { NvAPI_GPU_SetECCConfiguration, 0x1cf639d9 }, + // { NvAPI_GPU_QueryWorkstationFeatureSupport, 0x80b1abb9 }, + // { NvAPI_GPU_SetScanoutIntensity, 0xa57457a4 }, + // { NvAPI_GPU_GetScanoutIntensityState, 0xe81ce836 }, + // { NvAPI_GPU_SetScanoutWarping, 0xb34bab4f }, + // { NvAPI_GPU_GetScanoutWarpingState, 0x6f5435af }, + // { NvAPI_GPU_SetScanoutCompositionParameter, 0xf898247d }, + // { NvAPI_GPU_GetScanoutCompositionParameter, 0x58fe51e6 }, + // { NvAPI_GPU_GetScanoutConfiguration, 0x6a9f5b63 }, + // { NvAPI_GPU_GetScanoutConfigurationEx, 0xe2e1e6f0 }, + // { NvAPI_GPU_GetAdapterIdFromPhysicalGpu, 0x0ff07fde }, + // { NvAPI_GPU_GetVirtualizationInfo, 0x44e022a9 }, + // { NvAPI_GPU_GetLogicalGpuInfo, 0x842b066e }, + // { NvAPI_GPU_GetLicensableFeatures, 0x3fc596aa }, + // { NvAPI_GPU_GetEncoderStatistics, 0xf0a9aeeb }, + // { NvAPI_GPU_GetEncoderSessionsInfo, 0xd8a72ce5 }, + // { NvAPI_GPU_GetGPUInfo, 0xafd1b02c }, + // { NvAPI_GPU_GetVRReadyData, 0x81d629c5 }, + // { NvAPI_GPU_GetGspFeatures, 0x581c4391 }, + // { NvAPI_GPU_GetUUID, 0xdc95673d }, + // { NvAPI_GPU_NVLINK_GetCaps, 0xbef1119d }, + // { NvAPI_GPU_NVLINK_GetStatus, 0xc72a38e3 }, + // { NvAPI_GPU_GetPerfDecreaseInfo, 0x7f7f4600 }, + // { NvAPI_GPU_GetPstatesInfoEx, 0x843c0256 }, + // { NvAPI_GPU_GetPstates20, 0x6ff81213 }, + // { NvAPI_GPU_GetCurrentPstate, 0x927da4f6 }, + // { NvAPI_GPU_GetDynamicPstatesInfoEx, 0x60ded2ed }, + // { NvAPI_GPU_GetThermalSettings, 0xe3640a56 }, + // { NvAPI_GPU_GetAllClockFrequencies, 0xdcb616c3 }, + // { NvAPI_GPU_QueryIlluminationSupport, 0xa629da31 }, + // { NvAPI_GPU_GetIllumination, 0x9a1b9365 }, + // { NvAPI_GPU_SetIllumination, 0x0254a187 }, + // { NvAPI_GPU_ClientIllumDevicesGetInfo, 0xd4100e58 }, + // { NvAPI_GPU_ClientIllumDevicesGetControl, 0x73c01d58 }, + // { NvAPI_GPU_ClientIllumDevicesSetControl, 0x57024c62 }, + // { NvAPI_GPU_ClientIllumZonesGetInfo, 0x4b81241b }, + // { NvAPI_GPU_ClientIllumZonesGetControl, 0x3dbf5764 }, + // { NvAPI_GPU_ClientIllumZonesSetControl, 0x197d065e }, + // { NvAPI_Event_RegisterCallback, 0xe6dbea69 }, + // { NvAPI_Event_UnregisterCallback, 0xde1f9b45 }, + // { NvAPI_EnumNvidiaDisplayHandle, 0x9abdd40d }, + // { NvAPI_EnumNvidiaUnAttachedDisplayHandle, 0x20de9260 }, + // { NvAPI_CreateDisplayFromUnAttachedDisplay, 0x63f9799e }, + // { NvAPI_GetAssociatedNvidiaDisplayHandle, 0x35c29134 }, + // { NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle, 0xa70503b2 }, + // { NvAPI_GetAssociatedNvidiaDisplayName, 0x22a78b05 }, + // { NvAPI_GetUnAttachedAssociatedDisplayName, 0x4888d790 }, + // { NvAPI_EnableHWCursor, 0x2863148d }, + // { NvAPI_DisableHWCursor, 0xab163097 }, + // { NvAPI_GetVBlankCounter, 0x67b5db55 }, + // { NvAPI_SetRefreshRateOverride, 0x3092ac32 }, + // { NvAPI_GetAssociatedDisplayOutputId, 0xd995937e }, + // { NvAPI_GetDisplayPortInfo, 0xc64ff367 }, + // { NvAPI_SetDisplayPort, 0xfa13e65a }, + // { NvAPI_GetHDMISupportInfo, 0x6ae16ec3 }, + // { NvAPI_Disp_InfoFrameControl, 0x6067af3f }, + // { NvAPI_Disp_ColorControl, 0x92f9d80d }, + // { NvAPI_Disp_GetHdrCapabilities, 0x84f2a8df }, + // { NvAPI_Disp_HdrColorControl, 0x351da224 }, + // { NvAPI_Disp_SetSourceColorSpace, 0x473b6caf }, + // { NvAPI_Disp_GetSourceColorSpace, 0xceedc85b }, + // { NvAPI_Disp_SetSourceHdrMetadata, 0x905eb63b }, + // { NvAPI_Disp_GetSourceHdrMetadata, 0x0d3f52da }, + // { NvAPI_Disp_SetOutputMode, 0x98e7661a }, + // { NvAPI_Disp_GetOutputMode, 0x81fed88d }, + // { NvAPI_Disp_SetHdrToneMapping, 0xdd6da362 }, + // { NvAPI_Disp_GetHdrToneMapping, 0xfbd36e71 }, + // { NvAPI_Disp_GetColorimetry, 0x00b421ad }, + // { NvAPI_DISP_GetTiming, 0x175167e9 }, + // { NvAPI_DISP_GetMonitorCapabilities, 0x3b05c7e1 }, + // { NvAPI_DISP_GetMonitorColorCapabilities, 0x6ae4cfb5 }, + // { NvAPI_DISP_EnumCustomDisplay, 0xa2072d59 }, + // { NvAPI_DISP_TryCustomDisplay, 0x1f7db630 }, + // { NvAPI_DISP_DeleteCustomDisplay, 0x552e5b9b }, + // { NvAPI_DISP_SaveCustomDisplay, 0x49882876 }, + // { NvAPI_DISP_RevertCustomDisplayTrial, 0xcbbd40f0 }, + // { NvAPI_GetView, 0xd6b99d89 }, + // { NvAPI_GetViewEx, 0xdbbc0af4 }, + // { NvAPI_GetSupportedViews, 0x66fb7fc0 }, + // { NvAPI_DISP_GetDisplayIdByDisplayName, 0xae457190 }, + // { NvAPI_DISP_GetGDIPrimaryDisplayId, 0x1e9d8a31 }, + // { NvAPI_DISP_GetDisplayConfig, 0x11abccf8 }, + // { NvAPI_DISP_SetDisplayConfig, 0x5d8cf8de }, + // { NvAPI_DISP_GetEdidData, 0x436ced76 }, + // { NvAPI_DISP_GetAdaptiveSyncData, 0xb73d1ee9 }, + // { NvAPI_DISP_SetAdaptiveSyncData, 0x3eebba1d }, + // { NvAPI_DISP_GetVirtualRefreshRateData, 0x8c00429a }, + // { NvAPI_DISP_SetVirtualRefreshRateData, 0x5abbe6a3 }, + // { NvAPI_DISP_SetPreferredStereoDisplay, 0xc9d0e25f }, + // { NvAPI_DISP_GetPreferredStereoDisplay, 0x1f6b4666 }, + // { NvAPI_DISP_GetNvManagedDedicatedDisplays, 0xdbdf0cb2 }, + // { NvAPI_DISP_AcquireDedicatedDisplay, 0x47c917ba }, + // { NvAPI_DISP_ReleaseDedicatedDisplay, 0x1247825f }, + // { NvAPI_DISP_GetNvManagedDedicatedDisplayMetadata, 0xd645d80c }, + // { NvAPI_DISP_SetNvManagedDedicatedDisplayMetadata, 0x3d8b129a }, + // { NvAPI_Disp_GetDisplayIdInfo, 0xbae8aa5e }, + // { NvAPI_Disp_GetDisplayIdsFromTarget, 0xe7e5f89e }, + // { NvAPI_Disp_GetVRRInfo, 0xdf8fda57 }, + // { NvAPI_Mosaic_GetSupportedTopoInfo, 0xfdb63c81 }, + // { NvAPI_Mosaic_GetTopoGroup, 0xcb89381d }, + // { NvAPI_Mosaic_GetOverlapLimits, 0x989685f0 }, + // { NvAPI_Mosaic_SetCurrentTopo, 0x9b542831 }, + // { NvAPI_Mosaic_GetCurrentTopo, 0xec32944e }, + // { NvAPI_Mosaic_EnableCurrentTopo, 0x5f1aa66c }, + // { NvAPI_Mosaic_GetDisplayViewportsByResolution, 0xdc6dc8d3 }, + // { NvAPI_Mosaic_SetDisplayGrids, 0x4d959a89 }, + // { NvAPI_Mosaic_ValidateDisplayGrids, 0xcf43903d }, + // { NvAPI_Mosaic_EnumDisplayModes, 0x78db97d7 }, + // { NvAPI_Mosaic_EnumDisplayGrids, 0xdf2887af }, + // { NvAPI_GetSupportedMosaicTopologies, 0x410b5c25 }, + // { NvAPI_GetCurrentMosaicTopology, 0xf60852bd }, + // { NvAPI_SetCurrentMosaicTopology, 0xd54b8989 }, + // { NvAPI_EnableCurrentMosaicTopology, 0x74073cc9 }, + // { NvAPI_GSync_EnumSyncDevices, 0xd9639601 }, + // { NvAPI_GSync_QueryCapabilities, 0x44a3f1d1 }, + // { NvAPI_GSync_GetTopology, 0x4562bc38 }, + // { NvAPI_GSync_SetSyncStateSettings, 0x60acdfdd }, + // { NvAPI_GSync_GetControlParameters, 0x16de1c6a }, + // { NvAPI_GSync_SetControlParameters, 0x8bbff88b }, + // { NvAPI_GSync_AdjustSyncDelay, 0x2d11ff51 }, + // { NvAPI_GSync_GetSyncStatus, 0xf1f5b434 }, + // { NvAPI_GSync_GetStatusParameters, 0x70d404ec }, + // { NvAPI_D3D_GetCurrentSLIState, 0x4b708b54 }, + // { NvAPI_D3D9_RegisterResource, 0xa064bdfc }, + // { NvAPI_D3D9_UnregisterResource, 0xbb2b17aa }, + // { NvAPI_D3D9_AliasSurfaceAsTexture, 0xe5ceae41 }, + // { NvAPI_D3D9_StretchRectEx, 0x22de03aa }, + // { NvAPI_D3D9_ClearRT, 0x332d3942 }, + // { NvAPI_D3D_GetObjectHandleForResource, 0xfceac864 }, + // { NvAPI_D3D_SetResourceHint, 0x6c0ed98c }, + // { NvAPI_D3D_BeginResourceRendering, 0x91123d6a }, + // { NvAPI_D3D_EndResourceRendering, 0x37e7191c }, + // { NvAPI_D3D9_GetSurfaceHandle, 0x0f2dd3f2 }, + // { NvAPI_D3D9_VideoSetStereoInfo, 0xb852f4db }, + // { NvAPI_D3D10_SetDepthBoundsTest, 0x4eadf5d2 }, + // { NvAPI_D3D11_CreateDevice, 0x6a16d3a0 }, + // { NvAPI_D3D11_CreateDeviceAndSwapChain, 0xbb939ee5 }, + // { NvAPI_D3D11_SetDepthBoundsTest, 0x7aaf7a04 }, + // { NvAPI_D3D11_IsNvShaderExtnOpCodeSupported, 0x5f68da40 }, + // { NvAPI_D3D11_SetNvShaderExtnSlot, 0x8e90bb9f }, + // { NvAPI_D3D12_SetNvShaderExtnSlotSpace, 0xac2dfeb5 }, + // { NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread, 0x43d867c0 }, + // { NvAPI_D3D11_SetNvShaderExtnSlotLocalThread, 0x0e6482a0 }, + // { NvAPI_D3D11_BeginUAVOverlapEx, 0xba08208a }, + // { NvAPI_D3D11_BeginUAVOverlap, 0x65b93ca8 }, + // { NvAPI_D3D11_EndUAVOverlap, 0x2216a357 }, + // { NvAPI_D3D11_GetResourceHandle, 0x09d52986 }, + // { NvAPI_D3D_SetFPSIndicatorState, 0xa776e8db }, + // { NvAPI_D3D9_Present, 0x05650beb }, + // { NvAPI_D3D9_QueryFrameCount, 0x9083e53a }, + // { NvAPI_D3D9_ResetFrameCount, 0xfa6a0675 }, + // { NvAPI_D3D9_QueryMaxSwapGroup, 0x5995410d }, + // { NvAPI_D3D9_QuerySwapGroup, 0xeba4d232 }, + // { NvAPI_D3D9_JoinSwapGroup, 0x7d44bb54 }, + // { NvAPI_D3D9_BindSwapBarrier, 0x9c39c246 }, + // { NvAPI_D3D_SetVerticalSyncMode, 0x5526cfd1 }, + // { NvAPI_D3D1x_Present, 0x03b845a1 }, + // { NvAPI_D3D1x_QueryFrameCount, 0x9152e055 }, + // { NvAPI_D3D1x_ResetFrameCount, 0xfbbb031a }, + // { NvAPI_D3D1x_QueryMaxSwapGroup, 0x9bb9d68f }, + // { NvAPI_D3D1x_QuerySwapGroup, 0x407f67aa }, + // { NvAPI_D3D1x_JoinSwapGroup, 0x14610cd7 }, + // { NvAPI_D3D1x_BindSwapBarrier, 0x9de8c729 }, + // { NvAPI_D3D12_QueryPresentBarrierSupport, 0xa15faef7 }, + // { NvAPI_D3D12_CreatePresentBarrierClient, 0x4d815de9 }, + // { NvAPI_D3D12_RegisterPresentBarrierResources, 0xd53c9ef0 }, + // { NvAPI_DestroyPresentBarrierClient, 0x3c5c351b }, + // { NvAPI_JoinPresentBarrier, 0x17f6bf82 }, + // { NvAPI_LeavePresentBarrier, 0xc3ec5a7f }, + // { NvAPI_QueryPresentBarrierFrameStatistics, 0x61b844a1 }, + // { NvAPI_D3D12_CreateDDisplayPresentBarrierClient, 0xb5a21987 }, + // { NvAPI_D3D11_CreateRasterizerState, 0xdb8d28af }, + // { NvAPI_D3D_ConfigureAnsel, 0x341c6c7f }, + // { NvAPI_D3D11_CreateTiledTexture2DArray, 0x7886981a }, + // { NvAPI_D3D11_CheckFeatureSupport, 0x106a487e }, + // { NvAPI_D3D11_CreateImplicitMSAATexture2D, 0xb8f79632 }, + // { NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D, 0x24c6a07b }, + // { NvAPI_D3D11_ResolveSubresourceRegion, 0xe6bfedd6 }, + // { NvAPI_D3D12_ResolveSubresourceRegion, 0xc24a15bf }, + // { NvAPI_D3D11_TiledTexture2DArrayGetDesc, 0xf1a2b9d5 }, + // { NvAPI_D3D11_UpdateTileMappings, 0x9a06ea07 }, + // { NvAPI_D3D11_CopyTileMappings, 0xc09ee6bc }, + // { NvAPI_D3D11_TiledResourceBarrier, 0xd6839099 }, + // { NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA, 0xf1c54fc9 }, + // { NvAPI_D3D11_CreateGeometryShaderEx_2, 0x99ed5c1c }, + // { NvAPI_D3D11_CreateVertexShaderEx, 0x0beaa0b2 }, + // { NvAPI_D3D11_CreateHullShaderEx, 0xb53cab00 }, + // { NvAPI_D3D11_CreateDomainShaderEx, 0xa0d7180d }, + // { NvAPI_D3D11_CreatePixelShaderEx_2, 0x4162822b }, + // { NvAPI_D3D11_CreateFastGeometryShaderExplicit, 0x71ab7c9c }, + // { NvAPI_D3D11_CreateFastGeometryShader, 0x525d43be }, + // { NvAPI_D3D11_DecompressView, 0x3a94e822 }, + // { NvAPI_D3D12_CreateGraphicsPipelineState, 0x2fc28856 }, + // { NvAPI_D3D12_CreateComputePipelineState, 0x2762deac }, + // { NvAPI_D3D12_SetDepthBoundsTestValues, 0xb9333fe9 }, + // { NvAPI_D3D12_CreateReservedResource, 0x2c85f101 }, + // { NvAPI_D3D12_CreateHeap, 0x5cb397cf }, + // { NvAPI_D3D12_CreateHeap2, 0x924be9d6 }, + // { NvAPI_D3D12_QueryCpuVisibleVidmem, 0x26322bc3 }, + // { NvAPI_D3D12_ReservedResourceGetDesc, 0x9aa2aabb }, + // { NvAPI_D3D12_UpdateTileMappings, 0xc6017a7d }, + // { NvAPI_D3D12_CopyTileMappings, 0x47f78194 }, + // { NvAPI_D3D12_ResourceAliasingBarrier, 0xb942bab7 }, + // { NvAPI_D3D12_CaptureUAVInfo, 0x6e5ea9db }, + // { NvAPI_D3D11_GetResourceGPUVirtualAddressEx, 0xaf6d14da }, + // { NvAPI_D3D11_EnumerateMetaCommands, 0xc7453ba8 }, + // { NvAPI_D3D11_CreateMetaCommand, 0xf505fba0 }, + // { NvAPI_D3D11_InitializeMetaCommand, 0xaec629e9 }, + // { NvAPI_D3D11_ExecuteMetaCommand, 0x82236c47 }, + // { NvAPI_D3D12_EnumerateMetaCommands, 0xcd9141d8 }, + // { NvAPI_D3D12_CreateMetaCommand, 0xeb29634b }, + // { NvAPI_D3D12_InitializeMetaCommand, 0xa4125399 }, + // { NvAPI_D3D12_ExecuteMetaCommand, 0xde24fc3d }, + // { NvAPI_D3D12_CreateCommittedResource, 0x027e98ae }, + // { NvAPI_D3D12_GetCopyableFootprints, 0xf6305eb5 }, + // { NvAPI_D3D12_CopyTextureRegion, 0x82b91b25 }, + // { NvAPI_D3D12_IsNvShaderExtnOpCodeSupported, 0x3dfacec8 }, + // { NvAPI_D3D12_GetOptimalThreadCountForMesh, 0xb43995cb }, + // { NvAPI_D3D_IsGSyncCapable, 0x9c1eed78 }, + // { NvAPI_D3D_IsGSyncActive, 0xe942b0ff }, + // { NvAPI_D3D12_SetFlipConfig, 0xf3148c42 }, + // { NvAPI_D3D1x_DisableShaderDiskCache, 0xd0cbca7d }, + // { NvAPI_D3D11_MultiGPU_GetCaps, 0xd2d25687 }, + // { NvAPI_D3D11_MultiGPU_Init, 0x017be49e }, + // { NvAPI_D3D11_CreateMultiGPUDevice, 0xbdb20007 }, + // { NvAPI_D3D_QuerySinglePassStereoSupport, 0x6f5f0a6d }, + // { NvAPI_D3D_SetSinglePassStereoMode, 0xa39e6e6e }, + // { NvAPI_D3D12_QuerySinglePassStereoSupport, 0x3b03791b }, + // { NvAPI_D3D12_SetSinglePassStereoMode, 0x83556d87 }, + // { NvAPI_D3D_QueryMultiViewSupport, 0xb6e0a41c }, + // { NvAPI_D3D_SetMultiViewMode, 0x8285c8da }, + // { NvAPI_D3D_QueryModifiedWSupport, 0xcbf9f4f5 }, + // { NvAPI_D3D_SetModifiedWMode, 0x06ea4bf4 }, + // { NvAPI_D3D12_QueryModifiedWSupport, 0x51235248 }, + // { NvAPI_D3D12_SetModifiedWMode, 0xe1fdaba7 }, + // { NvAPI_D3D_CreateLateLatchObject, 0x2db27d09 }, + // { NvAPI_D3D_QueryLateLatchSupport, 0x8ceca0ec }, + // { NvAPI_D3D_RegisterDevice, 0x8c02c4d0 }, + // { NvAPI_D3D11_MultiDrawInstancedIndirect, 0xd4e26bbf }, + // { NvAPI_D3D11_MultiDrawIndexedInstancedIndirect, 0x59e890f9 }, + // { NvAPI_D3D_ImplicitSLIControl, 0x2aede111 }, + // { NvAPI_D3D12_GetNeedsAppFPBlendClamping, 0x6ef4d2d1 }, + // { NvAPI_D3D12_UseDriverHeapPriorities, 0xf0d978a8 }, + // { NvAPI_D3D12_Mosaic_GetCompanionAllocations, 0xa46022c7 }, + // { NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions, 0xb092b818 }, + // { NvAPI_D3D1x_GetGraphicsCapabilities, 0x52b1499a }, + // { NvAPI_D3D12_GetGraphicsCapabilities, 0x01e87354 }, + // { NvAPI_D3D11_RSSetExclusiveScissorRects, 0xae4d73ef }, + // { NvAPI_D3D11_RSSetViewportsPixelShadingRates, 0x34f7938f }, + // { NvAPI_D3D11_CreateShadingRateResourceView, 0x99ca2dff }, + // { NvAPI_D3D11_RSSetShadingRateResourceView, 0x1b0c2f83 }, + // { NvAPI_D3D11_RSGetPixelShadingRateSampleOrder, 0x092442a1 }, + // { NvAPI_D3D11_RSSetPixelShadingRateSampleOrder, 0xa942373a }, + // { NvAPI_D3D_InitializeVRSHelper, 0x4780d70b }, + // { NvAPI_D3D_InitializeNvGazeHandler, 0x5b3b7479 }, + // { NvAPI_D3D_InitializeSMPAssist, 0x42763d0c }, + // { NvAPI_D3D_QuerySMPAssistSupport, 0xc57921de }, + // { NvAPI_D3D_GetSleepStatus, 0xaef96ca1 }, + // { NvAPI_D3D_SetSleepMode, 0xac1ca9e0 }, + // { NvAPI_D3D_Sleep, 0x852cd1d2 }, + // { NvAPI_D3D_SetReflexSync, 0xb9f6faff }, + // { NvAPI_D3D_GetLatency, 0x1a587f9c }, + // { NvAPI_D3D_SetLatencyMarker, 0xd9984c05 }, + // { NvAPI_D3D12_SetAsyncFrameMarker, 0x13c98f73 }, + // { NvAPI_D3D11_SetAsyncFrameMarker, 0x59c2c510 }, + // { NvAPI_D3D12_NotifyOutOfBandCommandQueue, 0x03d6e8cb }, + // { NvAPI_D3D12_SetCreateCommandQueueLowLatencyHint, 0x548c224f }, + // { NvAPI_D3D12_CreateCubinComputeShaderExV2, 0x299f5fdc }, + // { NvAPI_D3D12_CreateCubinComputeShader, 0x2a2c79e8 }, + // { NvAPI_D3D12_CreateCubinComputeShaderEx, 0x3151211b }, + // { NvAPI_D3D12_CreateCubinComputeShaderWithName, 0x1dc7261f }, + // { NvAPI_D3D12_LaunchCubinShader, 0x5c52bb86 }, + // { NvAPI_D3D12_DestroyCubinComputeShader, 0x7fb785ba }, + // { NvAPI_D3D12_GetCudaMergedTextureSamplerObject, 0x329fe6e0 }, + // { NvAPI_D3D12_GetCudaIndependentDescriptorObject, 0x0ddac234 }, + // { NvAPI_D3D12_GetCudaTextureObject, 0x80403fc9 }, + // { NvAPI_D3D12_GetCudaSurfaceObject, 0x48f5b2ee }, + // { NvAPI_D3D12_IsFatbinPTXSupported, 0x70c07832 }, + // { NvAPI_D3D12_CreateCuModule, 0xad1a677d }, + // { NvAPI_D3D12_EnumFunctionsInModule, 0x7ab88d88 }, + // { NvAPI_D3D12_CreateCuFunction, 0xe2436e22 }, + // { NvAPI_D3D12_LaunchCuKernelChain, 0x24973538 }, + // { NvAPI_D3D12_LaunchCuKernelChainEx, 0x846a9bf0 }, + // { NvAPI_D3D12_DestroyCuModule, 0x41c65285 }, + // { NvAPI_D3D12_DestroyCuFunction, 0xdf295ea6 }, + // { NvAPI_D3D11_CreateCubinComputeShaderExV2, 0xf2c71d48 }, + // { NvAPI_D3D11_CreateCubinComputeShader, 0x0ed98181 }, + // { NvAPI_D3D11_CreateCubinComputeShaderEx, 0x32c2a0f6 }, + // { NvAPI_D3D11_CreateCubinComputeShaderWithName, 0xb672be19 }, + // { NvAPI_D3D11_LaunchCubinShader, 0x427e236d }, + // { NvAPI_D3D11_DestroyCubinComputeShader, 0x01682c86 }, + // { NvAPI_D3D11_IsFatbinPTXSupported, 0x6086bd93 }, + // { NvAPI_D3D11_GetCudaIndependentViewObject, 0x34d2afa8 }, + // { NvAPI_D3D11_GetCudaMergedTextureSamplerObject, 0x5d637d8f }, + // { NvAPI_D3D11_CreateUnorderedAccessView, 0x74a497a1 }, + // { NvAPI_D3D11_CreateShaderResourceView, 0x65cb431e }, + // { NvAPI_D3D11_CreateSamplerState, 0x89eca416 }, + // { NvAPI_D3D11_GetCudaTextureObject, 0x9006fa68 }, + // { NvAPI_D3D11_GetResourceGPUVirtualAddress, 0x1819b423 }, + // { NvAPI_D3D12_GetRaytracingCaps, 0x85a6c2a0 }, + // { NvAPI_D3D12_EnableRaytracingValidation, 0x1de5991b }, + // { NvAPI_D3D12_RegisterRaytracingValidationMessageCallback, 0x8554eb38 }, + // { NvAPI_D3D12_UnregisterRaytracingValidationMessageCallback, 0x26975da6 }, + // { NvAPI_D3D12_FlushRaytracingValidationMessages, 0xb8fb1fcb }, + // { NvAPI_D3D12_GetRaytracingDisplacementMicromapArrayPrebuildInfo, 0xfa99b6de }, + // { NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo, 0x4726d180 }, + // { NvAPI_D3D12_SetCreatePipelineStateOptions, 0x5c607a27 }, + // { NvAPI_D3D12_CheckDriverMatchingIdentifierEx, 0xafb237d4 }, + // { NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx, 0x8d025b77 }, + // { NvAPI_D3D12_BuildRaytracingOpacityMicromapArray, 0x814f8d11 }, + // { NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray, 0x0425c538 }, + // { NvAPI_D3D12_BuildRaytracingDisplacementMicromapArray, 0x066f569d }, + // { NvAPI_D3D12_RelocateRaytracingDisplacementMicromapArray, 0x1c142308 }, + // { NvAPI_D3D12_EmitRaytracingDisplacementMicromapArrayPostbuildInfo, 0x68b9a790 }, + // { NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo, 0x1d9a39b6 }, + // { NvAPI_D3D12_BuildRaytracingAccelerationStructureEx, 0xe24ead45 }, + // { NvAPI_D3D12_QueryWorkstationFeatureProperties, 0xa92ea23a }, + // { NvAPI_D3D12_CreateCommittedRDMABuffer, 0xe78dcb44 }, + // { NvAPI_D3D12_ConvertCooperativeVectorMatrix, 0x0f252cb3 }, + // { NvAPI_D3D12_ConvertCooperativeVectorMatrixMultiple, 0x96ba5235 }, + // { NvAPI_D3D12_GetPhysicalDeviceCooperativeVectorProperties, 0x8f182aec }, + // { NvAPI_D3D12_GetRaytracingMultiIndirectClusterOperationRequirementsInfo, 0x5c9163f4 }, + // { NvAPI_D3D12_RaytracingExecuteMultiIndirectClusterOperation, 0x67c798af }, + // { NvAPI_D3D12_GetRaytracingPartitionedTlasIndirectPrebuildInfo, 0xcdfdc5f2 }, + // { NvAPI_D3D12_BuildRaytracingPartitionedTlasIndirect, 0x7cfc6fc3 }, + // { NvAPI_NGX_GetNGXOverrideState, 0x3fd96fba }, + // { NvAPI_NGX_SetNGXOverrideState, 0xb60fcb4e }, + // { NvAPI_DirectD3D12GraphicsCommandList_Create, 0x74a4e712 }, + // { NvAPI_DirectD3D12GraphicsCommandList_Release, 0x99da3dde }, + // { NvAPI_DirectD3D12GraphicsCommandList_Reset, 0x999c26d8 }, + // { NvAPI_VIO_GetCapabilities, 0x1dc91303 }, + // { NvAPI_VIO_Open, 0x44ee4841 }, + // { NvAPI_VIO_Close, 0xd01bd237 }, + // { NvAPI_VIO_Status, 0x0e6ce4f1 }, + // { NvAPI_VIO_SyncFormatDetect, 0x118d48a3 }, + // { NvAPI_VIO_GetConfig, 0xd34a789b }, + // { NvAPI_VIO_SetConfig, 0x0e4eec07 }, + // { NvAPI_VIO_SetCSC, 0xa1ec8d74 }, + // { NvAPI_VIO_GetCSC, 0x7b0d72a3 }, + // { NvAPI_VIO_SetGamma, 0x964bf452 }, + // { NvAPI_VIO_GetGamma, 0x51d53d06 }, + // { NvAPI_VIO_SetSyncDelay, 0x2697a8d1 }, + // { NvAPI_VIO_GetSyncDelay, 0x462214a9 }, + // { NvAPI_VIO_GetPCIInfo, 0xb981d935 }, + // { NvAPI_VIO_IsRunning, 0x96bd040e }, + // { NvAPI_VIO_Start, 0xcde8e1a3 }, + // { NvAPI_VIO_Stop, 0x6ba2a5d6 }, + // { NvAPI_VIO_IsFrameLockModeCompatible, 0x7bf0a94d }, + // { NvAPI_VIO_EnumDevices, 0xfd7c5557 }, + // { NvAPI_VIO_QueryTopology, 0x869534e2 }, + // { NvAPI_VIO_EnumSignalFormats, 0xead72fe4 }, + // { NvAPI_VIO_EnumDataFormats, 0x221fa8e8 }, + // { NvAPI_Stereo_CreateConfigurationProfileRegistryKey, 0xbe7692ec }, + // { NvAPI_Stereo_DeleteConfigurationProfileRegistryKey, 0xf117b834 }, + // { NvAPI_Stereo_SetConfigurationProfileValue, 0x24409f48 }, + // { NvAPI_Stereo_DeleteConfigurationProfileValue, 0x49bceecf }, + // { NvAPI_Stereo_Enable, 0x239c4545 }, + // { NvAPI_Stereo_Disable, 0x2ec50c2b }, + // { NvAPI_Stereo_IsEnabled, 0x348ff8e1 }, + // { NvAPI_Stereo_GetStereoSupport, 0x296c434d }, + // { NvAPI_Stereo_CreateHandleFromIUnknown, 0xac7e37f4 }, + // { NvAPI_Stereo_DestroyHandle, 0x3a153134 }, + // { NvAPI_Stereo_Activate, 0xf6a1ad68 }, + // { NvAPI_Stereo_Deactivate, 0x2d68de96 }, + // { NvAPI_Stereo_IsActivated, 0x1fb0bc30 }, + // { NvAPI_Stereo_GetSeparation, 0x451f2134 }, + // { NvAPI_Stereo_SetSeparation, 0x5c069fa3 }, + // { NvAPI_Stereo_DecreaseSeparation, 0xda044458 }, + // { NvAPI_Stereo_IncreaseSeparation, 0xc9a8ecec }, + // { NvAPI_Stereo_GetConvergence, 0x4ab00934 }, + // { NvAPI_Stereo_SetConvergence, 0x3dd6b54b }, + // { NvAPI_Stereo_DecreaseConvergence, 0x4c87e317 }, + // { NvAPI_Stereo_IncreaseConvergence, 0xa17daabe }, + // { NvAPI_Stereo_GetFrustumAdjustMode, 0xe6839b43 }, + // { NvAPI_Stereo_SetFrustumAdjustMode, 0x7be27fa2 }, + // { NvAPI_Stereo_CaptureJpegImage, 0x932cb140 }, + // { NvAPI_Stereo_InitActivation, 0xc7177702 }, + // { NvAPI_Stereo_Trigger_Activation, 0x0d6c6cd2 }, + // { NvAPI_Stereo_CapturePngImage, 0x8b7e99b5 }, + // { NvAPI_Stereo_ReverseStereoBlitControl, 0x3cd58f89 }, + // { NvAPI_Stereo_SetNotificationMessage, 0x6b9b409e }, + // { NvAPI_Stereo_SetActiveEye, 0x96eea9f8 }, + // { NvAPI_Stereo_SetDriverMode, 0x5e8f0bec }, + // { NvAPI_Stereo_GetEyeSeparation, 0xce653127 }, + // { NvAPI_Stereo_IsWindowedModeSupported, 0x40c8ed5e }, + // { NvAPI_Stereo_SetSurfaceCreationMode, 0xf5dcfcba }, + // { NvAPI_Stereo_GetSurfaceCreationMode, 0x36f1c736 }, + // { NvAPI_Stereo_Debug_WasLastDrawStereoized, 0xed4416c5 }, + // { NvAPI_Stereo_SetDefaultProfile, 0x44f0ecd1 }, + // { NvAPI_Stereo_GetDefaultProfile, 0x624e21c2 }, + // { NvAPI_D3D1x_CreateSwapChain, 0x1bc21b66 }, + // { NvAPI_D3D9_CreateSwapChain, 0x1a131e09 }, + // { NvAPI_Vulkan_InitLowLatencyDevice, 0x5c1696b6 }, + // { NvAPI_Vulkan_DestroyLowLatencyDevice, 0x11a5932b }, + // { NvAPI_Vulkan_GetSleepStatus, 0xadf966af }, + // { NvAPI_Vulkan_SetSleepMode, 0x2acfd162 }, + // { NvAPI_Vulkan_Sleep, 0x36732b1e }, + // { NvAPI_Vulkan_GetLatency, 0x3233d44a }, + // { NvAPI_Vulkan_SetLatencyMarker, 0xa17d13d6 }, + // { NvAPI_Vulkan_NotifyOutOfBandVkQueue, 0x5d6d3840 }, + // { NvAPI_DRS_CreateSession, 0x0694d52e }, + // { NvAPI_DRS_DestroySession, 0xdad9cff8 }, + // { NvAPI_DRS_LoadSettings, 0x375dbd6b }, + // { NvAPI_DRS_SaveSettings, 0xfcbc7e14 }, + // { NvAPI_DRS_LoadSettingsFromFile, 0xd3ede889 }, + // { NvAPI_DRS_SaveSettingsToFile, 0x2be25df8 }, + // { NvAPI_DRS_CreateProfile, 0xcc176068 }, + // { NvAPI_DRS_DeleteProfile, 0x17093206 }, + // { NvAPI_DRS_SetCurrentGlobalProfile, 0x1c89c5df }, + // { NvAPI_DRS_GetCurrentGlobalProfile, 0x617bff9f }, + // { NvAPI_DRS_GetProfileInfo, 0x61cd6fd6 }, + // { NvAPI_DRS_SetProfileInfo, 0x16abd3a9 }, + // { NvAPI_DRS_FindProfileByName, 0x7e4a9a0b }, + // { NvAPI_DRS_EnumProfiles, 0xbc371ee0 }, + // { NvAPI_DRS_GetNumProfiles, 0x1dae4fbc }, + // { NvAPI_DRS_CreateApplication, 0x4347a9de }, + // { NvAPI_DRS_DeleteApplicationEx, 0xc5ea85a1 }, + // { NvAPI_DRS_DeleteApplication, 0x2c694bc6 }, + // { NvAPI_DRS_GetApplicationInfo, 0xed1f8c69 }, + // { NvAPI_DRS_EnumApplications, 0x7fa2173a }, + // { NvAPI_DRS_FindApplicationByName, 0xeee566b2 }, + // { NvAPI_DRS_SetSetting, 0x577dd202 }, + // { NvAPI_DRS_GetSetting, 0x73bf8338 }, + // { NvAPI_DRS_EnumSettings, 0xae3039da }, + // { NvAPI_DRS_EnumAvailableSettingIds, 0xf020614a }, + // { NvAPI_DRS_EnumAvailableSettingValues, 0x2ec39f90 }, + // { NvAPI_DRS_GetSettingIdFromName, 0xcb7309cd }, + // { NvAPI_DRS_GetSettingNameFromId, 0xd61cbe6e }, + // { NvAPI_DRS_DeleteProfileSetting, 0xe4a26362 }, + // { NvAPI_DRS_RestoreAllDefaults, 0x5927b094 }, + // { NvAPI_DRS_RestoreProfileDefault, 0xfa5f6134 }, + // { NvAPI_DRS_RestoreProfileDefaultSetting, 0x53f0381e }, + // { NvAPI_DRS_GetBaseProfile, 0xda8466a0 }, + // { NvAPI_SYS_GetChipSetInfo, 0x53dabbca }, + // { NvAPI_SYS_GetLidAndDockInfo, 0xcda14d8a }, + // { NvAPI_SYS_GetDisplayIdFromGpuAndOutputId, 0x08f2bab4 }, + // { NvAPI_SYS_GetGpuAndOutputIdFromDisplayId, 0x112ba1a5 }, + // { NvAPI_SYS_GetPhysicalGpuFromDisplayId, 0x9ea74659 }, + // { NvAPI_SYS_GetDisplayDriverInfo, 0x721faceb }, + // { NvAPI_SYS_GetPhysicalGPUs, 0xd3b24d2d }, + // { NvAPI_SYS_GetLogicalGPUs, 0xccfffc10 }, + // { NvAPI_NGX_GetDriverFeatureSupport, 0x6194b19d }, + // { NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates, 0xadeeaf67 }, + // { NvAPI_RegisterRiseCallback, 0x9cfe8f94 }, + // { NvAPI_RequestRise, 0x5047de98 }, + // { NvAPI_UninstallRise, 0xab8d09f6 }, + // Undocumented: + // Not sure what is the deal with this function, but looking at the + // implementation of NvAPI_GPU_CudaEnumComputeCapableGpus it seems to just + // call it with the same argument? + { NvAPI_Unknown_36e39e6b, 0x36e39e6b } + +); + +const NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_CAPABLE: u32 = 1 << 0; +const NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_ENABLE: u32 = 1 << 1; +// const NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_DEDICATED: u32 = 1 << 2; +const NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_RECOMMENDED: u32 = 1 << 3; +const NV_COMPUTE_GPU_TOPOLOGY_CUDA_AVAILABLE: u32 = 1 << 4; +const NV_COMPUTE_GPU_TOPOLOGY_CUDA_CAPABLE: u32 = 1 << 16; +// const NV_COMPUTE_GPU_TOPOLOGY_CUDA_DISABLED: u32 = 1 << 17; +const NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_AVAILABLE: u32 = 1 << 21; + +fn make_nvapi_version(ver: u32) -> u32 { + let size = std::mem::size_of::() as u32; + size | (ver << 16) +} + +#[no_mangle] +pub unsafe extern "C" fn nvapi_QueryInterface(interface: u32) -> *mut c_void { + interface_to_fn(interface).unwrap_or(std::ptr::null_mut()) +} + +#[allow(non_snake_case)] +unsafe extern "C" fn NvAPI_Initialize() -> i32 { + 0 +} + +#[allow(non_snake_case)] +unsafe extern "C" fn NvAPI_Unload() -> i32 { + 0 +} + +#[allow(non_snake_case)] +unsafe extern "C" fn NvAPI_GetDisplayDriverVersion( + _display: NvDisplayHandle, + version: *mut NV_DISPLAY_DRIVER_VERSION, +) -> i32 { + // return 0; + let version = version.as_mut(); + let version = unwrap_or::unwrap_some_or!(version, return _NvAPI_Status_NVAPI_INVALID_ARGUMENT); + if version.version != make_nvapi_version::(1) { + return _NvAPI_Status_NVAPI_INCOMPATIBLE_STRUCT_VERSION; + } + version.drvVersion = 99999; + version.bldChangeListNum = 0; + version.szBuildBranchString.fill(0); + version.szAdapterString.fill(0); + let device_name = b"ZLUDA Graphics Device"; + std::ptr::copy_nonoverlapping( + device_name.as_ptr() as _, + version.szAdapterString.as_mut_ptr() as _, + device_name.len(), + ); + 0 +} + +#[allow(non_snake_case)] +unsafe extern "C" fn NvAPI_GPU_CudaEnumComputeCapableGpus(version_ptr: *mut NvU32) -> i32 { + let version = version_ptr.as_mut(); + let version = unwrap_or::unwrap_some_or!(version, return _NvAPI_Status_NVAPI_INVALID_ARGUMENT); + if *version == make_nvapi_version::(1) { + NvAPI_GPU_CudaEnumComputeCapableGpus_v1( + version_ptr + .cast::() + .as_mut() + .unwrap(), + ) + } else if *version == make_nvapi_version::(2) { + NvAPI_GPU_CudaEnumComputeCapableGpus_v2( + version_ptr + .cast::() + .as_mut() + .unwrap(), + ) + } else { + _NvAPI_Status_NVAPI_INCOMPATIBLE_STRUCT_VERSION + } +} + +#[allow(non_snake_case)] +unsafe fn NvAPI_GPU_CudaEnumComputeCapableGpus_v1( + compute_topo: &mut NV_COMPUTE_GPU_TOPOLOGY_V1, +) -> i32 { + compute_topo.gpuCount = 1; + compute_topo.computeGpus[0] = NV_COMPUTE_GPU_TOPOLOGY_V1__bindgen_ty_1 { + hPhysicalGpu: 1 as _, + flags: NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_CAPABLE + | NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_ENABLE + | NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_RECOMMENDED + | NV_COMPUTE_GPU_TOPOLOGY_CUDA_AVAILABLE + | NV_COMPUTE_GPU_TOPOLOGY_CUDA_CAPABLE + | NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_AVAILABLE, + }; + 0 +} + +#[repr(transparent)] +struct NvComputeGpuSync(NV_COMPUTE_GPU); + +unsafe impl Sync for NvComputeGpuSync {} + +#[allow(non_snake_case)] +unsafe fn NvAPI_GPU_CudaEnumComputeCapableGpus_v2( + compute_topo: &mut NV_COMPUTE_GPU_TOPOLOGY_V2, +) -> i32 { + static mut FAKE_GPU: NvComputeGpuSync = NvComputeGpuSync(NV_COMPUTE_GPU { + hPhysicalGpu: 1 as _, + flags: NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_CAPABLE + | NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_ENABLE + | NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_RECOMMENDED + | NV_COMPUTE_GPU_TOPOLOGY_CUDA_AVAILABLE + | NV_COMPUTE_GPU_TOPOLOGY_CUDA_CAPABLE + | NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_AVAILABLE, + }); + compute_topo.gpuCount = 1; + compute_topo.computeGpus = (&raw mut FAKE_GPU).cast(); + 0 +} + +#[allow(non_snake_case)] +unsafe extern "C" fn NvAPI_GetGPUIDfromPhysicalGPU( + physical_gpu: NvPhysicalGpuHandle, + gpu_id: *mut NvU32, +) -> i32 { + if physical_gpu != 1 as _ { + return _NvAPI_Status_NVAPI_INVALID_ARGUMENT; + } + let gpu_id = gpu_id.as_mut(); + let gpu_id = unwrap_or::unwrap_some_or!(gpu_id, return _NvAPI_Status_NVAPI_INVALID_ARGUMENT); + *gpu_id = 1; + 0 +} + +#[allow(non_snake_case)] +unsafe extern "C" fn NvAPI_GetPhysicalGPUFromGPUID( + gpu_id: NvU32, + physical_gpu: *mut NvPhysicalGpuHandle, +) -> i32 { + if gpu_id != 1 { + return _NvAPI_Status_NVAPI_INVALID_ARGUMENT; + } + let physical_gpu = physical_gpu.as_mut(); + let physical_gpu = + unwrap_or::unwrap_some_or!(physical_gpu, return _NvAPI_Status_NVAPI_INVALID_ARGUMENT); + *physical_gpu = 1 as _; + 0 +} + +#[allow(non_snake_case)] +unsafe extern "C" fn NvAPI_SYS_GetDriverAndBranchVersion( + driver_version: *mut NvU32, + build_branch_string: *mut NvAPI_ShortString, +) -> i32 { + let driver_version = driver_version.as_mut(); + let driver_version = + unwrap_or::unwrap_some_or!(driver_version, return _NvAPI_Status_NVAPI_INVALID_ARGUMENT); + let build_branch_string = build_branch_string.as_mut(); + let build_branch_string = unwrap_or::unwrap_some_or!( + build_branch_string, + return _NvAPI_Status_NVAPI_INVALID_ARGUMENT + ); + *driver_version = 99999; + build_branch_string.fill(0); + let version_string = b"r999_99"; + std::ptr::copy_nonoverlapping( + version_string.as_ptr().cast(), + build_branch_string.as_mut_ptr(), + version_string.len(), + ); + 0 +} + +#[allow(non_snake_case)] +unsafe extern "C" fn NvAPI_Unknown_36e39e6b(compute_topo: *mut NV_COMPUTE_GPU_TOPOLOGY_V2) -> i32 { + let compute_topo = compute_topo.as_mut(); + let compute_topo = + unwrap_or::unwrap_some_or!(compute_topo, return _NvAPI_Status_NVAPI_INVALID_ARGUMENT); + NvAPI_GPU_CudaEnumComputeCapableGpus_v2(compute_topo) +} diff --git a/nvapi/src/nvapi.rs b/nvapi/src/nvapi.rs new file mode 100644 index 000000000..8b08ecf38 --- /dev/null +++ b/nvapi/src/nvapi.rs @@ -0,0 +1,19879 @@ +// bindgen nvapi.h -o nvapi.rs --no-layout-tests --allowlist-type "Nv.*" --allowlist-type "NV_.*" +/* automatically generated by rust-bindgen 0.72.1 */ + +#[repr(C)] +#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub struct __BindgenBitfieldUnit { + storage: Storage, +} +impl __BindgenBitfieldUnit { + #[inline] + pub const fn new(storage: Storage) -> Self { + Self { storage } + } +} +impl __BindgenBitfieldUnit +where + Storage: AsRef<[u8]> + AsMut<[u8]>, +{ + #[inline] + fn extract_bit(byte: u8, index: usize) -> bool { + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + byte & mask == mask + } + #[inline] + pub fn get_bit(&self, index: usize) -> bool { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = self.storage.as_ref()[byte_index]; + Self::extract_bit(byte, index) + } + #[inline] + pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = unsafe { + *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize) + }; + Self::extract_bit(byte, index) + } + #[inline] + fn change_bit(byte: u8, index: usize, val: bool) -> u8 { + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + if val { + byte | mask + } else { + byte & !mask + } + } + #[inline] + pub fn set_bit(&mut self, index: usize, val: bool) { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = &mut self.storage.as_mut()[byte_index]; + *byte = Self::change_bit(*byte, index, val); + } + #[inline] + pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = unsafe { + (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize) + }; + unsafe { *byte = Self::change_bit(*byte, index, val) }; + } + #[inline] + pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if self.get_bit(i + bit_offset) { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] + pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if unsafe { Self::raw_get_bit(this, i + bit_offset) } { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] + pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + self.set_bit(index + bit_offset, val_bit_is_set); + } + } + #[inline] + pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) }; + } + } +} +pub type DWORD = ::std::os::raw::c_ulong; +pub type ULONG_PTR = ::std::os::raw::c_ulonglong; +pub type SIZE_T = ULONG_PTR; +pub type LONG = ::std::os::raw::c_long; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LUID { + pub LowPart: DWORD, + pub HighPart: LONG, +} +pub type LUID = _LUID; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MEMORY_RANGE { + pub BaseAddress: *mut ::std::os::raw::c_void, + pub Length: SIZE_T, +} +pub type NV_MEMORY_RANGE = _NV_MEMORY_RANGE; +pub type NvU64 = ::std::os::raw::c_ulonglong; +pub type NvS64 = ::std::os::raw::c_longlong; +pub type NvS32 = ::std::os::raw::c_int; +pub type NvU32 = ::std::os::raw::c_uint; +pub type NvS16 = ::std::os::raw::c_short; +pub type NvU16 = ::std::os::raw::c_ushort; +pub type NvU8 = ::std::os::raw::c_uchar; +pub type NvS8 = ::std::os::raw::c_schar; +pub type NvF32 = f32; +pub type NvF64 = f64; +pub type NvBool = NvU8; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_RECT { + pub left: NvU32, + pub top: NvU32, + pub right: NvU32, + pub bottom: NvU32, +} +pub type NV_RECT = _NV_RECT; +#[doc = "! \\addtogroup nvapihandles\n! NVAPI Handles - These handles are retrieved from various calls and passed in to others in NvAPI\n! These are meant to be opaque types. Do not assume they correspond to indices, HDCs,\n! display indexes or anything else.\n!\n! Most handles remain valid until a display re-configuration (display mode set) or GPU\n! reconfiguration (going into or out of SLI modes) occurs. If NVAPI_HANDLE_INVALIDATED\n! is received by an app, it should discard all handles, and re-enumerate them.\n! @{"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvLogicalGpuHandle__ { + pub unused: ::std::os::raw::c_int, +} +#[doc = "! \\addtogroup nvapihandles\n! NVAPI Handles - These handles are retrieved from various calls and passed in to others in NvAPI\n! These are meant to be opaque types. Do not assume they correspond to indices, HDCs,\n! display indexes or anything else.\n!\n! Most handles remain valid until a display re-configuration (display mode set) or GPU\n! reconfiguration (going into or out of SLI modes) occurs. If NVAPI_HANDLE_INVALIDATED\n! is received by an app, it should discard all handles, and re-enumerate them.\n! @{"] +pub type NvLogicalGpuHandle = *mut NvLogicalGpuHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvPhysicalGpuHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvPhysicalGpuHandle = *mut NvPhysicalGpuHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvDisplayHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvDisplayHandle = *mut NvDisplayHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvMonitorHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvMonitorHandle = *mut NvMonitorHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvUnAttachedDisplayHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvUnAttachedDisplayHandle = *mut NvUnAttachedDisplayHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvVisualComputingDeviceHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvVisualComputingDeviceHandle = *mut NvVisualComputingDeviceHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvEventHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvEventHandle = *mut NvEventHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvHICHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvHICHandle = *mut NvHICHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvGSyncDeviceHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvGSyncDeviceHandle = *mut NvGSyncDeviceHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvVioHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvVioHandle = *mut NvVioHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvTransitionHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvTransitionHandle = *mut NvTransitionHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvAudioHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvAudioHandle = *mut NvAudioHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Nv3DVPContextHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type Nv3DVPContextHandle = *mut Nv3DVPContextHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Nv3DVPTransceiverHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type Nv3DVPTransceiverHandle = *mut Nv3DVPTransceiverHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Nv3DVPGlassesHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type Nv3DVPGlassesHandle = *mut Nv3DVPGlassesHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvPcfClientHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvPcfClientHandle = *mut NvPcfClientHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvSourceHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvSourceHandle = *mut NvSourceHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvTargetHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvTargetHandle = *mut NvTargetHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvPresentBarrierClientHandle__ { + pub unused: ::std::os::raw::c_int, +} +pub type NvPresentBarrierClientHandle = *mut NvPresentBarrierClientHandle__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvSBox { + pub sX: NvS32, + pub sY: NvS32, + pub sWidth: NvS32, + pub sHeight: NvS32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NvGUID { + pub data1: NvU32, + pub data2: NvU16, + pub data3: NvU16, + pub data4: [NvU8; 8usize], +} +pub type NvLUID = NvGUID; +pub type NvAPI_String = [::std::os::raw::c_char; 4096usize]; +pub type NvAPI_LongString = [::std::os::raw::c_char; 256usize]; +pub type NvAPI_ShortString = [::std::os::raw::c_char; 64usize]; +pub type NvAPI_UnicodeShortString = [NvU16; 64usize]; +#[doc = "!< Success. Request is completed."] +pub const _NvAPI_Status_NVAPI_OK: _NvAPI_Status = 0; +#[doc = "!< Generic error"] +pub const _NvAPI_Status_NVAPI_ERROR: _NvAPI_Status = -1; +#[doc = "!< NVAPI support library cannot be loaded."] +pub const _NvAPI_Status_NVAPI_LIBRARY_NOT_FOUND: _NvAPI_Status = -2; +#[doc = "!< not implemented in current driver installation"] +pub const _NvAPI_Status_NVAPI_NO_IMPLEMENTATION: _NvAPI_Status = -3; +#[doc = "!< NvAPI_Initialize has not been called (successfully)"] +pub const _NvAPI_Status_NVAPI_API_NOT_INITIALIZED: _NvAPI_Status = -4; +#[doc = "!< The argument/parameter value is not valid or NULL."] +pub const _NvAPI_Status_NVAPI_INVALID_ARGUMENT: _NvAPI_Status = -5; +#[doc = "!< No NVIDIA display driver, or NVIDIA GPU driving a display, was found."] +pub const _NvAPI_Status_NVAPI_NVIDIA_DEVICE_NOT_FOUND: _NvAPI_Status = -6; +#[doc = "!< No more items to enumerate"] +pub const _NvAPI_Status_NVAPI_END_ENUMERATION: _NvAPI_Status = -7; +#[doc = "!< Invalid handle"] +pub const _NvAPI_Status_NVAPI_INVALID_HANDLE: _NvAPI_Status = -8; +#[doc = "!< An argument's structure version is not supported"] +pub const _NvAPI_Status_NVAPI_INCOMPATIBLE_STRUCT_VERSION: _NvAPI_Status = -9; +#[doc = "!< The handle is no longer valid (likely due to GPU or display re-configuration)"] +pub const _NvAPI_Status_NVAPI_HANDLE_INVALIDATED: _NvAPI_Status = -10; +#[doc = "!< No NVIDIA OpenGL context is current (but needs to be)"] +pub const _NvAPI_Status_NVAPI_OPENGL_CONTEXT_NOT_CURRENT: _NvAPI_Status = -11; +#[doc = "!< An invalid pointer, usually NULL, was passed as a parameter"] +pub const _NvAPI_Status_NVAPI_INVALID_POINTER: _NvAPI_Status = -14; +#[doc = "!< OpenGL Expert is not supported by the current drivers"] +pub const _NvAPI_Status_NVAPI_NO_GL_EXPERT: _NvAPI_Status = -12; +#[doc = "!< OpenGL Expert is supported, but driver instrumentation is currently disabled"] +pub const _NvAPI_Status_NVAPI_INSTRUMENTATION_DISABLED: _NvAPI_Status = -13; +#[doc = "!< OpenGL does not support Nsight"] +pub const _NvAPI_Status_NVAPI_NO_GL_NSIGHT: _NvAPI_Status = -15; +#[doc = "!< Expected a logical GPU handle for one or more parameters"] +pub const _NvAPI_Status_NVAPI_EXPECTED_LOGICAL_GPU_HANDLE: _NvAPI_Status = -100; +#[doc = "!< Expected a physical GPU handle for one or more parameters"] +pub const _NvAPI_Status_NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: _NvAPI_Status = -101; +#[doc = "!< Expected an NV display handle for one or more parameters"] +pub const _NvAPI_Status_NVAPI_EXPECTED_DISPLAY_HANDLE: _NvAPI_Status = -102; +#[doc = "!< The combination of parameters is not valid."] +pub const _NvAPI_Status_NVAPI_INVALID_COMBINATION: _NvAPI_Status = -103; +#[doc = "!< Requested feature is not supported in the selected GPU"] +pub const _NvAPI_Status_NVAPI_NOT_SUPPORTED: _NvAPI_Status = -104; +#[doc = "!< No port ID was found for the I2C transaction"] +pub const _NvAPI_Status_NVAPI_PORTID_NOT_FOUND: _NvAPI_Status = -105; +#[doc = "!< Expected an unattached display handle as one of the input parameters."] +pub const _NvAPI_Status_NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE: _NvAPI_Status = -106; +#[doc = "!< Invalid perf level"] +pub const _NvAPI_Status_NVAPI_INVALID_PERF_LEVEL: _NvAPI_Status = -107; +#[doc = "!< Device is busy; request not fulfilled"] +pub const _NvAPI_Status_NVAPI_DEVICE_BUSY: _NvAPI_Status = -108; +#[doc = "!< NV persist file is not found"] +pub const _NvAPI_Status_NVAPI_NV_PERSIST_FILE_NOT_FOUND: _NvAPI_Status = -109; +#[doc = "!< NV persist data is not found"] +pub const _NvAPI_Status_NVAPI_PERSIST_DATA_NOT_FOUND: _NvAPI_Status = -110; +#[doc = "!< Expected a TV output display"] +pub const _NvAPI_Status_NVAPI_EXPECTED_TV_DISPLAY: _NvAPI_Status = -111; +#[doc = "!< Expected a TV output on the D Connector - HDTV_EIAJ4120."] +pub const _NvAPI_Status_NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR: _NvAPI_Status = -112; +#[doc = "!< SLI is not active on this device."] +pub const _NvAPI_Status_NVAPI_NO_ACTIVE_SLI_TOPOLOGY: _NvAPI_Status = -113; +#[doc = "!< Setup of SLI rendering mode is not possible right now."] +pub const _NvAPI_Status_NVAPI_SLI_RENDERING_MODE_NOTALLOWED: _NvAPI_Status = -114; +#[doc = "!< Expected a digital flat panel."] +pub const _NvAPI_Status_NVAPI_EXPECTED_DIGITAL_FLAT_PANEL: _NvAPI_Status = -115; +#[doc = "!< Argument exceeds the expected size."] +pub const _NvAPI_Status_NVAPI_ARGUMENT_EXCEED_MAX_SIZE: _NvAPI_Status = -116; +#[doc = "!< Inhibit is ON due to one of the flags in NV_GPU_DISPLAY_CHANGE_INHIBIT or SLI active."] +pub const _NvAPI_Status_NVAPI_DEVICE_SWITCHING_NOT_ALLOWED: _NvAPI_Status = -117; +#[doc = "!< Testing of clocks is not supported."] +pub const _NvAPI_Status_NVAPI_TESTING_CLOCKS_NOT_SUPPORTED: _NvAPI_Status = -118; +#[doc = "!< The specified underscan config is from an unknown source (e.g. INF)"] +pub const _NvAPI_Status_NVAPI_UNKNOWN_UNDERSCAN_CONFIG: _NvAPI_Status = -119; +#[doc = "!< Timeout while reconfiguring GPUs"] +pub const _NvAPI_Status_NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO: _NvAPI_Status = -120; +#[doc = "!< Requested data was not found"] +pub const _NvAPI_Status_NVAPI_DATA_NOT_FOUND: _NvAPI_Status = -121; +#[doc = "!< Expected an analog display"] +pub const _NvAPI_Status_NVAPI_EXPECTED_ANALOG_DISPLAY: _NvAPI_Status = -122; +#[doc = "!< No SLI video bridge is present"] +pub const _NvAPI_Status_NVAPI_NO_VIDLINK: _NvAPI_Status = -123; +#[doc = "!< NVAPI requires a reboot for the settings to take effect"] +pub const _NvAPI_Status_NVAPI_REQUIRES_REBOOT: _NvAPI_Status = -124; +#[doc = "!< The function is not supported with the current Hybrid mode."] +pub const _NvAPI_Status_NVAPI_INVALID_HYBRID_MODE: _NvAPI_Status = -125; +#[doc = "!< The target types are not all the same"] +pub const _NvAPI_Status_NVAPI_MIXED_TARGET_TYPES: _NvAPI_Status = -126; +#[doc = "!< The function is not supported from 32-bit on a 64-bit system."] +pub const _NvAPI_Status_NVAPI_SYSWOW64_NOT_SUPPORTED: _NvAPI_Status = -127; +#[doc = "!< There is no implicit GPU topology active. Use NVAPI_SetHybridMode to change topology."] +pub const _NvAPI_Status_NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED: _NvAPI_Status = -128; +#[doc = "!< Prompt the user to close all non-migratable applications."] +pub const _NvAPI_Status_NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS: _NvAPI_Status = -129; +#[doc = "!< Could not allocate sufficient memory to complete the call."] +pub const _NvAPI_Status_NVAPI_OUT_OF_MEMORY: _NvAPI_Status = -130; +#[doc = "!< The previous operation that is transferring information to or from this surface is incomplete."] +pub const _NvAPI_Status_NVAPI_WAS_STILL_DRAWING: _NvAPI_Status = -131; +#[doc = "!< The file was not found."] +pub const _NvAPI_Status_NVAPI_FILE_NOT_FOUND: _NvAPI_Status = -132; +#[doc = "!< There are too many unique instances of a particular type of state object."] +pub const _NvAPI_Status_NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS: _NvAPI_Status = -133; +#[doc = "!< The method call is invalid. For example, a method's parameter may not be a valid pointer."] +pub const _NvAPI_Status_NVAPI_INVALID_CALL: _NvAPI_Status = -134; +#[doc = "!< d3d10_1.dll cannot be loaded."] +pub const _NvAPI_Status_NVAPI_D3D10_1_LIBRARY_NOT_FOUND: _NvAPI_Status = -135; +#[doc = "!< Couldn't find the function in the loaded DLL."] +pub const _NvAPI_Status_NVAPI_FUNCTION_NOT_FOUND: _NvAPI_Status = -136; +#[doc = "!< The application will require Administrator privileges to access this API.\n!< The application can be elevated to a higher permission level by selecting \"Run as Administrator\"."] +pub const _NvAPI_Status_NVAPI_INVALID_USER_PRIVILEGE: _NvAPI_Status = -137; +#[doc = "!< The handle corresponds to GDIPrimary."] +pub const _NvAPI_Status_NVAPI_EXPECTED_NON_PRIMARY_DISPLAY_HANDLE: _NvAPI_Status = -138; +#[doc = "!< Setting Physx GPU requires that the GPU is compute-capable."] +pub const _NvAPI_Status_NVAPI_EXPECTED_COMPUTE_GPU_HANDLE: _NvAPI_Status = -139; +#[doc = "!< The Stereo part of NVAPI failed to initialize completely. Check if the stereo driver is installed."] +pub const _NvAPI_Status_NVAPI_STEREO_NOT_INITIALIZED: _NvAPI_Status = -140; +#[doc = "!< Access to stereo-related registry keys or values has failed."] +pub const _NvAPI_Status_NVAPI_STEREO_REGISTRY_ACCESS_FAILED: _NvAPI_Status = -141; +#[doc = "!< The given registry profile type is not supported."] +pub const _NvAPI_Status_NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED: _NvAPI_Status = -142; +#[doc = "!< The given registry value is not supported."] +pub const _NvAPI_Status_NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED: _NvAPI_Status = -143; +#[doc = "!< Stereo is not enabled and the function needed it to execute completely."] +pub const _NvAPI_Status_NVAPI_STEREO_NOT_ENABLED: _NvAPI_Status = -144; +#[doc = "!< Stereo is not turned on and the function needed it to execute completely."] +pub const _NvAPI_Status_NVAPI_STEREO_NOT_TURNED_ON: _NvAPI_Status = -145; +#[doc = "!< Invalid device interface."] +pub const _NvAPI_Status_NVAPI_STEREO_INVALID_DEVICE_INTERFACE: _NvAPI_Status = -146; +#[doc = "!< Separation percentage or JPEG image capture quality is out of [0-100] range."] +pub const _NvAPI_Status_NVAPI_STEREO_PARAMETER_OUT_OF_RANGE: _NvAPI_Status = -147; +#[doc = "!< The given frustum adjust mode is not supported."] +pub const _NvAPI_Status_NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED: _NvAPI_Status = -148; +#[doc = "!< The mosaic topology is not possible given the current state of the hardware."] +pub const _NvAPI_Status_NVAPI_TOPO_NOT_POSSIBLE: _NvAPI_Status = -149; +#[doc = "!< An attempt to do a display resolution mode change has failed."] +pub const _NvAPI_Status_NVAPI_MODE_CHANGE_FAILED: _NvAPI_Status = -150; +#[doc = "!< d3d11.dll/d3d11_beta.dll cannot be loaded."] +pub const _NvAPI_Status_NVAPI_D3D11_LIBRARY_NOT_FOUND: _NvAPI_Status = -151; +#[doc = "!< Address is outside of valid range."] +pub const _NvAPI_Status_NVAPI_INVALID_ADDRESS: _NvAPI_Status = -152; +#[doc = "!< The pre-allocated string is too small to hold the result."] +pub const _NvAPI_Status_NVAPI_STRING_TOO_SMALL: _NvAPI_Status = -153; +#[doc = "!< The input does not match any of the available devices."] +pub const _NvAPI_Status_NVAPI_MATCHING_DEVICE_NOT_FOUND: _NvAPI_Status = -154; +#[doc = "!< Driver is running."] +pub const _NvAPI_Status_NVAPI_DRIVER_RUNNING: _NvAPI_Status = -155; +#[doc = "!< Driver is not running."] +pub const _NvAPI_Status_NVAPI_DRIVER_NOTRUNNING: _NvAPI_Status = -156; +#[doc = "!< A driver reload is required to apply these settings."] +pub const _NvAPI_Status_NVAPI_ERROR_DRIVER_RELOAD_REQUIRED: _NvAPI_Status = -157; +#[doc = "!< Intended setting is not allowed."] +pub const _NvAPI_Status_NVAPI_SET_NOT_ALLOWED: _NvAPI_Status = -158; +#[doc = "!< Information can't be returned due to \"advanced display topology\"."] +pub const _NvAPI_Status_NVAPI_ADVANCED_DISPLAY_TOPOLOGY_REQUIRED: _NvAPI_Status = -159; +#[doc = "!< Setting is not found."] +pub const _NvAPI_Status_NVAPI_SETTING_NOT_FOUND: _NvAPI_Status = -160; +#[doc = "!< Setting size is too large."] +pub const _NvAPI_Status_NVAPI_SETTING_SIZE_TOO_LARGE: _NvAPI_Status = -161; +#[doc = "!< There are too many settings for a profile."] +pub const _NvAPI_Status_NVAPI_TOO_MANY_SETTINGS_IN_PROFILE: _NvAPI_Status = -162; +#[doc = "!< Profile is not found."] +pub const _NvAPI_Status_NVAPI_PROFILE_NOT_FOUND: _NvAPI_Status = -163; +#[doc = "!< Profile name is duplicated."] +pub const _NvAPI_Status_NVAPI_PROFILE_NAME_IN_USE: _NvAPI_Status = -164; +#[doc = "!< Profile name is empty."] +pub const _NvAPI_Status_NVAPI_PROFILE_NAME_EMPTY: _NvAPI_Status = -165; +#[doc = "!< Application not found in the Profile."] +pub const _NvAPI_Status_NVAPI_EXECUTABLE_NOT_FOUND: _NvAPI_Status = -166; +#[doc = "!< Application already exists in the other profile."] +pub const _NvAPI_Status_NVAPI_EXECUTABLE_ALREADY_IN_USE: _NvAPI_Status = -167; +#[doc = "!< Data Type mismatch"] +pub const _NvAPI_Status_NVAPI_DATATYPE_MISMATCH: _NvAPI_Status = -168; +#[doc = "!< The profile passed as parameter has been removed and is no longer valid."] +pub const _NvAPI_Status_NVAPI_PROFILE_REMOVED: _NvAPI_Status = -169; +#[doc = "!< An unregistered resource was passed as a parameter."] +pub const _NvAPI_Status_NVAPI_UNREGISTERED_RESOURCE: _NvAPI_Status = -170; +#[doc = "!< The DisplayId corresponds to a display which is not within the normal outputId range."] +pub const _NvAPI_Status_NVAPI_ID_OUT_OF_RANGE: _NvAPI_Status = -171; +#[doc = "!< Display topology is not valid so the driver cannot do a mode set on this configuration."] +pub const _NvAPI_Status_NVAPI_DISPLAYCONFIG_VALIDATION_FAILED: _NvAPI_Status = -172; +#[doc = "!< Display Port Multi-Stream topology has been changed."] +pub const _NvAPI_Status_NVAPI_DPMST_CHANGED: _NvAPI_Status = -173; +#[doc = "!< Input buffer is insufficient to hold the contents."] +pub const _NvAPI_Status_NVAPI_INSUFFICIENT_BUFFER: _NvAPI_Status = -174; +#[doc = "!< No access to the caller."] +pub const _NvAPI_Status_NVAPI_ACCESS_DENIED: _NvAPI_Status = -175; +#[doc = "!< The requested action cannot be performed without Mosaic being enabled."] +pub const _NvAPI_Status_NVAPI_MOSAIC_NOT_ACTIVE: _NvAPI_Status = -176; +#[doc = "!< The surface is relocated away from video memory."] +pub const _NvAPI_Status_NVAPI_SHARE_RESOURCE_RELOCATED: _NvAPI_Status = -177; +#[doc = "!< The user should disable DWM before calling NvAPI."] +pub const _NvAPI_Status_NVAPI_REQUEST_USER_TO_DISABLE_DWM: _NvAPI_Status = -178; +#[doc = "!< D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET - the user has to reset the device."] +pub const _NvAPI_Status_NVAPI_D3D_DEVICE_LOST: _NvAPI_Status = -179; +#[doc = "!< The requested action cannot be performed in the current state."] +pub const _NvAPI_Status_NVAPI_INVALID_CONFIGURATION: _NvAPI_Status = -180; +#[doc = "!< Call failed as stereo handshake not completed."] +pub const _NvAPI_Status_NVAPI_STEREO_HANDSHAKE_NOT_DONE: _NvAPI_Status = -181; +#[doc = "!< The path provided was too short to determine the correct NVDRS_APPLICATION"] +pub const _NvAPI_Status_NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS: _NvAPI_Status = -182; +#[doc = "!< Default stereo profile is not currently defined"] +pub const _NvAPI_Status_NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED: _NvAPI_Status = -183; +#[doc = "!< Default stereo profile does not exist"] +pub const _NvAPI_Status_NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST: _NvAPI_Status = -184; +#[doc = "!< A cluster is already defined with the given configuration."] +pub const _NvAPI_Status_NVAPI_CLUSTER_ALREADY_EXISTS: _NvAPI_Status = -185; +#[doc = "!< The input display id is not that of a multi stream enabled connector or a display device in a multi stream topology"] +pub const _NvAPI_Status_NVAPI_DPMST_DISPLAY_ID_EXPECTED: _NvAPI_Status = -186; +#[doc = "!< The input display id is not valid or the monitor associated to it does not support the current operation"] +pub const _NvAPI_Status_NVAPI_INVALID_DISPLAY_ID: _NvAPI_Status = -187; +#[doc = "!< While playing secure audio stream, stream goes out of sync"] +pub const _NvAPI_Status_NVAPI_STREAM_IS_OUT_OF_SYNC: _NvAPI_Status = -188; +#[doc = "!< Older audio driver version than required"] +pub const _NvAPI_Status_NVAPI_INCOMPATIBLE_AUDIO_DRIVER: _NvAPI_Status = -189; +#[doc = "!< Value already set, setting again not allowed."] +pub const _NvAPI_Status_NVAPI_VALUE_ALREADY_SET: _NvAPI_Status = -190; +#[doc = "!< Requested operation timed out"] +pub const _NvAPI_Status_NVAPI_TIMEOUT: _NvAPI_Status = -191; +#[doc = "!< The requested workstation feature set has incomplete driver internal allocation resources"] +pub const _NvAPI_Status_NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE: _NvAPI_Status = -192; +#[doc = "!< Call failed because InitActivation was not called."] +pub const _NvAPI_Status_NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE: _NvAPI_Status = -193; +#[doc = "!< The requested action cannot be performed without Sync being enabled."] +pub const _NvAPI_Status_NVAPI_SYNC_NOT_ACTIVE: _NvAPI_Status = -194; +#[doc = "!< The requested action cannot be performed without Sync Master being enabled."] +pub const _NvAPI_Status_NVAPI_SYNC_MASTER_NOT_FOUND: _NvAPI_Status = -195; +#[doc = "!< Invalid displays passed in the NV_GSYNC_DISPLAY pointer."] +pub const _NvAPI_Status_NVAPI_INVALID_SYNC_TOPOLOGY: _NvAPI_Status = -196; +#[doc = "!< The specified signing algorithm is not supported. Either an incorrect value was entered or the current installed driver/hardware does not support the input value."] +pub const _NvAPI_Status_NVAPI_ECID_SIGN_ALGO_UNSUPPORTED: _NvAPI_Status = -197; +#[doc = "!< The encrypted public key verification has failed."] +pub const _NvAPI_Status_NVAPI_ECID_KEY_VERIFICATION_FAILED: _NvAPI_Status = -198; +#[doc = "!< The device's firmware is out of date."] +pub const _NvAPI_Status_NVAPI_FIRMWARE_OUT_OF_DATE: _NvAPI_Status = -199; +#[doc = "!< The device's firmware is not supported."] +pub const _NvAPI_Status_NVAPI_FIRMWARE_REVISION_NOT_SUPPORTED: _NvAPI_Status = -200; +#[doc = "!< The caller is not authorized to modify the License."] +pub const _NvAPI_Status_NVAPI_LICENSE_CALLER_AUTHENTICATION_FAILED: _NvAPI_Status = -201; +#[doc = "!< The user tried to use a deferred context without registering the device first"] +pub const _NvAPI_Status_NVAPI_D3D_DEVICE_NOT_REGISTERED: _NvAPI_Status = -202; +#[doc = "!< Head or SourceId was not reserved for the VR Display before doing the Modeset or the dedicated display."] +pub const _NvAPI_Status_NVAPI_RESOURCE_NOT_ACQUIRED: _NvAPI_Status = -203; +#[doc = "!< Provided timing is not supported."] +pub const _NvAPI_Status_NVAPI_TIMING_NOT_SUPPORTED: _NvAPI_Status = -204; +#[doc = "!< HDCP Encryption Failed for the device. Would be applicable when the device is HDCP Capable."] +pub const _NvAPI_Status_NVAPI_HDCP_ENCRYPTION_FAILED: _NvAPI_Status = -205; +#[doc = "!< Provided mode is over sink device pclk limitation."] +pub const _NvAPI_Status_NVAPI_PCLK_LIMITATION_FAILED: _NvAPI_Status = -206; +#[doc = "!< No connector on GPU found."] +pub const _NvAPI_Status_NVAPI_NO_CONNECTOR_FOUND: _NvAPI_Status = -207; +#[doc = "!< When a non-HDCP capable HMD is connected, we would inform user by this code."] +pub const _NvAPI_Status_NVAPI_HDCP_DISABLED: _NvAPI_Status = -208; +#[doc = "!< Atleast an API is still being called"] +pub const _NvAPI_Status_NVAPI_API_IN_USE: _NvAPI_Status = -209; +#[doc = "!< No display found on Nvidia GPU(s)."] +pub const _NvAPI_Status_NVAPI_NVIDIA_DISPLAY_NOT_FOUND: _NvAPI_Status = -210; +#[doc = "!< Priv security violation, improper access to a secured register."] +pub const _NvAPI_Status_NVAPI_PRIV_SEC_VIOLATION: _NvAPI_Status = -211; +#[doc = "!< NVAPI cannot be called by this vendor"] +pub const _NvAPI_Status_NVAPI_INCORRECT_VENDOR: _NvAPI_Status = -212; +#[doc = "!< DirectMode Display is already in use"] +pub const _NvAPI_Status_NVAPI_DISPLAY_IN_USE: _NvAPI_Status = -213; +#[doc = "!< The Config is having Non-NVidia GPU with Non-HDCP HMD connected"] +pub const _NvAPI_Status_NVAPI_UNSUPPORTED_CONFIG_NON_HDCP_HMD: _NvAPI_Status = -214; +#[doc = "!< GPU's Max Display Limit has Reached"] +pub const _NvAPI_Status_NVAPI_MAX_DISPLAY_LIMIT_REACHED: _NvAPI_Status = -215; +#[doc = "!< DirectMode not Enabled on the Display"] +pub const _NvAPI_Status_NVAPI_INVALID_DIRECT_MODE_DISPLAY: _NvAPI_Status = -216; +#[doc = "!< GPU is in debug mode, OC is NOT allowed."] +pub const _NvAPI_Status_NVAPI_GPU_IN_DEBUG_MODE: _NvAPI_Status = -217; +#[doc = "!< No NvAPI context was found for this D3D object"] +pub const _NvAPI_Status_NVAPI_D3D_CONTEXT_NOT_FOUND: _NvAPI_Status = -218; +#[doc = "!< there is version mismatch between stereo driver and dx driver"] +pub const _NvAPI_Status_NVAPI_STEREO_VERSION_MISMATCH: _NvAPI_Status = -219; +#[doc = "!< GPU is not powered and so the request cannot be completed."] +pub const _NvAPI_Status_NVAPI_GPU_NOT_POWERED: _NvAPI_Status = -220; +#[doc = "!< The display driver update in progress."] +pub const _NvAPI_Status_NVAPI_ERROR_DRIVER_RELOAD_IN_PROGRESS: _NvAPI_Status = -221; +#[doc = "!< Wait for HW resources allocation"] +pub const _NvAPI_Status_NVAPI_WAIT_FOR_HW_RESOURCE: _NvAPI_Status = -222; +#[doc = "!< operation requires further HDCP action"] +pub const _NvAPI_Status_NVAPI_REQUIRE_FURTHER_HDCP_ACTION: _NvAPI_Status = -223; +#[doc = "!< Dynamic Mux transition failure"] +pub const _NvAPI_Status_NVAPI_DISPLAY_MUX_TRANSITION_FAILED: _NvAPI_Status = -224; +#[doc = "!< Invalid DSC version"] +pub const _NvAPI_Status_NVAPI_INVALID_DSC_VERSION: _NvAPI_Status = -225; +#[doc = "!< Invalid DSC slice count"] +pub const _NvAPI_Status_NVAPI_INVALID_DSC_SLICECOUNT: _NvAPI_Status = -226; +#[doc = "!< Invalid DSC output BPP"] +pub const _NvAPI_Status_NVAPI_INVALID_DSC_OUTPUT_BPP: _NvAPI_Status = -227; +#[doc = "!< There was an error while loading nvapi.dll from the driver store."] +pub const _NvAPI_Status_NVAPI_FAILED_TO_LOAD_FROM_DRIVER_STORE: _NvAPI_Status = -228; +#[doc = "!< OpenGL does not export Vulkan fake extensions"] +pub const _NvAPI_Status_NVAPI_NO_VULKAN: _NvAPI_Status = -229; +#[doc = "!< A request for NvTOPPs telemetry CData has already been made and is pending a response."] +pub const _NvAPI_Status_NVAPI_REQUEST_PENDING: _NvAPI_Status = -230; +#[doc = "!< Operation cannot be performed because the resource is in use."] +pub const _NvAPI_Status_NVAPI_RESOURCE_IN_USE: _NvAPI_Status = -231; +#[doc = "!< Device kernel image is invalid"] +pub const _NvAPI_Status_NVAPI_INVALID_IMAGE: _NvAPI_Status = -232; +#[doc = "!< PTX JIT compilation failed"] +pub const _NvAPI_Status_NVAPI_INVALID_PTX: _NvAPI_Status = -233; +#[doc = "!< Uncorrectable NVLink error was detected during the execution"] +pub const _NvAPI_Status_NVAPI_NVLINK_UNCORRECTABLE: _NvAPI_Status = -234; +#[doc = "!< PTX JIT compiler library was not found."] +pub const _NvAPI_Status_NVAPI_JIT_COMPILER_NOT_FOUND: _NvAPI_Status = -235; +#[doc = "!< Device kernel source is invalid."] +pub const _NvAPI_Status_NVAPI_INVALID_SOURCE: _NvAPI_Status = -236; +#[doc = "!< While executing a kernel, the device encountered an illegal instruction."] +pub const _NvAPI_Status_NVAPI_ILLEGAL_INSTRUCTION: _NvAPI_Status = -237; +#[doc = "!< While executing a kernel, the device program counter wrapped its address space"] +pub const _NvAPI_Status_NVAPI_INVALID_PC: _NvAPI_Status = -238; +#[doc = "!< An exception occurred on the device while executing a kernel"] +pub const _NvAPI_Status_NVAPI_LAUNCH_FAILED: _NvAPI_Status = -239; +#[doc = "!< Attempted operation is not permitted."] +pub const _NvAPI_Status_NVAPI_NOT_PERMITTED: _NvAPI_Status = -240; +#[doc = "!< The callback function has already been registered."] +pub const _NvAPI_Status_NVAPI_CALLBACK_ALREADY_REGISTERED: _NvAPI_Status = -241; +#[doc = "!< The callback function is not found or not registered."] +pub const _NvAPI_Status_NVAPI_CALLBACK_NOT_FOUND: _NvAPI_Status = -242; +#[doc = "!< Invalid Wire Format for the VR HMD"] +pub const _NvAPI_Status_NVAPI_INVALID_OUTPUT_WIRE_FORMAT: _NvAPI_Status = -243; +#[doc = "! NvAPI Status Values\n! All NvAPI functions return one of these codes.\n! \\ingroup nvapistatus"] +pub type _NvAPI_Status = ::std::os::raw::c_int; +#[doc = "! NvAPI Status Values\n! All NvAPI functions return one of these codes.\n! \\ingroup nvapistatus"] +pub use self::_NvAPI_Status as NvAPI_Status; +#[doc = "! \\ingroup driverapi\n! Used in NvAPI_GPU_GetMemoryInfo()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_DISPLAY_DRIVER_MEMORY_INFO_V1 { + #[doc = "!< Version info"] + pub version: NvU32, + #[doc = "!< Size(in kb) of the physical framebuffer."] + pub dedicatedVideoMemory: NvU32, + #[doc = "!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces."] + pub availableDedicatedVideoMemory: NvU32, + #[doc = "!< Size(in kb) of system memory the driver allocates at load time."] + pub systemVideoMemory: NvU32, + #[doc = "!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations."] + pub sharedSystemMemory: NvU32, +} +#[doc = "! \\ingroup driverapi\n! Used in NvAPI_GPU_GetMemoryInfo()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_DISPLAY_DRIVER_MEMORY_INFO_V2 { + #[doc = "!< Version info"] + pub version: NvU32, + #[doc = "!< Size(in kb) of the physical framebuffer."] + pub dedicatedVideoMemory: NvU32, + #[doc = "!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces."] + pub availableDedicatedVideoMemory: NvU32, + #[doc = "!< Size(in kb) of system memory the driver allocates at load time."] + pub systemVideoMemory: NvU32, + #[doc = "!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations."] + pub sharedSystemMemory: NvU32, + #[doc = "!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces."] + pub curAvailableDedicatedVideoMemory: NvU32, +} +#[doc = "! \\ingroup driverapi\n! Used in NvAPI_GPU_GetMemoryInfo()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_DISPLAY_DRIVER_MEMORY_INFO_V3 { + #[doc = "!< Version info"] + pub version: NvU32, + #[doc = "!< Size(in kb) of the physical framebuffer."] + pub dedicatedVideoMemory: NvU32, + #[doc = "!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces."] + pub availableDedicatedVideoMemory: NvU32, + #[doc = "!< Size(in kb) of system memory the driver allocates at load time."] + pub systemVideoMemory: NvU32, + #[doc = "!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations."] + pub sharedSystemMemory: NvU32, + #[doc = "!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces."] + pub curAvailableDedicatedVideoMemory: NvU32, + #[doc = "!< Size(in kb) of the total size of memory released as a result of the evictions."] + pub dedicatedVideoMemoryEvictionsSize: NvU32, + #[doc = "!< Indicates the number of eviction events that caused an allocation to be removed from dedicated video memory to free GPU\n!< video memory to make room for other allocations."] + pub dedicatedVideoMemoryEvictionCount: NvU32, +} +#[doc = "! \\ingroup driverapi"] +pub type NV_DISPLAY_DRIVER_MEMORY_INFO = NV_DISPLAY_DRIVER_MEMORY_INFO_V3; +#[doc = "! \\ingroup driverapi\n! Used in NvAPI_GPU_GetMemoryInfoEx()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_MEMORY_INFO_EX_V1 { + #[doc = "!< Structure version"] + pub version: NvU32, + #[doc = "!< Size(in bytes) of the physical framebuffer. Refers to the dedicated video memory on discrete GPUs."] + pub dedicatedVideoMemory: NvU64, + #[doc = "!< Size(in bytes) of the available physical framebuffer for allocating video memory surfaces."] + pub availableDedicatedVideoMemory: NvU64, + #[doc = "!< Size(in bytes) of system memory the driver allocates at load time. It is a substitute for dedicated video memory.\n!< Typically used with integrated GPUs that do not have dedicated video memory."] + pub systemVideoMemory: NvU64, + #[doc = "!< Size(in bytes) of shared system memory that driver is allowed to commit for surfaces across all allocations.\n!< On discrete GPUs, it is used to utilize system memory for various operations. It does not need to be reserved during boot.\n!< It may be used by both GPU and CPU, and has an \"on-demand\" type of usage."] + pub sharedSystemMemory: NvU64, + #[doc = "!< Size(in bytes) of the current available physical framebuffer for allocating video memory surfaces."] + pub curAvailableDedicatedVideoMemory: NvU64, + #[doc = "!< Size(in bytes) of the total size of memory released as a result of the evictions."] + pub dedicatedVideoMemoryEvictionsSize: NvU64, + #[doc = "!< Indicates the number of eviction events that caused an allocation to be removed from dedicated video memory to free GPU\n!< video memory to make room for other allocations."] + pub dedicatedVideoMemoryEvictionCount: NvU64, + #[doc = "!< Size(in bytes) of the total size of memory allocated as a result of the promotions."] + pub dedicatedVideoMemoryPromotionsSize: NvU64, + #[doc = "!< Indicates the number of promotion events that caused an allocation to be promoted to dedicated video memory"] + pub dedicatedVideoMemoryPromotionCount: NvU64, +} +#[doc = "! \\ingroup driverapi"] +pub type NV_GPU_MEMORY_INFO_EX = NV_GPU_MEMORY_INFO_EX_V1; +#[doc = "! \\ingroup dx\n! Used in NvAPI_D3D10_GetCurrentSLIState(), and NvAPI_D3D_GetCurrentSLIState()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GET_CURRENT_SLI_STATE_V1 { + #[doc = "!< Structure version"] + pub version: NvU32, + #[doc = "!< [OUT] The maximum possible value of numAFRGroups"] + pub maxNumAFRGroups: NvU32, + #[doc = "!< [OUT] The number of AFR groups enabled in the system"] + pub numAFRGroups: NvU32, + #[doc = "!< [OUT] The AFR group index for the frame currently being rendered"] + pub currentAFRIndex: NvU32, + #[doc = "!< [OUT] What the AFR group index will be for the next frame (i.e. after calling Present)"] + pub nextFrameAFRIndex: NvU32, + #[doc = "!< [OUT] The AFR group index that was used for the previous frame (~0 if more than one frame has not been rendered yet)"] + pub previousFrameAFRIndex: NvU32, + #[doc = "!< [OUT] Boolean: Is this frame the first time running on the current AFR group"] + pub bIsCurAFRGroupNew: NvU32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GET_CURRENT_SLI_STATE_V2 { + #[doc = "!< Structure version"] + pub version: NvU32, + #[doc = "!< [OUT] The maximum possible value of numAFRGroups"] + pub maxNumAFRGroups: NvU32, + #[doc = "!< [OUT] The number of AFR groups enabled in the system"] + pub numAFRGroups: NvU32, + #[doc = "!< [OUT] The AFR group index for the frame currently being rendered"] + pub currentAFRIndex: NvU32, + #[doc = "!< [OUT] What the AFR group index will be for the next frame (i.e. after calling Present)"] + pub nextFrameAFRIndex: NvU32, + #[doc = "!< [OUT] The AFR group index that was used for the previous frame (~0 if more than one frame has not been rendered yet)"] + pub previousFrameAFRIndex: NvU32, + #[doc = "!< [OUT] Boolean: Is this frame the first time running on the current AFR group"] + pub bIsCurAFRGroupNew: NvU32, + #[doc = "!< [OUT] The number of GPUs used in VR-SLI. If it is 0 VR-SLI is not active"] + pub numVRSLIGpus: NvU32, +} +pub const _NV_StereoActiveEye_NVAPI_STEREO_EYE_RIGHT: _NV_StereoActiveEye = 1; +pub const _NV_StereoActiveEye_NVAPI_STEREO_EYE_LEFT: _NV_StereoActiveEye = 2; +pub const _NV_StereoActiveEye_NVAPI_STEREO_EYE_MONO: _NV_StereoActiveEye = 3; +#[doc = "! \\ingroup stereoapi"] +pub type _NV_StereoActiveEye = ::std::os::raw::c_int; +#[doc = "! \\ingroup stereoapi"] +pub use self::_NV_StereoActiveEye as NV_STEREO_ACTIVE_EYE; +pub const _NV_StereoDriverMode_NVAPI_STEREO_DRIVER_MODE_AUTOMATIC: _NV_StereoDriverMode = 0; +pub const _NV_StereoDriverMode_NVAPI_STEREO_DRIVER_MODE_DIRECT: _NV_StereoDriverMode = 2; +#[doc = "! \\ingroup stereoapi"] +pub type _NV_StereoDriverMode = ::std::os::raw::c_int; +#[doc = "! \\ingroup stereoapi"] +pub use self::_NV_StereoDriverMode as NV_STEREO_DRIVER_MODE; +pub const _NV_DP_LINK_RATE_NV_DP_1_62GBPS: _NV_DP_LINK_RATE = 6; +pub const _NV_DP_LINK_RATE_NV_DP_2_70GBPS: _NV_DP_LINK_RATE = 10; +pub const _NV_DP_LINK_RATE_NV_DP_5_40GBPS: _NV_DP_LINK_RATE = 20; +pub const _NV_DP_LINK_RATE_NV_DP_8_10GBPS: _NV_DP_LINK_RATE = 30; +pub const _NV_DP_LINK_RATE_NV_EDP_2_16GBPS: _NV_DP_LINK_RATE = 8; +pub const _NV_DP_LINK_RATE_NV_EDP_2_43GBPS: _NV_DP_LINK_RATE = 9; +pub const _NV_DP_LINK_RATE_NV_EDP_3_24GBPS: _NV_DP_LINK_RATE = 12; +pub const _NV_DP_LINK_RATE_NV_EDP_4_32GBPS: _NV_DP_LINK_RATE = 16; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub type _NV_DP_LINK_RATE = ::std::os::raw::c_int; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub use self::_NV_DP_LINK_RATE as NV_DP_LINK_RATE; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_1_62Gbps: _NV_DP2X_LINK_RATE = 162; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_2_16Gbps: _NV_DP2X_LINK_RATE = 216; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_2_43Gbps: _NV_DP2X_LINK_RATE = 243; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_2_50Gbps: _NV_DP2X_LINK_RATE = 250; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_2_70Gbps: _NV_DP2X_LINK_RATE = 270; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_3_24Gbps: _NV_DP2X_LINK_RATE = 324; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_4_32Gbps: _NV_DP2X_LINK_RATE = 432; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_5_40Gbps: _NV_DP2X_LINK_RATE = 540; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_6_75Gbps: _NV_DP2X_LINK_RATE = 675; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_8_10Gbps: _NV_DP2X_LINK_RATE = 810; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_10_0Gbps: _NV_DP2X_LINK_RATE = 1000; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_13_5Gbps: _NV_DP2X_LINK_RATE = 1350; +pub const _NV_DP2X_LINK_RATE_NV_DP2X_20_0Gbps: _NV_DP2X_LINK_RATE = 2000; +pub type _NV_DP2X_LINK_RATE = ::std::os::raw::c_int; +pub use self::_NV_DP2X_LINK_RATE as NV_DP2X_LINK_RATE; +pub const _NV_DP_LANE_COUNT_NV_DP_1_LANE: _NV_DP_LANE_COUNT = 1; +pub const _NV_DP_LANE_COUNT_NV_DP_2_LANE: _NV_DP_LANE_COUNT = 2; +pub const _NV_DP_LANE_COUNT_NV_DP_4_LANE: _NV_DP_LANE_COUNT = 4; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub type _NV_DP_LANE_COUNT = ::std::os::raw::c_int; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub use self::_NV_DP_LANE_COUNT as NV_DP_LANE_COUNT; +pub const _NV_DP_COLOR_FORMAT_NV_DP_COLOR_FORMAT_RGB: _NV_DP_COLOR_FORMAT = 0; +pub const _NV_DP_COLOR_FORMAT_NV_DP_COLOR_FORMAT_YCbCr422: _NV_DP_COLOR_FORMAT = 1; +pub const _NV_DP_COLOR_FORMAT_NV_DP_COLOR_FORMAT_YCbCr444: _NV_DP_COLOR_FORMAT = 2; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub type _NV_DP_COLOR_FORMAT = ::std::os::raw::c_int; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub use self::_NV_DP_COLOR_FORMAT as NV_DP_COLOR_FORMAT; +pub const _NV_DP_COLORIMETRY_NV_DP_COLORIMETRY_RGB: _NV_DP_COLORIMETRY = 0; +pub const _NV_DP_COLORIMETRY_NV_DP_COLORIMETRY_YCbCr_ITU601: _NV_DP_COLORIMETRY = 1; +pub const _NV_DP_COLORIMETRY_NV_DP_COLORIMETRY_YCbCr_ITU709: _NV_DP_COLORIMETRY = 2; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub type _NV_DP_COLORIMETRY = ::std::os::raw::c_int; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub use self::_NV_DP_COLORIMETRY as NV_DP_COLORIMETRY; +pub const _NV_DP_DYNAMIC_RANGE_NV_DP_DYNAMIC_RANGE_VESA: _NV_DP_DYNAMIC_RANGE = 0; +pub const _NV_DP_DYNAMIC_RANGE_NV_DP_DYNAMIC_RANGE_CEA: _NV_DP_DYNAMIC_RANGE = 1; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub type _NV_DP_DYNAMIC_RANGE = ::std::os::raw::c_int; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub use self::_NV_DP_DYNAMIC_RANGE as NV_DP_DYNAMIC_RANGE; +pub const _NV_DP_BPC_NV_DP_BPC_DEFAULT: _NV_DP_BPC = 0; +pub const _NV_DP_BPC_NV_DP_BPC_6: _NV_DP_BPC = 1; +pub const _NV_DP_BPC_NV_DP_BPC_8: _NV_DP_BPC = 2; +pub const _NV_DP_BPC_NV_DP_BPC_10: _NV_DP_BPC = 3; +pub const _NV_DP_BPC_NV_DP_BPC_12: _NV_DP_BPC = 4; +pub const _NV_DP_BPC_NV_DP_BPC_16: _NV_DP_BPC = 5; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub type _NV_DP_BPC = ::std::os::raw::c_int; +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PORT_INFO."] +pub use self::_NV_DP_BPC as NV_DP_BPC; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_EDID_V1 { + pub version: NvU32, + pub EDID_Data: [NvU8; 256usize], +} +#[doc = "! Used in NvAPI_GPU_GetEDID()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_EDID_V2 { + #[doc = "!< Structure version"] + pub version: NvU32, + pub EDID_Data: [NvU8; 256usize], + pub sizeofEDID: NvU32, +} +#[doc = "! Used in NvAPI_GPU_GetEDID()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_EDID_V3 { + #[doc = "!< Structure version"] + pub version: NvU32, + pub EDID_Data: [NvU8; 256usize], + pub sizeofEDID: NvU32, + #[doc = "!< ID which always returned in a monotonically increasing counter.\n!< Across a split-EDID read we need to verify that all calls returned the same edidId.\n!< This counter is incremented if we get the updated EDID."] + pub edidId: NvU32, + #[doc = "!< Which 256-byte page of the EDID we want to read. Start at 0.\n!< If the read succeeds with edidSize > NV_EDID_DATA_SIZE,\n!< call back again with offset+256 until we have read the entire buffer"] + pub offset: NvU32, +} +#[doc = "! Used in NvAPI_GPU_GetEDID()"] +pub type NV_EDID = NV_EDID_V3; +#[doc = "!< the EDID which is actively used by the driver, it could be _RAW/_COOKED/_FORCED/_INF."] +pub const NV_EDID_FLAG_NV_EDID_FLAG_DEFAULT: NV_EDID_FLAG = 0; +#[doc = "!< the EDID which is not modified by the driver. If there's no _FORCED edid engaged, it\n!< will be the unmodified monitor EDID from the I2C bus. Otherwise it is original _FORCED edid."] +pub const NV_EDID_FLAG_NV_EDID_FLAG_RAW: NV_EDID_FLAG = 1; +#[doc = "!< the EDID has been modified by the driver for compatibility"] +pub const NV_EDID_FLAG_NV_EDID_FLAG_COOKED: NV_EDID_FLAG = 2; +#[doc = "!< the EDID is forced by the end-user over s/w interface,"] +pub const NV_EDID_FLAG_NV_EDID_FLAG_FORCED: NV_EDID_FLAG = 3; +#[doc = "!< the EDID is from monitor INF"] +pub const NV_EDID_FLAG_NV_EDID_FLAG_INF: NV_EDID_FLAG = 4; +#[doc = "!< the EDID is from the monitor over I2C bus without any modification."] +pub const NV_EDID_FLAG_NV_EDID_FLAG_HW: NV_EDID_FLAG = 5; +pub type NV_EDID_FLAG = ::std::os::raw::c_int; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_VGA_15_PIN: _NV_GPU_CONNECTOR_TYPE = 0; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_TV_COMPOSITE: _NV_GPU_CONNECTOR_TYPE = 16; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_TV_SVIDEO: _NV_GPU_CONNECTOR_TYPE = 17; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_TV_HDTV_COMPONENT: _NV_GPU_CONNECTOR_TYPE = 19; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_TV_SCART: _NV_GPU_CONNECTOR_TYPE = 20; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_TV_COMPOSITE_SCART_ON_EIAJ4120: + _NV_GPU_CONNECTOR_TYPE = 22; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_TV_HDTV_EIAJ4120: _NV_GPU_CONNECTOR_TYPE = 23; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_PC_POD_HDTV_YPRPB: _NV_GPU_CONNECTOR_TYPE = 24; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_PC_POD_SVIDEO: _NV_GPU_CONNECTOR_TYPE = 25; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_PC_POD_COMPOSITE: _NV_GPU_CONNECTOR_TYPE = 26; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_DVI_I_TV_SVIDEO: _NV_GPU_CONNECTOR_TYPE = 32; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_DVI_I_TV_COMPOSITE: _NV_GPU_CONNECTOR_TYPE = + 33; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_DVI_I: _NV_GPU_CONNECTOR_TYPE = 48; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_DVI_D: _NV_GPU_CONNECTOR_TYPE = 49; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_ADC: _NV_GPU_CONNECTOR_TYPE = 50; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_LFH_DVI_I_1: _NV_GPU_CONNECTOR_TYPE = 56; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_LFH_DVI_I_2: _NV_GPU_CONNECTOR_TYPE = 57; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_SPWG: _NV_GPU_CONNECTOR_TYPE = 64; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_OEM: _NV_GPU_CONNECTOR_TYPE = 65; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_DISPLAYPORT_EXTERNAL: _NV_GPU_CONNECTOR_TYPE = + 70; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_DISPLAYPORT_INTERNAL: _NV_GPU_CONNECTOR_TYPE = + 71; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_DISPLAYPORT_MINI_EXT: _NV_GPU_CONNECTOR_TYPE = + 72; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_HDMI_A: _NV_GPU_CONNECTOR_TYPE = 97; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_HDMI_C_MINI: _NV_GPU_CONNECTOR_TYPE = 99; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_1: _NV_GPU_CONNECTOR_TYPE = + 100; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_2: _NV_GPU_CONNECTOR_TYPE = + 101; +#[doc = "!< Deprecated."] +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_VIRTUAL_WFD: _NV_GPU_CONNECTOR_TYPE = 112; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_USB_C: _NV_GPU_CONNECTOR_TYPE = 113; +pub const _NV_GPU_CONNECTOR_TYPE_NVAPI_GPU_CONNECTOR_UNKNOWN: _NV_GPU_CONNECTOR_TYPE = -1; +#[doc = "! \\ingroup gpu\n! Used in NV_GPU_CONNECTOR_DATA"] +pub type _NV_GPU_CONNECTOR_TYPE = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpu\n! Used in NV_GPU_CONNECTOR_DATA"] +pub use self::_NV_GPU_CONNECTOR_TYPE as NV_GPU_CONNECTOR_TYPE; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_NONE: _NV_DISPLAY_TV_FORMAT = 0; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_SD_NTSCM: _NV_DISPLAY_TV_FORMAT = 1; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_SD_NTSCJ: _NV_DISPLAY_TV_FORMAT = 2; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_SD_PALM: _NV_DISPLAY_TV_FORMAT = 4; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_SD_PALBDGH: _NV_DISPLAY_TV_FORMAT = 8; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_SD_PALN: _NV_DISPLAY_TV_FORMAT = 16; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_SD_PALNC: _NV_DISPLAY_TV_FORMAT = 32; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_SD_576i: _NV_DISPLAY_TV_FORMAT = 256; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_SD_480i: _NV_DISPLAY_TV_FORMAT = 512; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_ED_480p: _NV_DISPLAY_TV_FORMAT = 1024; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_ED_576p: _NV_DISPLAY_TV_FORMAT = 2048; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_HD_720p: _NV_DISPLAY_TV_FORMAT = 4096; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_HD_1080i: _NV_DISPLAY_TV_FORMAT = 8192; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_HD_1080p: _NV_DISPLAY_TV_FORMAT = 16384; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_HD_720p50: _NV_DISPLAY_TV_FORMAT = 32768; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_HD_1080p24: _NV_DISPLAY_TV_FORMAT = 65536; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_HD_1080i50: _NV_DISPLAY_TV_FORMAT = 131072; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_HD_1080p50: _NV_DISPLAY_TV_FORMAT = 262144; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp30: _NV_DISPLAY_TV_FORMAT = 524288; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp30_3840: _NV_DISPLAY_TV_FORMAT = 524288; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp25: _NV_DISPLAY_TV_FORMAT = 1048576; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp25_3840: _NV_DISPLAY_TV_FORMAT = + 1048576; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp24: _NV_DISPLAY_TV_FORMAT = 2097152; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp24_3840: _NV_DISPLAY_TV_FORMAT = + 2097152; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp24_SMPTE: _NV_DISPLAY_TV_FORMAT = + 4194304; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp50_3840: _NV_DISPLAY_TV_FORMAT = + 8388608; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp60_3840: _NV_DISPLAY_TV_FORMAT = + 9437184; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp30_4096: _NV_DISPLAY_TV_FORMAT = + 10485760; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp25_4096: _NV_DISPLAY_TV_FORMAT = + 11534336; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp24_4096: _NV_DISPLAY_TV_FORMAT = + 12582912; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp50_4096: _NV_DISPLAY_TV_FORMAT = + 13631488; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp60_4096: _NV_DISPLAY_TV_FORMAT = + 14680064; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_8Kp24_7680: _NV_DISPLAY_TV_FORMAT = + 16777216; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_8Kp25_7680: _NV_DISPLAY_TV_FORMAT = + 33554432; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_8Kp30_7680: _NV_DISPLAY_TV_FORMAT = + 67108864; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_8Kp48_7680: _NV_DISPLAY_TV_FORMAT = + 134217728; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_8Kp50_7680: _NV_DISPLAY_TV_FORMAT = + 150994944; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_8Kp60_7680: _NV_DISPLAY_TV_FORMAT = + 167772160; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_8Kp100_7680: _NV_DISPLAY_TV_FORMAT = + 184549376; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_8Kp120_7680: _NV_DISPLAY_TV_FORMAT = + 201326592; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp48_3840: _NV_DISPLAY_TV_FORMAT = + 218103808; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp48_4096: _NV_DISPLAY_TV_FORMAT = + 234881024; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp100_4096: _NV_DISPLAY_TV_FORMAT = + 251658240; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp100_3840: _NV_DISPLAY_TV_FORMAT = + 268435456; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp120_4096: _NV_DISPLAY_TV_FORMAT = + 285212672; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp120_3840: _NV_DISPLAY_TV_FORMAT = + 301989888; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp100_5120: _NV_DISPLAY_TV_FORMAT = + 318767104; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp120_5120: _NV_DISPLAY_TV_FORMAT = + 335544320; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp24_5120: _NV_DISPLAY_TV_FORMAT = + 352321536; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp25_5120: _NV_DISPLAY_TV_FORMAT = + 369098752; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp30_5120: _NV_DISPLAY_TV_FORMAT = + 385875968; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp48_5120: _NV_DISPLAY_TV_FORMAT = + 402653184; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp50_5120: _NV_DISPLAY_TV_FORMAT = + 419430400; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_4Kp60_5120: _NV_DISPLAY_TV_FORMAT = + 536870912; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_10Kp24_10240: _NV_DISPLAY_TV_FORMAT = + 553648128; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_10Kp25_10240: _NV_DISPLAY_TV_FORMAT = + 570425344; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_10Kp30_10240: _NV_DISPLAY_TV_FORMAT = + 587202560; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_10Kp48_10240: _NV_DISPLAY_TV_FORMAT = + 603979776; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_10Kp50_10240: _NV_DISPLAY_TV_FORMAT = + 620756992; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_10Kp60_10240: _NV_DISPLAY_TV_FORMAT = + 637534208; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_10Kp100_10240: _NV_DISPLAY_TV_FORMAT = + 654311424; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_UHD_10Kp120_10240: _NV_DISPLAY_TV_FORMAT = + 671088640; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_SD_OTHER: _NV_DISPLAY_TV_FORMAT = 805306368; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_ED_OTHER: _NV_DISPLAY_TV_FORMAT = 1073741824; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_HD_OTHER: _NV_DISPLAY_TV_FORMAT = 1342177280; +pub const _NV_DISPLAY_TV_FORMAT_NV_DISPLAY_TV_FORMAT_ANY: _NV_DISPLAY_TV_FORMAT = -2147483648; +#[doc = "! \\ingroup tvapi\n! Used in NV_DISPLAY_TV_OUTPUT_INFO"] +pub type _NV_DISPLAY_TV_FORMAT = ::std::os::raw::c_int; +#[doc = "! \\ingroup tvapi\n! Used in NV_DISPLAY_TV_OUTPUT_INFO"] +pub use self::_NV_DISPLAY_TV_FORMAT as NV_DISPLAY_TV_FORMAT; +pub const _NV_TARGET_VIEW_MODE_NV_VIEW_MODE_STANDARD: _NV_TARGET_VIEW_MODE = 0; +pub const _NV_TARGET_VIEW_MODE_NV_VIEW_MODE_CLONE: _NV_TARGET_VIEW_MODE = 1; +pub const _NV_TARGET_VIEW_MODE_NV_VIEW_MODE_HSPAN: _NV_TARGET_VIEW_MODE = 2; +pub const _NV_TARGET_VIEW_MODE_NV_VIEW_MODE_VSPAN: _NV_TARGET_VIEW_MODE = 3; +pub const _NV_TARGET_VIEW_MODE_NV_VIEW_MODE_DUALVIEW: _NV_TARGET_VIEW_MODE = 4; +pub const _NV_TARGET_VIEW_MODE_NV_VIEW_MODE_MULTIVIEW: _NV_TARGET_VIEW_MODE = 5; +#[doc = "! Used in NvAPI_SetView()."] +pub type _NV_TARGET_VIEW_MODE = ::std::os::raw::c_int; +#[doc = "! Used in NvAPI_SetView()."] +pub use self::_NV_TARGET_VIEW_MODE as NV_TARGET_VIEW_MODE; +#[doc = "!< No change"] +pub const _NV_SCALING_NV_SCALING_DEFAULT: _NV_SCALING = 0; +#[doc = "!< Balanced - Full Screen"] +pub const _NV_SCALING_NV_SCALING_GPU_SCALING_TO_CLOSEST: _NV_SCALING = 1; +#[doc = "!< Force GPU - Full Screen"] +pub const _NV_SCALING_NV_SCALING_GPU_SCALING_TO_NATIVE: _NV_SCALING = 2; +#[doc = "!< Force GPU - Centered\\No Scaling"] +pub const _NV_SCALING_NV_SCALING_GPU_SCANOUT_TO_NATIVE: _NV_SCALING = 3; +#[doc = "!< Force GPU - Aspect Ratio"] +pub const _NV_SCALING_NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE: _NV_SCALING = 5; +#[doc = "!< Balanced - Aspect Ratio"] +pub const _NV_SCALING_NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_CLOSEST: _NV_SCALING = 6; +#[doc = "!< Balanced - Centered\\No Scaling"] +pub const _NV_SCALING_NV_SCALING_GPU_SCANOUT_TO_CLOSEST: _NV_SCALING = 7; +#[doc = "!< Force GPU - Integer Scaling"] +pub const _NV_SCALING_NV_SCALING_GPU_INTEGER_ASPECT_SCALING: _NV_SCALING = 8; +pub const _NV_SCALING_NV_SCALING_MONITOR_SCALING: _NV_SCALING = 1; +pub const _NV_SCALING_NV_SCALING_ADAPTER_SCALING: _NV_SCALING = 2; +pub const _NV_SCALING_NV_SCALING_CENTERED: _NV_SCALING = 3; +pub const _NV_SCALING_NV_SCALING_ASPECT_SCALING: _NV_SCALING = 5; +#[doc = "!< For future use"] +pub const _NV_SCALING_NV_SCALING_CUSTOMIZED: _NV_SCALING = 255; +#[doc = "! Scaling modes - used in NvAPI_SetViewEx().\n! \\ingroup dispcontrol"] +pub type _NV_SCALING = ::std::os::raw::c_int; +#[doc = "! Scaling modes - used in NvAPI_SetViewEx().\n! \\ingroup dispcontrol"] +pub use self::_NV_SCALING as NV_SCALING; +pub const _NV_ROTATE_NV_ROTATE_0: _NV_ROTATE = 0; +pub const _NV_ROTATE_NV_ROTATE_90: _NV_ROTATE = 1; +pub const _NV_ROTATE_NV_ROTATE_180: _NV_ROTATE = 2; +pub const _NV_ROTATE_NV_ROTATE_270: _NV_ROTATE = 3; +pub const _NV_ROTATE_NV_ROTATE_IGNORED: _NV_ROTATE = 4; +#[doc = "! \\ingroup dispcontrol"] +pub type _NV_ROTATE = ::std::os::raw::c_int; +#[doc = "! \\ingroup dispcontrol"] +pub use self::_NV_ROTATE as NV_ROTATE; +#[doc = "!< unknown. Driver will choose one as following value."] +pub const _NV_FORMAT_NV_FORMAT_UNKNOWN: _NV_FORMAT = 0; +#[doc = "!< for 8bpp mode"] +pub const _NV_FORMAT_NV_FORMAT_P8: _NV_FORMAT = 41; +#[doc = "!< for 16bpp mode"] +pub const _NV_FORMAT_NV_FORMAT_R5G6B5: _NV_FORMAT = 23; +#[doc = "!< for 32bpp mode"] +pub const _NV_FORMAT_NV_FORMAT_A8R8G8B8: _NV_FORMAT = 21; +#[doc = "!< for 64bpp(floating point) mode."] +pub const _NV_FORMAT_NV_FORMAT_A16B16G16R16F: _NV_FORMAT = 113; +#[doc = "! Color formats- used in NvAPI_SetViewEx().\n! \\ingroup dispcontrol"] +pub type _NV_FORMAT = ::std::os::raw::c_int; +#[doc = "! Color formats- used in NvAPI_SetViewEx().\n! \\ingroup dispcontrol"] +pub use self::_NV_FORMAT as NV_FORMAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_VIEWPORTF { + #[doc = "!< x-coordinate of the viewport top-left point"] + pub x: f32, + #[doc = "!< y-coordinate of the viewport top-left point"] + pub y: f32, + #[doc = "!< Width of the viewport"] + pub w: f32, + #[doc = "!< Height of the viewport"] + pub h: f32, +} +#[doc = "!< get the current timing"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_CURRENT: _NV_TIMING_OVERRIDE = 0; +#[doc = "!< the timing the driver will use based the current policy"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_AUTO: _NV_TIMING_OVERRIDE = 1; +#[doc = "!< EDID timing"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_EDID: _NV_TIMING_OVERRIDE = 2; +#[doc = "!< VESA DMT timing"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_DMT: _NV_TIMING_OVERRIDE = 3; +#[doc = "!< VESA DMT timing with reduced blanking"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_DMT_RB: _NV_TIMING_OVERRIDE = 4; +#[doc = "!< VESA CVT timing"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_CVT: _NV_TIMING_OVERRIDE = 5; +#[doc = "!< VESA CVT timing with reduced blanking"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_CVT_RB: _NV_TIMING_OVERRIDE = 6; +#[doc = "!< VESA GTF timing"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_GTF: _NV_TIMING_OVERRIDE = 7; +#[doc = "!< EIA 861x pre-defined timing"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_EIA861: _NV_TIMING_OVERRIDE = 8; +#[doc = "!< analog SD/HDTV timing"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_ANALOG_TV: _NV_TIMING_OVERRIDE = 9; +#[doc = "!< NV custom timings"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_CUST: _NV_TIMING_OVERRIDE = 10; +#[doc = "!< NV pre-defined timing (basically the PsF timings)"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_NV_PREDEFINED: _NV_TIMING_OVERRIDE = 11; +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_NV_PSF: _NV_TIMING_OVERRIDE = 11; +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_NV_ASPR: _NV_TIMING_OVERRIDE = 12; +#[doc = "!< Override for SDI timing"] +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVERRIDE_SDI: _NV_TIMING_OVERRIDE = 13; +pub const _NV_TIMING_OVERRIDE_NV_TIMING_OVRRIDE_MAX: _NV_TIMING_OVERRIDE = 14; +#[doc = "! \\ingroup dispcontrol\n! The timing override is not supported yet; must be set to _AUTO. \\n"] +pub type _NV_TIMING_OVERRIDE = ::std::os::raw::c_int; +#[doc = "! \\ingroup dispcontrol\n! The timing override is not supported yet; must be set to _AUTO. \\n"] +pub use self::_NV_TIMING_OVERRIDE as NV_TIMING_OVERRIDE; +#[doc = "! \\ingroup dispcontrol\n! NVIDIA-specific timing extras \\n\n! Used in NV_TIMING."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagNV_TIMINGEXT { + #[doc = "!< Reserved for NVIDIA hardware-based enhancement, such as double-scan."] + pub flag: NvU32, + #[doc = "!< Logical refresh rate to present"] + pub rr: NvU16, + #[doc = "!< Physical vertical refresh rate in 0.001Hz"] + pub rrx1k: NvU32, + #[doc = "!< Display aspect ratio Hi(aspect):horizontal-aspect, Low(aspect):vertical-aspect"] + pub aspect: NvU32, + #[doc = "!< Bit-wise pixel repetition factor: 0x1:no pixel repetition; 0x2:each pixel repeats twice horizontally,.."] + pub rep: NvU16, + #[doc = "!< Timing standard"] + pub status: NvU32, + #[doc = "!< Timing name"] + pub name: [NvU8; 40usize], +} +#[doc = "! \\ingroup dispcontrol\n! NVIDIA-specific timing extras \\n\n! Used in NV_TIMING."] +pub type NV_TIMINGEXT = tagNV_TIMINGEXT; +#[doc = "! \\ingroup dispcontrol\n!The very basic timing structure based on the VESA standard:\n! \\code\n! |<----------------------------htotal--------------------------->|\n! ---------\"active\" video-------->|<-------blanking------>|<-----\n! |<-------hvisible-------->|<-hb->|<-hfp->|<-hsw->|<-hbp->|<-hb->|\n! --------- -+-------------------------+ | | | | |\n! A A | | | | | | |\n! : : | | | | | | |\n! : : | | | | | | |\n! :vertical| addressable video | | | | | |\n! : visible| | | | | | |\n! : : | | | | | | |\n! : : | | | | | | |\n! vertical V | | | | | | |\n! total --+-------------------------+ | | | | |\n! : vb border | | | | |\n! : -----------------------------------+ | | | |\n! : vfp front porch | | | |\n! : -------------------------------------------+ | | |\n! : vsw sync width | | |\n! : ---------------------------------------------------+ | |\n! : vbp back porch | |\n! : -----------------------------------------------------------+ |\n! V vb border |\n! ---------------------------------------------------------------------------+\n! \\endcode"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_TIMING { + #[doc = "!< horizontal visible"] + pub HVisible: NvU16, + #[doc = "!< horizontal border"] + pub HBorder: NvU16, + #[doc = "!< horizontal front porch"] + pub HFrontPorch: NvU16, + #[doc = "!< horizontal sync width"] + pub HSyncWidth: NvU16, + #[doc = "!< horizontal total"] + pub HTotal: NvU16, + #[doc = "!< horizontal sync polarity: 1-negative, 0-positive"] + pub HSyncPol: NvU8, + #[doc = "!< vertical visible"] + pub VVisible: NvU16, + #[doc = "!< vertical border"] + pub VBorder: NvU16, + #[doc = "!< vertical front porch"] + pub VFrontPorch: NvU16, + #[doc = "!< vertical sync width"] + pub VSyncWidth: NvU16, + #[doc = "!< vertical total"] + pub VTotal: NvU16, + #[doc = "!< vertical sync polarity: 1-negative, 0-positive"] + pub VSyncPol: NvU8, + #[doc = "!< 1-interlaced, 0-progressive"] + pub interlaced: NvU16, + #[doc = "!< pixel clock in 10 kHz"] + pub pclk: NvU32, + pub etc: NV_TIMINGEXT, +} +#[doc = "! \\ingroup dispcontrol\n!The very basic timing structure based on the VESA standard:\n! \\code\n! |<----------------------------htotal--------------------------->|\n! ---------\"active\" video-------->|<-------blanking------>|<-----\n! |<-------hvisible-------->|<-hb->|<-hfp->|<-hsw->|<-hbp->|<-hb->|\n! --------- -+-------------------------+ | | | | |\n! A A | | | | | | |\n! : : | | | | | | |\n! : : | | | | | | |\n! :vertical| addressable video | | | | | |\n! : visible| | | | | | |\n! : : | | | | | | |\n! : : | | | | | | |\n! vertical V | | | | | | |\n! total --+-------------------------+ | | | | |\n! : vb border | | | | |\n! : -----------------------------------+ | | | |\n! : vfp front porch | | | |\n! : -------------------------------------------+ | | |\n! : vsw sync width | | |\n! : ---------------------------------------------------+ | |\n! : vbp back porch | |\n! : -----------------------------------------------------------+ |\n! V vb border |\n! ---------------------------------------------------------------------------+\n! \\endcode"] +pub type NV_TIMING = _NV_TIMING; +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_SetView() and NvAPI_GetView()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_VIEW_TARGET_INFO { + #[doc = "!< (IN) structure version"] + pub version: NvU32, + #[doc = "!< (IN) target count"] + pub count: NvU32, + pub target: [NV_VIEW_TARGET_INFO__bindgen_ty_1; 2usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_VIEW_TARGET_INFO__bindgen_ty_1 { + #[doc = "!< (IN/OUT) Device mask"] + pub deviceMask: NvU32, + #[doc = "!< (IN/OUT) Source ID - values will be based on the number of heads exposed per GPU."] + pub sourceId: NvU32, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub __bindgen_padding_0: [u8; 3usize], +} +impl NV_VIEW_TARGET_INFO__bindgen_ty_1 { + #[inline] + pub fn bPrimary(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bPrimary(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bPrimary_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bPrimary_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bInterlaced(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_bInterlaced(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bInterlaced_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bInterlaced_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bGDIPrimary(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_bGDIPrimary(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bGDIPrimary_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bGDIPrimary_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bForceModeSet(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_bForceModeSet(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bForceModeSet_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bForceModeSet_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bPrimary: NvU32, + bInterlaced: NvU32, + bGDIPrimary: NvU32, + bForceModeSet: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bPrimary: u32 = unsafe { ::std::mem::transmute(bPrimary) }; + bPrimary as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let bInterlaced: u32 = unsafe { ::std::mem::transmute(bInterlaced) }; + bInterlaced as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let bGDIPrimary: u32 = unsafe { ::std::mem::transmute(bGDIPrimary) }; + bGDIPrimary as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let bForceModeSet: u32 = unsafe { ::std::mem::transmute(bForceModeSet) }; + bForceModeSet as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup dispcontrol\n! Used in NV_DISPLAY_PATH_INFO."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_DISPLAY_PATH { + #[doc = "!< (IN) Device mask"] + pub deviceMask: NvU32, + #[doc = "!< (IN) Values will be based on the number of heads exposed per GPU(0, 1?)"] + pub sourceId: NvU32, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + #[doc = "!< (IN) Specify connector type. For TV only."] + pub connector: NV_GPU_CONNECTOR_TYPE, + #[doc = "!< (IN) Width of the mode"] + pub width: NvU32, + #[doc = "!< (IN) Height of the mode"] + pub height: NvU32, + #[doc = "!< (IN) Depth of the mode"] + pub depth: NvU32, + #[doc = "!< Color format if it needs to be specified. Not used now."] + pub colorFormat: NV_FORMAT, + #[doc = "!< (IN) Rotation setting."] + pub rotation: NV_ROTATE, + #[doc = "!< (IN) Scaling setting"] + pub scaling: NV_SCALING, + #[doc = "!< (IN) Refresh rate of the mode"] + pub refreshRate: NvU32, + pub _bitfield_align_2: [u8; 0], + pub _bitfield_2: __BindgenBitfieldUnit<[u8; 1usize]>, + #[doc = "!< (IN) To choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE"] + pub tvFormat: NV_DISPLAY_TV_FORMAT, + #[doc = "!< (IN/OUT) X-offset of this display on the Windows desktop"] + pub posx: NvU32, + #[doc = "!< (IN/OUT) Y-offset of this display on the Windows desktop"] + pub posy: NvU32, + pub _bitfield_align_3: [u32; 0], + pub _bitfield_3: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl NV_DISPLAY_PATH { + #[inline] + pub fn bPrimary(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bPrimary(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bPrimary_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bPrimary_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1(bPrimary: NvU32) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bPrimary: u32 = unsafe { ::std::mem::transmute(bPrimary) }; + bPrimary as u64 + }); + __bindgen_bitfield_unit + } + #[inline] + pub fn interlaced(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_interlaced(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_2.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn interlaced_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_2), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_interlaced_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_2), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_2(interlaced: NvU32) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let interlaced: u32 = unsafe { ::std::mem::transmute(interlaced) }; + interlaced as u64 + }); + __bindgen_bitfield_unit + } + #[inline] + pub fn bGDIPrimary(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_3.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bGDIPrimary(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_3.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bGDIPrimary_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_3), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bGDIPrimary_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_3), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bForceModeSet(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_3.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_bForceModeSet(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_3.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bForceModeSet_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_3), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bForceModeSet_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_3), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bFocusDisplay(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_3.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_bFocusDisplay(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_3.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bFocusDisplay_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_3), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bFocusDisplay_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_3), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn gpuId(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_3.get(3usize, 24u8) as u32) } + } + #[inline] + pub fn set_gpuId(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_3.set(3usize, 24u8, val as u64) + } + } + #[inline] + pub unsafe fn gpuId_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_3), + 3usize, + 24u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_gpuId_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_3), + 3usize, + 24u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_3( + bGDIPrimary: NvU32, + bForceModeSet: NvU32, + bFocusDisplay: NvU32, + gpuId: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bGDIPrimary: u32 = unsafe { ::std::mem::transmute(bGDIPrimary) }; + bGDIPrimary as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let bForceModeSet: u32 = unsafe { ::std::mem::transmute(bForceModeSet) }; + bForceModeSet as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let bFocusDisplay: u32 = unsafe { ::std::mem::transmute(bFocusDisplay) }; + bFocusDisplay as u64 + }); + __bindgen_bitfield_unit.set(3usize, 24u8, { + let gpuId: u32 = unsafe { ::std::mem::transmute(gpuId) }; + gpuId as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_DISPLAY_PATH_INFO_V3 { + #[doc = "!< (IN) Structure version"] + pub version: NvU32, + #[doc = "!< (IN) Path count"] + pub count: NvU32, + pub path: [NV_DISPLAY_PATH; 2usize], +} +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_DISPLAY_PATH_INFO { + #[doc = "!< (IN) Structure version"] + pub version: NvU32, + #[doc = "!< (IN) Path count"] + pub count: NvU32, + pub path: [NV_DISPLAY_PATH; 4usize], +} +#[doc = "\n! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_POSITION { + pub x: NvS32, + pub y: NvS32, +} +#[doc = "\n! \\ingroup dispcontrol"] +pub type NV_POSITION = _NV_POSITION; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_RESOLUTION { + pub width: NvU32, + pub height: NvU32, + pub colorDepth: NvU32, +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_RESOLUTION = _NV_RESOLUTION; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1 { + pub version: NvU32, + #[doc = "!< (IN) rotation setting."] + pub rotation: NV_ROTATE, + #[doc = "!< (IN) scaling setting."] + pub scaling: NV_SCALING, + #[doc = "!< (IN) Non-interlaced Refresh Rate of the mode, multiplied by 1000, 0 = ignored\n!< This is the value which driver reports to the OS."] + pub refreshRate1K: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Specify connector type. For TV only, ignored if tvFormat == NV_DISPLAY_TV_FORMAT_NONE"] + pub connector: NV_GPU_CONNECTOR_TYPE, + #[doc = "!< (IN) to choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE\n!< In case of NvAPI_DISP_GetDisplayConfig(), this field will indicate the currently applied TV format;\n!< if no TV format is applied, this field will have NV_DISPLAY_TV_FORMAT_NONE value.\n!< In case of NvAPI_DISP_SetDisplayConfig(), this field should only be set in case of TVs;\n!< for other displays this field will be ignored and resolution & refresh rate specified in input will be used to apply the TV format."] + pub tvFormat: NV_DISPLAY_TV_FORMAT, + #[doc = "!< Ignored if timingOverride == NV_TIMING_OVERRIDE_CURRENT"] + pub timingOverride: NV_TIMING_OVERRIDE, + #[doc = "!< Scan out timing, valid only if timingOverride == NV_TIMING_OVERRIDE_CUST\n!< The value NV_TIMING::NV_TIMINGEXT::rrx1k is obtained from the EDID. The driver may\n!< tweak this value for HDTV, stereo, etc., before reporting it to the OS."] + pub timing: NV_TIMING, +} +impl _NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1 { + #[inline] + pub fn interlaced(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_interlaced(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn interlaced_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_interlaced_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn primary(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_primary(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn primary_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_primary_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reservedBit1(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_reservedBit1(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn reservedBit1_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reservedBit1_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn disableVirtualModeSupport(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_disableVirtualModeSupport(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn disableVirtualModeSupport_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_disableVirtualModeSupport_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isPreferredUnscaledTarget(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_isPreferredUnscaledTarget(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isPreferredUnscaledTarget_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isPreferredUnscaledTarget_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 27u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 27u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 27u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 27u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + interlaced: NvU32, + primary: NvU32, + reservedBit1: NvU32, + disableVirtualModeSupport: NvU32, + isPreferredUnscaledTarget: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let interlaced: u32 = unsafe { ::std::mem::transmute(interlaced) }; + interlaced as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let primary: u32 = unsafe { ::std::mem::transmute(primary) }; + primary as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let reservedBit1: u32 = unsafe { ::std::mem::transmute(reservedBit1) }; + reservedBit1 as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let disableVirtualModeSupport: u32 = + unsafe { ::std::mem::transmute(disableVirtualModeSupport) }; + disableVirtualModeSupport as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let isPreferredUnscaledTarget: u32 = + unsafe { ::std::mem::transmute(isPreferredUnscaledTarget) }; + isPreferredUnscaledTarget as u64 + }); + __bindgen_bitfield_unit.set(5usize, 27u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1 = + _NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1; +#[doc = "! \\ingroup dispcontrol"] +pub type NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO = NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1 { + #[doc = "!< Display ID"] + pub displayId: NvU32, + #[doc = "!< May be NULL if no advanced settings are required. NULL for Non-NVIDIA Display."] + pub details: *mut NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO, +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1 = _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2 { + #[doc = "!< Display ID"] + pub displayId: NvU32, + #[doc = "!< May be NULL if no advanced settings are required"] + pub details: *mut NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO, + #[doc = "!< Windows CCD target ID. Must be present only for non-NVIDIA adapter, for NVIDIA adapter this parameter is ignored."] + pub targetId: NvU32, +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2 = _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2; +#[doc = "! \\ingroup dispcontrol\n! As version is not defined for this structure, we will be using version of NV_DISPLAYCONFIG_PATH_INFO"] +pub type NV_DISPLAYCONFIG_PATH_TARGET_INFO = NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2; +pub const _NV_DISPLAYCONFIG_SPANNING_ORIENTATION_NV_DISPLAYCONFIG_SPAN_NONE: + _NV_DISPLAYCONFIG_SPANNING_ORIENTATION = 0; +pub const _NV_DISPLAYCONFIG_SPANNING_ORIENTATION_NV_DISPLAYCONFIG_SPAN_HORIZONTAL: + _NV_DISPLAYCONFIG_SPANNING_ORIENTATION = 1; +pub const _NV_DISPLAYCONFIG_SPANNING_ORIENTATION_NV_DISPLAYCONFIG_SPAN_VERTICAL: + _NV_DISPLAYCONFIG_SPANNING_ORIENTATION = 2; +#[doc = "! \\ingroup dispcontrol"] +pub type _NV_DISPLAYCONFIG_SPANNING_ORIENTATION = ::std::os::raw::c_int; +#[doc = "! \\ingroup dispcontrol"] +pub use self::_NV_DISPLAYCONFIG_SPANNING_ORIENTATION as NV_DISPLAYCONFIG_SPANNING_ORIENTATION; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 { + pub resolution: NV_RESOLUTION, + #[doc = "!< Ignored at present, must be NV_FORMAT_UNKNOWN (0)"] + pub colorFormat: NV_FORMAT, + #[doc = "!< Is all positions are 0 or invalid, displays will be automatically\n!< positioned from left to right with GDI Primary at 0,0, and all\n!< other displays in the order of the path array."] + pub position: NV_POSITION, + #[doc = "!< Spanning is only supported on XP"] + pub spanningOrientation: NV_DISPLAYCONFIG_SPANNING_ORIENTATION, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl _NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 { + #[inline] + pub fn bGDIPrimary(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bGDIPrimary(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bGDIPrimary_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bGDIPrimary_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bSLIFocus(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_bSLIFocus(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bSLIFocus_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bSLIFocus_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 30u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 30u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bGDIPrimary: NvU32, + bSLIFocus: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bGDIPrimary: u32 = unsafe { ::std::mem::transmute(bGDIPrimary) }; + bGDIPrimary as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let bSLIFocus: u32 = unsafe { ::std::mem::transmute(bSLIFocus) }; + bSLIFocus as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 = _NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_DISPLAYCONFIG_PATH_INFO_V1 { + pub version: NvU32, + #[doc = "!< This field is reserved. There is ongoing debate if we need this field.\n!< Identifies sourceIds used by Windows. If all sourceIds are 0,\n!< these will be computed automatically."] + pub reserved_sourceId: NvU32, + #[doc = "!< Number of elements in targetInfo array"] + pub targetInfoCount: NvU32, + pub targetInfo: *mut NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1, + #[doc = "!< May be NULL if mode info is not important"] + pub sourceModeInfo: *mut NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1, +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_DISPLAYCONFIG_PATH_INFO_V1 = _NV_DISPLAYCONFIG_PATH_INFO_V1; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_DISPLAYCONFIG_PATH_INFO { + pub version: NvU32, + pub __bindgen_anon_1: _NV_DISPLAYCONFIG_PATH_INFO__bindgen_ty_1, + #[doc = "!< Number of elements in targetInfo array"] + pub targetInfoCount: NvU32, + pub targetInfo: *mut NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2, + #[doc = "!< May be NULL if mode info is not important"] + pub sourceModeInfo: *mut NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Used by Non-NVIDIA adapter for pointer to OS Adapter of LUID\n!< type, type casted to void *."] + pub pOSAdapterID: *mut ::std::os::raw::c_void, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NV_DISPLAYCONFIG_PATH_INFO__bindgen_ty_1 { + #[doc = "!< Identifies sourceId used by Windows CCD. This can be optionally set."] + pub sourceId: NvU32, + #[doc = "!< Only for compatibility"] + pub reserved_sourceId: NvU32, +} +impl _NV_DISPLAYCONFIG_PATH_INFO { + #[inline] + pub fn IsNonNVIDIAAdapter(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_IsNonNVIDIAAdapter(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn IsNonNVIDIAAdapter_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_IsNonNVIDIAAdapter_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + IsNonNVIDIAAdapter: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let IsNonNVIDIAAdapter: u32 = unsafe { ::std::mem::transmute(IsNonNVIDIAAdapter) }; + IsNonNVIDIAAdapter as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_DISPLAYCONFIG_PATH_INFO_V2 = _NV_DISPLAYCONFIG_PATH_INFO; +#[doc = "! \\ingroup dispcontrol"] +pub type NV_DISPLAYCONFIG_PATH_INFO = NV_DISPLAYCONFIG_PATH_INFO_V2; +#[doc = "! \\ingroup dispcontrol"] +pub type NV_DISPLAYCONFIG_SOURCE_MODE_INFO = NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1; +pub const _NV_DISPLAYCONFIG_FLAGS_NV_DISPLAYCONFIG_VALIDATE_ONLY: _NV_DISPLAYCONFIG_FLAGS = 1; +pub const _NV_DISPLAYCONFIG_FLAGS_NV_DISPLAYCONFIG_SAVE_TO_PERSISTENCE: _NV_DISPLAYCONFIG_FLAGS = 2; +#[doc = "!< Driver reload is permitted if necessary"] +pub const _NV_DISPLAYCONFIG_FLAGS_NV_DISPLAYCONFIG_DRIVER_RELOAD_ALLOWED: _NV_DISPLAYCONFIG_FLAGS = + 4; +#[doc = "!< Refresh OS mode list."] +pub const _NV_DISPLAYCONFIG_FLAGS_NV_DISPLAYCONFIG_FORCE_MODE_ENUMERATION: _NV_DISPLAYCONFIG_FLAGS = + 8; +#[doc = "!< Tell OS to avoid optimizing CommitVidPn call during a modeset"] +pub const _NV_DISPLAYCONFIG_FLAGS_NV_FORCE_COMMIT_VIDPN: _NV_DISPLAYCONFIG_FLAGS = 16; +#[doc = "! \\ingroup dispcontrol"] +pub type _NV_DISPLAYCONFIG_FLAGS = ::std::os::raw::c_int; +#[doc = "! \\ingroup dispcontrol"] +pub use self::_NV_DISPLAYCONFIG_FLAGS as NV_DISPLAYCONFIG_FLAGS; +pub type NvAPI_UnicodeString = [NvU16; 2048usize]; +pub type NvAPI_LPCWSTR = *const NvU16; +pub const _NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID_NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_CORE: + _NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID = 0; +pub const _NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID_NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_UNDEFINED: + _NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID = 16; +#[doc = "! \\ingroup gpuclock"] +pub type _NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpuclock"] +pub use self::_NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID as NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID; +pub const _NV_GPU_PUBLIC_CLOCK_ID_NVAPI_GPU_PUBLIC_CLOCK_GRAPHICS: _NV_GPU_PUBLIC_CLOCK_ID = 0; +pub const _NV_GPU_PUBLIC_CLOCK_ID_NVAPI_GPU_PUBLIC_CLOCK_MEMORY: _NV_GPU_PUBLIC_CLOCK_ID = 4; +pub const _NV_GPU_PUBLIC_CLOCK_ID_NVAPI_GPU_PUBLIC_CLOCK_PROCESSOR: _NV_GPU_PUBLIC_CLOCK_ID = 7; +pub const _NV_GPU_PUBLIC_CLOCK_ID_NVAPI_GPU_PUBLIC_CLOCK_VIDEO: _NV_GPU_PUBLIC_CLOCK_ID = 8; +pub const _NV_GPU_PUBLIC_CLOCK_ID_NVAPI_GPU_PUBLIC_CLOCK_UNDEFINED: _NV_GPU_PUBLIC_CLOCK_ID = 32; +#[doc = "! \\ingroup gpuclock"] +pub type _NV_GPU_PUBLIC_CLOCK_ID = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpuclock"] +pub use self::_NV_GPU_PUBLIC_CLOCK_ID as NV_GPU_PUBLIC_CLOCK_ID; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P0: _NV_GPU_PERF_PSTATE_ID = 0; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P1: _NV_GPU_PERF_PSTATE_ID = 1; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P2: _NV_GPU_PERF_PSTATE_ID = 2; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P3: _NV_GPU_PERF_PSTATE_ID = 3; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P4: _NV_GPU_PERF_PSTATE_ID = 4; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P5: _NV_GPU_PERF_PSTATE_ID = 5; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P6: _NV_GPU_PERF_PSTATE_ID = 6; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P7: _NV_GPU_PERF_PSTATE_ID = 7; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P8: _NV_GPU_PERF_PSTATE_ID = 8; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P9: _NV_GPU_PERF_PSTATE_ID = 9; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P10: _NV_GPU_PERF_PSTATE_ID = 10; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P11: _NV_GPU_PERF_PSTATE_ID = 11; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P12: _NV_GPU_PERF_PSTATE_ID = 12; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P13: _NV_GPU_PERF_PSTATE_ID = 13; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P14: _NV_GPU_PERF_PSTATE_ID = 14; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_P15: _NV_GPU_PERF_PSTATE_ID = 15; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_UNDEFINED: _NV_GPU_PERF_PSTATE_ID = 16; +pub const _NV_GPU_PERF_PSTATE_ID_NVAPI_GPU_PERF_PSTATE_ALL: _NV_GPU_PERF_PSTATE_ID = 17; +#[doc = "! \\addtogroup gpupstate\n! @{"] +pub type _NV_GPU_PERF_PSTATE_ID = ::std::os::raw::c_int; +#[doc = "! \\addtogroup gpupstate\n! @{"] +pub use self::_NV_GPU_PERF_PSTATE_ID as NV_GPU_PERF_PSTATE_ID; +#[doc = "! Clock domains that use single frequency value within given pstate"] +pub const NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID_NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_SINGLE: + NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID = 0; +#[doc = "! Clock domains that allow range of frequency values within given pstate"] +pub const NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID_NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_RANGE: + NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID = 1; +#[doc = "! Used to identify clock type"] +pub type NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID = ::std::os::raw::c_int; +#[doc = "! Used to describe both voltage and frequency deltas"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PERF_PSTATES20_PARAM_DELTA { + #[doc = "! Value of parameter delta (in respective units [kHz, uV])"] + pub value: NvS32, + pub valueRange: NV_GPU_PERF_PSTATES20_PARAM_DELTA__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PERF_PSTATES20_PARAM_DELTA__bindgen_ty_1 { + #[doc = "! Min value allowed for parameter delta (in respective units [kHz, uV])"] + pub min: NvS32, + #[doc = "! Max value allowed for parameter delta (in respective units [kHz, uV])"] + pub max: NvS32, +} +#[doc = "! Used to describe single clock entry"] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct NV_GPU_PSTATE20_CLOCK_ENTRY_V1 { + #[doc = "! ID of the clock domain"] + pub domainId: NV_GPU_PUBLIC_CLOCK_ID, + #[doc = "! Clock type ID"] + pub typeId: NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "! Current frequency delta from nominal settings in (kHz)"] + pub freqDelta_kHz: NV_GPU_PERF_PSTATES20_PARAM_DELTA, + pub data: NV_GPU_PSTATE20_CLOCK_ENTRY_V1__bindgen_ty_1, +} +#[doc = "! Clock domain type dependant information"] +#[repr(C)] +#[derive(Copy, Clone)] +pub union NV_GPU_PSTATE20_CLOCK_ENTRY_V1__bindgen_ty_1 { + pub single: NV_GPU_PSTATE20_CLOCK_ENTRY_V1__bindgen_ty_1__bindgen_ty_1, + pub range: NV_GPU_PSTATE20_CLOCK_ENTRY_V1__bindgen_ty_1__bindgen_ty_2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PSTATE20_CLOCK_ENTRY_V1__bindgen_ty_1__bindgen_ty_1 { + #[doc = "! Clock frequency within given pstate in (kHz)"] + pub freq_kHz: NvU32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PSTATE20_CLOCK_ENTRY_V1__bindgen_ty_1__bindgen_ty_2 { + #[doc = "! Min clock frequency within given pstate in (kHz)"] + pub minFreq_kHz: NvU32, + #[doc = "! Max clock frequency within given pstate in (kHz)"] + pub maxFreq_kHz: NvU32, + #[doc = "! Voltage domain ID and value range in (uV) required for this clock"] + pub domainId: NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID, + pub minVoltage_uV: NvU32, + pub maxVoltage_uV: NvU32, +} +impl NV_GPU_PSTATE20_CLOCK_ENTRY_V1 { + #[inline] + pub fn bIsEditable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsEditable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsEditable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsEditable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsEditable: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsEditable: u32 = unsafe { ::std::mem::transmute(bIsEditable) }; + bIsEditable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! Used to describe single base voltage entry"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 { + #[doc = "! ID of the voltage domain"] + pub domainId: NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "! Current base voltage settings in [uV]"] + pub volt_uV: NvU32, + pub voltDelta_uV: NV_GPU_PERF_PSTATES20_PARAM_DELTA, +} +impl NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 { + #[inline] + pub fn bIsEditable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsEditable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsEditable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsEditable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsEditable: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsEditable: u32 = unsafe { ::std::mem::transmute(bIsEditable) }; + bIsEditable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! Used in NvAPI_GPU_GetPstates20() interface call."] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct NV_GPU_PERF_PSTATES20_INFO_V1 { + #[doc = "! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER)"] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "! Number of populated pstates"] + pub numPstates: NvU32, + #[doc = "! Number of populated clocks (per pstate)"] + pub numClocks: NvU32, + #[doc = "! Number of populated base voltages (per pstate)"] + pub numBaseVoltages: NvU32, + pub pstates: [NV_GPU_PERF_PSTATES20_INFO_V1__bindgen_ty_1; 16usize], +} +#[doc = "! Performance state (P-State) settings\n! Valid index range is 0 to numPstates-1"] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct NV_GPU_PERF_PSTATES20_INFO_V1__bindgen_ty_1 { + #[doc = "! ID of the P-State"] + pub pstateId: NV_GPU_PERF_PSTATE_ID, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "! Array of clock entries\n! Valid index range is 0 to numClocks-1"] + pub clocks: [NV_GPU_PSTATE20_CLOCK_ENTRY_V1; 8usize], + #[doc = "! Array of baseVoltage entries\n! Valid index range is 0 to numBaseVoltages-1"] + pub baseVoltages: [NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1; 4usize], +} +impl NV_GPU_PERF_PSTATES20_INFO_V1__bindgen_ty_1 { + #[inline] + pub fn bIsEditable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsEditable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsEditable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsEditable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsEditable: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsEditable: u32 = unsafe { ::std::mem::transmute(bIsEditable) }; + bIsEditable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +impl NV_GPU_PERF_PSTATES20_INFO_V1 { + #[inline] + pub fn bIsEditable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsEditable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsEditable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsEditable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsEditable: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsEditable: u32 = unsafe { ::std::mem::transmute(bIsEditable) }; + bIsEditable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! Used in NvAPI_GPU_GetPstates20() interface call."] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_PERF_PSTATES20_INFO_V2 { + #[doc = "! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER)"] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "! Number of populated pstates"] + pub numPstates: NvU32, + #[doc = "! Number of populated clocks (per pstate)"] + pub numClocks: NvU32, + #[doc = "! Number of populated base voltages (per pstate)"] + pub numBaseVoltages: NvU32, + pub pstates: [_NV_GPU_PERF_PSTATES20_INFO_V2__bindgen_ty_1; 16usize], + pub ov: _NV_GPU_PERF_PSTATES20_INFO_V2__bindgen_ty_2, +} +#[doc = "! Performance state (P-State) settings\n! Valid index range is 0 to numPstates-1"] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_PERF_PSTATES20_INFO_V2__bindgen_ty_1 { + #[doc = "! ID of the P-State"] + pub pstateId: NV_GPU_PERF_PSTATE_ID, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "! Array of clock entries\n! Valid index range is 0 to numClocks-1"] + pub clocks: [NV_GPU_PSTATE20_CLOCK_ENTRY_V1; 8usize], + #[doc = "! Array of baseVoltage entries\n! Valid index range is 0 to numBaseVoltages-1"] + pub baseVoltages: [NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1; 4usize], +} +impl _NV_GPU_PERF_PSTATES20_INFO_V2__bindgen_ty_1 { + #[inline] + pub fn bIsEditable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsEditable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsEditable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsEditable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsEditable: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsEditable: u32 = unsafe { ::std::mem::transmute(bIsEditable) }; + bIsEditable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! OV settings - Please refer to NVIDIA over-volting recommendation to understand impact of this functionality\n! Valid index range is 0 to numVoltages-1"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_PERF_PSTATES20_INFO_V2__bindgen_ty_2 { + #[doc = "! Number of populated voltages"] + pub numVoltages: NvU32, + #[doc = "! Array of voltage entries\n! Valid index range is 0 to numVoltages-1"] + pub voltages: [NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1; 4usize], +} +impl _NV_GPU_PERF_PSTATES20_INFO_V2 { + #[inline] + pub fn bIsEditable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsEditable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsEditable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsEditable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsEditable: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsEditable: u32 = unsafe { ::std::mem::transmute(bIsEditable) }; + bIsEditable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! Used in NvAPI_GPU_GetPstates20() interface call."] +pub type NV_GPU_PERF_PSTATES20_INFO_V2 = _NV_GPU_PERF_PSTATES20_INFO_V2; +#[doc = "! Used in NvAPI_GPU_GetPstates20() interface call."] +pub type NV_GPU_PERF_PSTATES20_INFO = NV_GPU_PERF_PSTATES20_INFO_V2; +#[doc = "! \\ingroup driverapi\n! Used in NvAPI_GetDisplayDriverVersion()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_DISPLAY_DRIVER_VERSION { + pub version: NvU32, + pub drvVersion: NvU32, + pub bldChangeListNum: NvU32, + pub szBuildBranchString: NvAPI_ShortString, + pub szAdapterString: NvAPI_ShortString, +} +pub const NV_MONITOR_CONN_TYPE_NV_MONITOR_CONN_TYPE_UNINITIALIZED: NV_MONITOR_CONN_TYPE = 0; +pub const NV_MONITOR_CONN_TYPE_NV_MONITOR_CONN_TYPE_VGA: NV_MONITOR_CONN_TYPE = 1; +pub const NV_MONITOR_CONN_TYPE_NV_MONITOR_CONN_TYPE_COMPONENT: NV_MONITOR_CONN_TYPE = 2; +pub const NV_MONITOR_CONN_TYPE_NV_MONITOR_CONN_TYPE_SVIDEO: NV_MONITOR_CONN_TYPE = 3; +pub const NV_MONITOR_CONN_TYPE_NV_MONITOR_CONN_TYPE_HDMI: NV_MONITOR_CONN_TYPE = 4; +pub const NV_MONITOR_CONN_TYPE_NV_MONITOR_CONN_TYPE_DVI: NV_MONITOR_CONN_TYPE = 5; +pub const NV_MONITOR_CONN_TYPE_NV_MONITOR_CONN_TYPE_LVDS: NV_MONITOR_CONN_TYPE = 6; +pub const NV_MONITOR_CONN_TYPE_NV_MONITOR_CONN_TYPE_DP: NV_MONITOR_CONN_TYPE = 7; +pub const NV_MONITOR_CONN_TYPE_NV_MONITOR_CONN_TYPE_COMPOSITE: NV_MONITOR_CONN_TYPE = 8; +pub const NV_MONITOR_CONN_TYPE_NV_MONITOR_CONN_TYPE_UNKNOWN: NV_MONITOR_CONN_TYPE = -1; +#[doc = "! \\ingroup gpu"] +pub type NV_MONITOR_CONN_TYPE = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_DISPLAYIDS { + pub version: NvU32, + #[doc = "!< out: vga, tv, dvi, hdmi and dp. This is reserved for future use and clients should not rely on this information. Instead get the\n!< GPU connector type from NvAPI_GPU_GetConnectorInfo/NvAPI_GPU_GetConnectorInfoEx"] + pub connectorType: NV_MONITOR_CONN_TYPE, + #[doc = "!< this is a unique identifier for each device"] + pub displayId: NvU32, + pub _bitfield_align_1: [u16; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl _NV_GPU_DISPLAYIDS { + #[inline] + pub fn isDynamic(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isDynamic(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isDynamic_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isDynamic_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMultiStreamRootNode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMultiStreamRootNode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMultiStreamRootNode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMultiStreamRootNode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isActive(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_isActive(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isActive_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isActive_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isCluster(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_isCluster(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isCluster_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isCluster_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isOSVisible(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_isOSVisible(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isOSVisible_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isOSVisible_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isWFD(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_isWFD(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isWFD_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isWFD_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isConnected(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + } + #[inline] + pub fn set_isConnected(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isConnected_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isConnected_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reservedInternal(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 10u8) as u32) } + } + #[inline] + pub fn set_reservedInternal(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 10u8, val as u64) + } + } + #[inline] + pub unsafe fn reservedInternal_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 10u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reservedInternal_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 10u8, + val as u64, + ) + } + } + #[inline] + pub fn isPhysicallyConnected(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u32) } + } + #[inline] + pub fn set_isPhysicallyConnected(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isPhysicallyConnected_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 17usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isPhysicallyConnected_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 17usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 14u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(18usize, 14u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 18usize, + 14u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 18usize, + 14u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isDynamic: NvU32, + isMultiStreamRootNode: NvU32, + isActive: NvU32, + isCluster: NvU32, + isOSVisible: NvU32, + isWFD: NvU32, + isConnected: NvU32, + reservedInternal: NvU32, + isPhysicallyConnected: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isDynamic: u32 = unsafe { ::std::mem::transmute(isDynamic) }; + isDynamic as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let isMultiStreamRootNode: u32 = + unsafe { ::std::mem::transmute(isMultiStreamRootNode) }; + isMultiStreamRootNode as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let isActive: u32 = unsafe { ::std::mem::transmute(isActive) }; + isActive as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let isCluster: u32 = unsafe { ::std::mem::transmute(isCluster) }; + isCluster as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let isOSVisible: u32 = unsafe { ::std::mem::transmute(isOSVisible) }; + isOSVisible as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let isWFD: u32 = unsafe { ::std::mem::transmute(isWFD) }; + isWFD as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let isConnected: u32 = unsafe { ::std::mem::transmute(isConnected) }; + isConnected as u64 + }); + __bindgen_bitfield_unit.set(7usize, 10u8, { + let reservedInternal: u32 = unsafe { ::std::mem::transmute(reservedInternal) }; + reservedInternal as u64 + }); + __bindgen_bitfield_unit.set(17usize, 1u8, { + let isPhysicallyConnected: u32 = + unsafe { ::std::mem::transmute(isPhysicallyConnected) }; + isPhysicallyConnected as u64 + }); + __bindgen_bitfield_unit.set(18usize, 14u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup gpu"] +pub type NV_GPU_DISPLAYIDS = _NV_GPU_DISPLAYIDS; +pub const NV_SYSTEM_TYPE_NV_SYSTEM_TYPE_UNKNOWN: NV_SYSTEM_TYPE = 0; +pub const NV_SYSTEM_TYPE_NV_SYSTEM_TYPE_LAPTOP: NV_SYSTEM_TYPE = 1; +pub const NV_SYSTEM_TYPE_NV_SYSTEM_TYPE_DESKTOP: NV_SYSTEM_TYPE = 2; +#[doc = "! \\ingroup gpu\n! Used in NvAPI_GPU_GetSystemType()"] +pub type NV_SYSTEM_TYPE = ::std::os::raw::c_int; +pub const _NV_GPU_OUTPUT_TYPE_NVAPI_GPU_OUTPUT_UNKNOWN: _NV_GPU_OUTPUT_TYPE = 0; +#[doc = "!< CRT display device"] +pub const _NV_GPU_OUTPUT_TYPE_NVAPI_GPU_OUTPUT_CRT: _NV_GPU_OUTPUT_TYPE = 1; +#[doc = "!< Digital Flat Panel display device"] +pub const _NV_GPU_OUTPUT_TYPE_NVAPI_GPU_OUTPUT_DFP: _NV_GPU_OUTPUT_TYPE = 2; +#[doc = "!< TV display device"] +pub const _NV_GPU_OUTPUT_TYPE_NVAPI_GPU_OUTPUT_TV: _NV_GPU_OUTPUT_TYPE = 3; +#[doc = "! \\ingroup gpu\n! used in NvAPI_GPU_GetOutputType()"] +pub type _NV_GPU_OUTPUT_TYPE = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpu\n! used in NvAPI_GPU_GetOutputType()"] +pub use self::_NV_GPU_OUTPUT_TYPE as NV_GPU_OUTPUT_TYPE; +pub const _NV_GPU_TYPE_NV_SYSTEM_TYPE_GPU_UNKNOWN: _NV_GPU_TYPE = 0; +#[doc = "!< Integrated GPU"] +pub const _NV_GPU_TYPE_NV_SYSTEM_TYPE_IGPU: _NV_GPU_TYPE = 1; +#[doc = "!< Discrete GPU"] +pub const _NV_GPU_TYPE_NV_SYSTEM_TYPE_DGPU: _NV_GPU_TYPE = 2; +#[doc = "! \\ingroup gpu\n! Used in NvAPI_GPU_GetGPUType()."] +pub type _NV_GPU_TYPE = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpu\n! Used in NvAPI_GPU_GetGPUType()."] +pub use self::_NV_GPU_TYPE as NV_GPU_TYPE; +pub const _NV_GPU_BUS_TYPE_NVAPI_GPU_BUS_TYPE_UNDEFINED: _NV_GPU_BUS_TYPE = 0; +pub const _NV_GPU_BUS_TYPE_NVAPI_GPU_BUS_TYPE_PCI: _NV_GPU_BUS_TYPE = 1; +pub const _NV_GPU_BUS_TYPE_NVAPI_GPU_BUS_TYPE_AGP: _NV_GPU_BUS_TYPE = 2; +pub const _NV_GPU_BUS_TYPE_NVAPI_GPU_BUS_TYPE_PCI_EXPRESS: _NV_GPU_BUS_TYPE = 3; +pub const _NV_GPU_BUS_TYPE_NVAPI_GPU_BUS_TYPE_FPCI: _NV_GPU_BUS_TYPE = 4; +pub const _NV_GPU_BUS_TYPE_NVAPI_GPU_BUS_TYPE_AXI: _NV_GPU_BUS_TYPE = 5; +#[doc = "! \\ingroup gpu\n! Used in NvAPI_GPU_GetBusType()"] +pub type _NV_GPU_BUS_TYPE = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpu\n! Used in NvAPI_GPU_GetBusType()"] +pub use self::_NV_GPU_BUS_TYPE as NV_GPU_BUS_TYPE; +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_BOARD_INFO { + #[doc = "!< structure version"] + pub version: NvU32, + #[doc = "!< Board Serial Number"] + pub BoardNum: [NvU8; 16usize], +} +#[doc = "! \\ingroup gpu"] +pub type NV_BOARD_INFO_V1 = _NV_BOARD_INFO; +#[doc = "! \\ingroup gpu"] +pub type NV_BOARD_INFO = NV_BOARD_INFO_V1; +#[doc = "! Used in NvAPI_GPU_GetArchInfo()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_ARCH_INFO_V1 { + pub version: NvU32, + pub architecture: NvU32, + pub implementation: NvU32, + pub revision: NvU32, +} +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_T2X: _NV_GPU_ARCHITECTURE_ID = -536870880; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_T3X: _NV_GPU_ARCHITECTURE_ID = -536870864; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_T4X: _NV_GPU_ARCHITECTURE_ID = -536870848; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_T12X: _NV_GPU_ARCHITECTURE_ID = -536870848; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_NV40: _NV_GPU_ARCHITECTURE_ID = 64; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_NV50: _NV_GPU_ARCHITECTURE_ID = 80; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_G78: _NV_GPU_ARCHITECTURE_ID = 96; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_G80: _NV_GPU_ARCHITECTURE_ID = 128; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_G90: _NV_GPU_ARCHITECTURE_ID = 144; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GT200: _NV_GPU_ARCHITECTURE_ID = 160; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GF100: _NV_GPU_ARCHITECTURE_ID = 192; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GF110: _NV_GPU_ARCHITECTURE_ID = 208; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GK100: _NV_GPU_ARCHITECTURE_ID = 224; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GK110: _NV_GPU_ARCHITECTURE_ID = 240; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GK200: _NV_GPU_ARCHITECTURE_ID = 256; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GM000: _NV_GPU_ARCHITECTURE_ID = 272; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GM200: _NV_GPU_ARCHITECTURE_ID = 288; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GP100: _NV_GPU_ARCHITECTURE_ID = 304; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GV100: _NV_GPU_ARCHITECTURE_ID = 320; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GV110: _NV_GPU_ARCHITECTURE_ID = 336; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_TU100: _NV_GPU_ARCHITECTURE_ID = 352; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GA100: _NV_GPU_ARCHITECTURE_ID = 368; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_AD100: _NV_GPU_ARCHITECTURE_ID = 400; +pub const _NV_GPU_ARCHITECTURE_ID_NV_GPU_ARCHITECTURE_GB200: _NV_GPU_ARCHITECTURE_ID = 432; +#[doc = "! NV_GPU_ARCH_INFO() values to identify Architecture level for the GPU."] +pub type _NV_GPU_ARCHITECTURE_ID = ::std::os::raw::c_int; +#[doc = "! NV_GPU_ARCH_INFO() values to identify Architecture level for the GPU."] +pub use self::_NV_GPU_ARCHITECTURE_ID as NV_GPU_ARCHITECTURE_ID; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_T20: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_T30: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_T35: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 5; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_T40: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_T124: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV40: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV41: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 1; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV42: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 2; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV43: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 3; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV44: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 4; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV44A: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 10; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV46: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 6; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV47: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 7; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV49: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 9; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV4B: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 11; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV4C: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 12; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV4E: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 14; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV50: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV63: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 3; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_NV67: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 7; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_G84: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 4; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_G86: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 6; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_G92: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 2; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_G94: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 4; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_G96: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 6; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_G98: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 8; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GT200: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GT212: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 2; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GT214: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 4; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GT215: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 3; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GT216: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 5; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GT218: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 8; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_MCP77: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 10; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GT21C: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 11; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_MCP79: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 12; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GT21A: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 13; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_MCP89: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 15; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GF100: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GF104: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 4; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GF106: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 3; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GF108: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 1; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GF110: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GF116: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 6; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GF117: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 7; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GF118: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 8; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GF119: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 9; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GK104: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 4; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GK106: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 6; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GK107: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 7; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GK20A: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 10; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GK110: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GK208: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 8; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GM204: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 4; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GM206: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 6; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GP100: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GP000: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 1; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GP102: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 2; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GP104: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 4; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GP106: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 6; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GP107: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 7; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GP108: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 8; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GV100: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GV10B: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 11; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_TU100: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_TU102: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 2; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_TU104: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 4; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_TU106: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 6; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_TU116: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 8; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_TU117: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 7; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_TU000: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 1; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GA100: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 0; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GA102: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 2; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GA104: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 4; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_AD102: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 2; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_AD103: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 3; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_AD104: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 4; +pub const _NV_GPU_ARCH_IMPLEMENTATION_ID_NV_GPU_ARCH_IMPLEMENTATION_GB202: + _NV_GPU_ARCH_IMPLEMENTATION_ID = 2; +#[doc = "! NV_GPU_ARCH_INFO() values to identify GPU Architecture Implementation."] +pub type _NV_GPU_ARCH_IMPLEMENTATION_ID = ::std::os::raw::c_int; +#[doc = "! NV_GPU_ARCH_INFO() values to identify GPU Architecture Implementation."] +pub use self::_NV_GPU_ARCH_IMPLEMENTATION_ID as NV_GPU_ARCH_IMPLEMENTATION_ID; +#[doc = "!< QT chip"] +pub const _NV_GPU_CHIP_REVISION_NV_GPU_CHIP_REV_EMULATION_QT: _NV_GPU_CHIP_REVISION = 0; +#[doc = "!< FPGA implementation of the chipset"] +pub const _NV_GPU_CHIP_REVISION_NV_GPU_CHIP_REV_EMULATION_FPGA: _NV_GPU_CHIP_REVISION = 1; +#[doc = "!< First silicon chipset revision"] +pub const _NV_GPU_CHIP_REVISION_NV_GPU_CHIP_REV_A01: _NV_GPU_CHIP_REVISION = 17; +#[doc = "!< Second Silicon chipset revision"] +pub const _NV_GPU_CHIP_REVISION_NV_GPU_CHIP_REV_A02: _NV_GPU_CHIP_REVISION = 18; +#[doc = "!< Third Silicon chipset revision"] +pub const _NV_GPU_CHIP_REVISION_NV_GPU_CHIP_REV_A03: _NV_GPU_CHIP_REVISION = 19; +#[doc = "!< Unknown chip revision"] +pub const _NV_GPU_CHIP_REVISION_NV_GPU_CHIP_REV_UNKNOWN: _NV_GPU_CHIP_REVISION = -1; +pub type _NV_GPU_CHIP_REVISION = ::std::os::raw::c_int; +pub use self::_NV_GPU_CHIP_REVISION as NV_GPU_CHIP_REVISION; +#[doc = "! \\ingroup gpu\n! Used in NvAPI_GPU_GetArchInfo()"] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct NV_GPU_ARCH_INFO_V2 { + pub version: NvU32, + pub __bindgen_anon_1: NV_GPU_ARCH_INFO_V2__bindgen_ty_1, + pub __bindgen_anon_2: NV_GPU_ARCH_INFO_V2__bindgen_ty_2, + pub __bindgen_anon_3: NV_GPU_ARCH_INFO_V2__bindgen_ty_3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union NV_GPU_ARCH_INFO_V2__bindgen_ty_1 { + #[doc = "!< architecture and architecture_id are the same. The former is NvU32 while the latter is an enum made for readability."] + pub architecture: NvU32, + #[doc = "!< specifies the architecture level for the GPU."] + pub architecture_id: NV_GPU_ARCHITECTURE_ID, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union NV_GPU_ARCH_INFO_V2__bindgen_ty_2 { + #[doc = "!< implementation and implementation_id are the same. The former is NvU32 while the latter is an enum made for readability."] + pub implementation: NvU32, + #[doc = "!< specifies the implementation of the architecture for the GPU."] + pub implementation_id: NV_GPU_ARCH_IMPLEMENTATION_ID, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union NV_GPU_ARCH_INFO_V2__bindgen_ty_3 { + #[doc = "!< revision and revision_id are the same. The former is NvU32 while the latter is an enum made for readability."] + pub revision: NvU32, + #[doc = "!< specifies the architecture revision of the GPU."] + pub revision_id: NV_GPU_CHIP_REVISION, +} +#[doc = "! \\ingroup gpu"] +pub type NV_GPU_ARCH_INFO = NV_GPU_ARCH_INFO_V2; +#[doc = "!< Set i2cSpeedKhz to I2C_SPEED_DEFAULT if default I2C speed is to be chosen, ie.use the current frequency setting."] +pub const NV_I2C_SPEED_NVAPI_I2C_SPEED_DEFAULT: NV_I2C_SPEED = 0; +pub const NV_I2C_SPEED_NVAPI_I2C_SPEED_3KHZ: NV_I2C_SPEED = 1; +pub const NV_I2C_SPEED_NVAPI_I2C_SPEED_10KHZ: NV_I2C_SPEED = 2; +pub const NV_I2C_SPEED_NVAPI_I2C_SPEED_33KHZ: NV_I2C_SPEED = 3; +pub const NV_I2C_SPEED_NVAPI_I2C_SPEED_100KHZ: NV_I2C_SPEED = 4; +pub const NV_I2C_SPEED_NVAPI_I2C_SPEED_200KHZ: NV_I2C_SPEED = 5; +pub const NV_I2C_SPEED_NVAPI_I2C_SPEED_400KHZ: NV_I2C_SPEED = 6; +pub type NV_I2C_SPEED = ::std::os::raw::c_int; +#[doc = "! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_I2C_INFO_V1 { + #[doc = "!< The structure version."] + pub version: NvU32, + #[doc = "!< The Display Mask of the concerned display."] + pub displayMask: NvU32, + #[doc = "!< This flag indicates either the DDC port (TRUE) or the communication port\n!< (FALSE) of the concerned display."] + pub bIsDDCPort: NvU8, + #[doc = "!< The address of the I2C slave. The address should be shifted left by one. For\n!< example, the I2C address 0x50, often used for reading EDIDs, would be stored\n!< here as 0xA0. This matches the position within the byte sent by the master, as\n!< the last bit is reserved to specify the read or write direction."] + pub i2cDevAddress: NvU8, + #[doc = "!< The I2C target register address. May be NULL, which indicates no register\n!< address should be sent."] + pub pbI2cRegAddress: *mut NvU8, + #[doc = "!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this\n!< field must be 0."] + pub regAddrSize: NvU32, + #[doc = "!< The buffer of data which is to be read or written (depending on the command)."] + pub pbData: *mut NvU8, + #[doc = "!< The size of the data buffer, pbData, to be read or written."] + pub cbSize: NvU32, + #[doc = "!< The target speed of the transaction (between 28Kbps to 40Kbps; not guaranteed)."] + pub i2cSpeed: NvU32, +} +#[doc = "! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_I2C_INFO_V2 { + #[doc = "!< The structure version."] + pub version: NvU32, + #[doc = "!< The Display Mask of the concerned display."] + pub displayMask: NvU32, + #[doc = "!< This flag indicates either the DDC port (TRUE) or the communication port\n!< (FALSE) of the concerned display."] + pub bIsDDCPort: NvU8, + #[doc = "!< The address of the I2C slave. The address should be shifted left by one. For\n!< example, the I2C address 0x50, often used for reading EDIDs, would be stored\n!< here as 0xA0. This matches the position within the byte sent by the master, as\n!< the last bit is reserved to specify the read or write direction."] + pub i2cDevAddress: NvU8, + #[doc = "!< The I2C target register address. May be NULL, which indicates no register\n!< address should be sent."] + pub pbI2cRegAddress: *mut NvU8, + #[doc = "!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this\n!< field must be 0."] + pub regAddrSize: NvU32, + #[doc = "!< The buffer of data which is to be read or written (depending on the command)."] + pub pbData: *mut NvU8, + #[doc = "!< The size of the data buffer, pbData, to be read or written."] + pub cbSize: NvU32, + #[doc = "!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED."] + pub i2cSpeed: NvU32, + #[doc = "!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED)."] + pub i2cSpeedKhz: NV_I2C_SPEED, +} +#[doc = "! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_I2C_INFO_V3 { + #[doc = "!< The structure version."] + pub version: NvU32, + #[doc = "!< The Display Mask of the concerned display."] + pub displayMask: NvU32, + #[doc = "!< This flag indicates either the DDC port (TRUE) or the communication port\n!< (FALSE) of the concerned display."] + pub bIsDDCPort: NvU8, + #[doc = "!< The address of the I2C slave. The address should be shifted left by one. For\n!< example, the I2C address 0x50, often used for reading EDIDs, would be stored\n!< here as 0xA0. This matches the position within the byte sent by the master, as\n!< the last bit is reserved to specify the read or write direction."] + pub i2cDevAddress: NvU8, + #[doc = "!< The I2C target register address. May be NULL, which indicates no register\n!< address should be sent."] + pub pbI2cRegAddress: *mut NvU8, + #[doc = "!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this\n!< field must be 0."] + pub regAddrSize: NvU32, + #[doc = "!< The buffer of data which is to be read or written (depending on the command)."] + pub pbData: *mut NvU8, + #[doc = "!< The size of the data buffer, pbData, to be read or written."] + pub cbSize: NvU32, + #[doc = "!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED."] + pub i2cSpeed: NvU32, + #[doc = "!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED)."] + pub i2cSpeedKhz: NV_I2C_SPEED, + #[doc = "!< The portid on which device is connected (remember to set bIsPortIdSet if this value is set)\n!< Optional for pre-Kepler"] + pub portId: NvU8, + #[doc = "!< set this flag on if and only if portid value is set"] + pub bIsPortIdSet: NvU32, +} +#[doc = "! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()"] +pub type NV_I2C_INFO = NV_I2C_INFO_V3; +pub const _NV_GPU_HDCP_FUSE_STATE_NV_GPU_HDCP_FUSE_STATE_UNKNOWN: _NV_GPU_HDCP_FUSE_STATE = 0; +pub const _NV_GPU_HDCP_FUSE_STATE_NV_GPU_HDCP_FUSE_STATE_DISABLED: _NV_GPU_HDCP_FUSE_STATE = 1; +pub const _NV_GPU_HDCP_FUSE_STATE_NV_GPU_HDCP_FUSE_STATE_ENABLED: _NV_GPU_HDCP_FUSE_STATE = 2; +#[doc = "! HDCP fuse states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS"] +pub type _NV_GPU_HDCP_FUSE_STATE = ::std::os::raw::c_int; +#[doc = "! HDCP fuse states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS"] +pub use self::_NV_GPU_HDCP_FUSE_STATE as NV_GPU_HDCP_FUSE_STATE; +pub const _NV_GPU_HDCP_KEY_SOURCE_NV_GPU_HDCP_KEY_SOURCE_UNKNOWN: _NV_GPU_HDCP_KEY_SOURCE = 0; +pub const _NV_GPU_HDCP_KEY_SOURCE_NV_GPU_HDCP_KEY_SOURCE_NONE: _NV_GPU_HDCP_KEY_SOURCE = 1; +pub const _NV_GPU_HDCP_KEY_SOURCE_NV_GPU_HDCP_KEY_SOURCE_CRYPTO_ROM: _NV_GPU_HDCP_KEY_SOURCE = 2; +pub const _NV_GPU_HDCP_KEY_SOURCE_NV_GPU_HDCP_KEY_SOURCE_SBIOS: _NV_GPU_HDCP_KEY_SOURCE = 3; +pub const _NV_GPU_HDCP_KEY_SOURCE_NV_GPU_HDCP_KEY_SOURCE_I2C_ROM: _NV_GPU_HDCP_KEY_SOURCE = 4; +pub const _NV_GPU_HDCP_KEY_SOURCE_NV_GPU_HDCP_KEY_SOURCE_FUSES: _NV_GPU_HDCP_KEY_SOURCE = 5; +#[doc = "! HDCP key sources - used in NV_GPU_GET_HDCP_SUPPORT_STATUS"] +pub type _NV_GPU_HDCP_KEY_SOURCE = ::std::os::raw::c_int; +#[doc = "! HDCP key sources - used in NV_GPU_GET_HDCP_SUPPORT_STATUS"] +pub use self::_NV_GPU_HDCP_KEY_SOURCE as NV_GPU_HDCP_KEY_SOURCE; +pub const _NV_GPU_HDCP_KEY_SOURCE_STATE_NV_GPU_HDCP_KEY_SOURCE_STATE_UNKNOWN: + _NV_GPU_HDCP_KEY_SOURCE_STATE = 0; +pub const _NV_GPU_HDCP_KEY_SOURCE_STATE_NV_GPU_HDCP_KEY_SOURCE_STATE_ABSENT: + _NV_GPU_HDCP_KEY_SOURCE_STATE = 1; +pub const _NV_GPU_HDCP_KEY_SOURCE_STATE_NV_GPU_HDCP_KEY_SOURCE_STATE_PRESENT: + _NV_GPU_HDCP_KEY_SOURCE_STATE = 2; +#[doc = "! HDCP key source states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS"] +pub type _NV_GPU_HDCP_KEY_SOURCE_STATE = ::std::os::raw::c_int; +#[doc = "! HDCP key source states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS"] +pub use self::_NV_GPU_HDCP_KEY_SOURCE_STATE as NV_GPU_HDCP_KEY_SOURCE_STATE; +#[doc = "! HDPC support status - used in NvAPI_GPU_GetHDCPSupportStatus()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_GET_HDCP_SUPPORT_STATUS { + pub version: NvU32, + #[doc = "! Structure version constucted by macro #NV_GPU_GET_HDCP_SUPPORT_STATUS"] + pub hdcpFuseState: NV_GPU_HDCP_FUSE_STATE, + #[doc = "! GPU's HDCP fuse state"] + pub hdcpKeySource: NV_GPU_HDCP_KEY_SOURCE, + #[doc = "! GPU's HDCP key source"] + pub hdcpKeySourceState: NV_GPU_HDCP_KEY_SOURCE_STATE, +} +#[doc = "! @}"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_COMPUTE_GPU_TOPOLOGY_V1 { + #[doc = "!< Structure version"] + pub version: NvU32, + #[doc = "!< Total number of compute-capable GPUs"] + pub gpuCount: NvU32, + #[doc = "!< Array of compute-capable physical GPUs."] + pub computeGpus: [NV_COMPUTE_GPU_TOPOLOGY_V1__bindgen_ty_1; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_COMPUTE_GPU_TOPOLOGY_V1__bindgen_ty_1 { + #[doc = "!< Compute-capable physical GPU handle"] + pub hPhysicalGpu: NvPhysicalGpuHandle, + #[doc = "!< One or more flags from \\ref nvcomp_gpu_top"] + pub flags: NvU32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COMPUTE_GPU { + #[doc = "!< Compute-capable physical GPU handle"] + pub hPhysicalGpu: NvPhysicalGpuHandle, + #[doc = "!< One or more flags from \\ref nvcomp_gpu_top"] + pub flags: NvU32, +} +pub type NV_COMPUTE_GPU = _NV_COMPUTE_GPU; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COMPUTE_GPU_TOPOLOGY_V2 { + #[doc = "!< Structure version"] + pub version: NvU32, + #[doc = "!< Size of array"] + pub gpuCount: NvU32, + #[doc = "!< Array of compute-capable physical GPUs (allocate memory of size of Physical gpuCount of system)."] + pub computeGpus: *mut NV_COMPUTE_GPU, +} +pub type NV_COMPUTE_GPU_TOPOLOGY_V2 = _NV_COMPUTE_GPU_TOPOLOGY_V2; +pub type NV_COMPUTE_GPU_TOPOLOGY = NV_COMPUTE_GPU_TOPOLOGY_V2; +pub const _NV_ECC_CONFIGURATION_NV_ECC_CONFIGURATION_NOT_SUPPORTED: _NV_ECC_CONFIGURATION = 0; +#[doc = "!< Changes require a POST to take effect"] +pub const _NV_ECC_CONFIGURATION_NV_ECC_CONFIGURATION_DEFERRED: _NV_ECC_CONFIGURATION = 1; +#[doc = "!< Changes can optionally be made to take effect immediately"] +pub const _NV_ECC_CONFIGURATION_NV_ECC_CONFIGURATION_IMMEDIATE: _NV_ECC_CONFIGURATION = 2; +#[doc = "! \\addtogroup gpuecc\n! Used in NV_GPU_ECC_STATUS_INFO."] +pub type _NV_ECC_CONFIGURATION = ::std::os::raw::c_int; +#[doc = "! \\addtogroup gpuecc\n! Used in NV_GPU_ECC_STATUS_INFO."] +pub use self::_NV_ECC_CONFIGURATION as NV_ECC_CONFIGURATION; +#[doc = "! \\ingroup gpuecc\n! Used in NvAPI_GPU_GetECCStatusInfo()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_ECC_STATUS_INFO { + #[doc = "!< Structure version"] + pub version: NvU32, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + #[doc = "!< Supported ECC memory feature configuration options"] + pub configurationOptions: NV_ECC_CONFIGURATION, + pub _bitfield_align_2: [u8; 0], + pub _bitfield_2: __BindgenBitfieldUnit<[u8; 1usize]>, + pub __bindgen_padding_0: [u8; 3usize], +} +impl NV_GPU_ECC_STATUS_INFO { + #[inline] + pub fn isSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1(isSupported: NvU32) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isSupported: u32 = unsafe { ::std::mem::transmute(isSupported) }; + isSupported as u64 + }); + __bindgen_bitfield_unit + } + #[inline] + pub fn isEnabled(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isEnabled(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_2.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isEnabled_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_2), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isEnabled_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_2), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_2(isEnabled: NvU32) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isEnabled: u32 = unsafe { ::std::mem::transmute(isEnabled) }; + isEnabled as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup gpuecc\n! Used in NvAPI_GPU_GetECCErrorInfo()/"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_ECC_ERROR_INFO { + #[doc = "!< Structure version"] + pub version: NvU32, + pub current: NV_GPU_ECC_ERROR_INFO__bindgen_ty_1, + pub aggregate: NV_GPU_ECC_ERROR_INFO__bindgen_ty_2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_ECC_ERROR_INFO__bindgen_ty_1 { + #[doc = "!< Number of single-bit ECC errors detected since last boot"] + pub singleBitErrors: NvU64, + #[doc = "!< Number of double-bit ECC errors detected since last boot"] + pub doubleBitErrors: NvU64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_ECC_ERROR_INFO__bindgen_ty_2 { + #[doc = "!< Number of single-bit ECC errors detected since last counter reset"] + pub singleBitErrors: NvU64, + #[doc = "!< Number of double-bit ECC errors detected since last counter reset"] + pub doubleBitErrors: NvU64, +} +#[doc = "! \\ingroup gpuecc\n! Used in NvAPI_GPU_GetECCConfigurationInfo()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_ECC_CONFIGURATION_INFO { + pub version: NvU32, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub __bindgen_padding_0: [u8; 3usize], +} +impl NV_GPU_ECC_CONFIGURATION_INFO { + #[inline] + pub fn isEnabled(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isEnabled(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isEnabled_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isEnabled_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isEnabledByDefault(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_isEnabledByDefault(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isEnabledByDefault_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isEnabledByDefault_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isEnabled: NvU32, + isEnabledByDefault: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isEnabled: u32 = unsafe { ::std::mem::transmute(isEnabled) }; + isEnabled as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let isEnabledByDefault: u32 = unsafe { ::std::mem::transmute(isEnabledByDefault) }; + isEnabledByDefault as u64 + }); + __bindgen_bitfield_unit + } +} +pub const NV_QSYNC_EVENT_NV_QSYNC_EVENT_NONE: NV_QSYNC_EVENT = 0; +pub const NV_QSYNC_EVENT_NV_QSYNC_EVENT_SYNC_LOSS: NV_QSYNC_EVENT = 1; +pub const NV_QSYNC_EVENT_NV_QSYNC_EVENT_SYNC_GAIN: NV_QSYNC_EVENT = 2; +pub const NV_QSYNC_EVENT_NV_QSYNC_EVENT_HOUSESYNC_GAIN: NV_QSYNC_EVENT = 3; +pub const NV_QSYNC_EVENT_NV_QSYNC_EVENT_HOUSESYNC_LOSS: NV_QSYNC_EVENT = 4; +pub const NV_QSYNC_EVENT_NV_QSYNC_EVENT_RJ45_GAIN: NV_QSYNC_EVENT = 5; +pub const NV_QSYNC_EVENT_NV_QSYNC_EVENT_RJ45_LOSS: NV_QSYNC_EVENT = 6; +pub type NV_QSYNC_EVENT = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_QSYNC_EVENT_DATA { + pub qsyncEvent: NV_QSYNC_EVENT, + pub reserved: [NvU32; 7usize], +} +#[doc = "! Callback for QSYNC event"] +pub type NVAPI_CALLBACK_QSYNCEVENT = ::std::option::Option< + unsafe extern "C" fn( + qyncEventData: NV_QSYNC_EVENT_DATA, + callbackParam: *mut ::std::os::raw::c_void, + ), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_DISPLAY_OUTPUT_MODE_CHANGE_EVENT_DATA { + #[doc = "!< displayId of the display"] + pub displayId: NvU32, + #[doc = "!< display output mode"] + pub outputMode: NvU32, +} +pub type NV_DISPLAY_OUTPUT_MODE_CHANGE_EVENT_DATA = _NV_DISPLAY_OUTPUT_MODE_CHANGE_EVENT_DATA; +#[doc = "! Callback for Display Output Mode change events"] +pub type NVAPI_CALLBACK_DISPLAY_OUTPUT_MODE_CHANGE_EVENT = ::std::option::Option< + unsafe extern "C" fn( + pEventData: *mut NV_DISPLAY_OUTPUT_MODE_CHANGE_EVENT_DATA, + callbackParam: *mut ::std::os::raw::c_void, + ), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_DISPLAY_COLORIMETRY_CHANGE_EVENT_DATA { + #[doc = "!< displayId of the monitor"] + pub displayId: NvU32, + #[doc = "!< min luminance, cd/m^2"] + pub min_luminance: f32, + #[doc = "!< max 100% frame luminance, cd/m^2"] + pub max_full_frame_luminance: f32, + #[doc = "!< max 10% frame luminance, cd/m^2"] + pub max_luminance: f32, + #[doc = "!< HDR brightness luminance scaling factor applied by GPU on output pixels"] + pub hdrBrightnessLuminanceScalingFactor: f32, + #[doc = "!< red primary chromaticity coordinate x"] + pub red_primary_x: f32, + #[doc = "!< red primary chromaticity coordinate y"] + pub red_primary_y: f32, + #[doc = "!< green primary chromaticity coordinate x"] + pub green_primary_x: f32, + #[doc = "!< green primary chromaticity coordinate y"] + pub green_primary_y: f32, + #[doc = "!< blue primary chromaticity coordinate x"] + pub blue_primary_x: f32, + #[doc = "!< blue primary chromaticity coordinate y"] + pub blue_primary_y: f32, + #[doc = "!< white point chromaticity coordinate x"] + pub white_point_x: f32, + #[doc = "!< white point chromaticity coordinate y"] + pub white_point_y: f32, +} +pub type NV_DISPLAY_COLORIMETRY_CHANGE_EVENT_DATA = _NV_DISPLAY_COLORIMETRY_CHANGE_EVENT_DATA; +#[doc = "! Callback for Display Colorimetry change events"] +pub type NVAPI_CALLBACK_DISPLAY_COLORIMETRY_CHANGE_EVENT = ::std::option::Option< + unsafe extern "C" fn( + pEventData: *mut NV_DISPLAY_COLORIMETRY_CHANGE_EVENT_DATA, + callbackParam: *mut ::std::os::raw::c_void, + ), +>; +pub const NV_EVENT_TYPE_NV_EVENT_TYPE_NONE: NV_EVENT_TYPE = 0; +pub const NV_EVENT_TYPE_NV_EVENT_TYPE_QSYNC: NV_EVENT_TYPE = 6; +pub const NV_EVENT_TYPE_NV_EVENT_TYPE_DISPLAY_OUTPUT_MODE_CHANGE: NV_EVENT_TYPE = 103; +pub const NV_EVENT_TYPE_NV_EVENT_TYPE_DISPLAY_COLORIMETRY_CHANGE: NV_EVENT_TYPE = 104; +#[doc = "! Enum for Event IDs"] +pub type NV_EVENT_TYPE = ::std::os::raw::c_int; +#[doc = "! Core NV_EVENT_REGISTER_CALLBACK structure declaration"] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct NV_EVENT_REGISTER_CALLBACK { + #[doc = "!< version field to ensure minimum version compatibility"] + pub version: NvU32, + #[doc = "!< ID of the event being sent"] + pub eventId: NV_EVENT_TYPE, + #[doc = "!< This value will be passed back to the callback function when an event occurs"] + pub callbackParam: *mut ::std::os::raw::c_void, + pub nvCallBackFunc: NV_EVENT_REGISTER_CALLBACK__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union NV_EVENT_REGISTER_CALLBACK__bindgen_ty_1 { + #[doc = "!< Callback function pointer for QSYNC events"] + pub nvQSYNCEventCallback: NVAPI_CALLBACK_QSYNCEVENT, + #[doc = "!< Callback function pointer for Display Output Mode change events"] + pub nvDisplayOutputModeChangeEventCallback: NVAPI_CALLBACK_DISPLAY_OUTPUT_MODE_CHANGE_EVENT, + #[doc = "!< Callback function pointer for Display Colorimetry change events"] + pub nvDisplayColorimetryChangeEventCallback: NVAPI_CALLBACK_DISPLAY_COLORIMETRY_CHANGE_EVENT, +} +#[doc = "!< NVIDIA RTX VR Ready"] +pub const _NV_GPU_WORKSTATION_FEATURE_TYPE_NV_GPU_WORKSTATION_FEATURE_TYPE_NVIDIA_RTX_VR_READY: + _NV_GPU_WORKSTATION_FEATURE_TYPE = 1; +#[doc = "!< DEPRECATED name - do not use"] +pub const _NV_GPU_WORKSTATION_FEATURE_TYPE_NV_GPU_WORKSTATION_FEATURE_TYPE_QUADRO_VR_READY: + _NV_GPU_WORKSTATION_FEATURE_TYPE = 1; +pub const _NV_GPU_WORKSTATION_FEATURE_TYPE_NV_GPU_WORKSTATION_FEATURE_TYPE_PROVIZ: + _NV_GPU_WORKSTATION_FEATURE_TYPE = 2; +#[doc = "! \\ingroup gpu"] +pub type _NV_GPU_WORKSTATION_FEATURE_TYPE = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpu"] +pub use self::_NV_GPU_WORKSTATION_FEATURE_TYPE as NV_GPU_WORKSTATION_FEATURE_TYPE; +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_SCANOUT_INTENSITY_DATA_V1 { + #[doc = "!< version of this structure"] + pub version: NvU32, + #[doc = "!< width of the input texture"] + pub width: NvU32, + #[doc = "!< height of the input texture"] + pub height: NvU32, + #[doc = "!< array of floating values building an intensity RGB texture"] + pub blendingTexture: *mut f32, +} +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_SCANOUT_INTENSITY_DATA_V2 { + #[doc = "!< version of this structure"] + pub version: NvU32, + #[doc = "!< width of the input texture"] + pub width: NvU32, + #[doc = "!< height of the input texture"] + pub height: NvU32, + #[doc = "!< array of floating values building an intensity RGB texture"] + pub blendingTexture: *mut f32, + #[doc = "!< array of floating values building an offset texture"] + pub offsetTexture: *mut f32, + #[doc = "!< number of channels per pixel in the offset texture"] + pub offsetTexChannels: NvU32, +} +#[doc = "! \\ingroup gpu"] +pub type NV_SCANOUT_INTENSITY_DATA = NV_SCANOUT_INTENSITY_DATA_V2; +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_SCANOUT_INTENSITY_STATE_DATA { + #[doc = "!< version of this structure"] + pub version: NvU32, + #[doc = "!< intensity is enabled or not"] + pub bEnabled: NvU32, +} +#[doc = "! \\ingroup gpu"] +pub type NV_SCANOUT_INTENSITY_STATE_DATA = _NV_SCANOUT_INTENSITY_STATE_DATA; +pub const NV_GPU_WARPING_VERTICE_FORMAT_NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLESTRIP_XYUVRQ: + NV_GPU_WARPING_VERTICE_FORMAT = 0; +pub const NV_GPU_WARPING_VERTICE_FORMAT_NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLES_XYUVRQ: + NV_GPU_WARPING_VERTICE_FORMAT = 1; +#[doc = "! \\ingroup gpu"] +pub type NV_GPU_WARPING_VERTICE_FORMAT = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_SCANOUT_WARPING_DATA { + #[doc = "!< version of this structure"] + pub version: NvU32, + #[doc = "!< width of the input texture"] + pub vertices: *mut f32, + #[doc = "!< format of the input vertices"] + pub vertexFormat: NV_GPU_WARPING_VERTICE_FORMAT, + #[doc = "!< number of the input vertices"] + pub numVertices: ::std::os::raw::c_int, + #[doc = "!< rectangle in desktop coordinates describing the source area for the warping"] + pub textureRect: *mut NvSBox, +} +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_SCANOUT_WARPING_STATE_DATA { + #[doc = "!< version of this structure"] + pub version: NvU32, + #[doc = "!< warping is enabled or not"] + pub bEnabled: NvU32, +} +#[doc = "! \\ingroup gpu"] +pub type NV_SCANOUT_WARPING_STATE_DATA = _NV_SCANOUT_WARPING_STATE_DATA; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_WARPING_RESAMPLING_METHOD : NV_GPU_SCANOUT_COMPOSITION_PARAMETER = 0 ; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_SCANOUT_INTENSITY_METHOD : NV_GPU_SCANOUT_COMPOSITION_PARAMETER = 1 ; +pub type NV_GPU_SCANOUT_COMPOSITION_PARAMETER = ::std::os::raw::c_int; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_SET_TO_DEFAULT : NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = 0 ; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BILINEAR : NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = 256 ; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_TRIANGULAR : NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = 257 ; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_BELL_SHAPED : NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = 258 ; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_BSPLINE : NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = 259 ; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_TRIANGULAR : NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = 260 ; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_BELL_SHAPED : NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = 261 ; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_BSPLINE : NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = 262 ; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_SCANOUT_INTENSITY_NO_GAMMA : NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = 512 ; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_SCANOUT_INTENSITY_COLOR_GAMMA : NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = 513 ; +pub const NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_SCANOUT_INTENSITY_COLOR_AND_OFFSET_GAMMA : NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = 514 ; +#[doc = "! This enum defines a collection of scanout composition values that can be used to configure\n! the supported scanout composition settings"] +pub type NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpu\n! Used in NvAPI_GPU_GetScanoutConfigurationEx()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_SCANOUT_INFORMATION { + #[doc = "!< Structure version, needs to be initialized with NV_SCANOUT_INFORMATION_VER."] + pub version: NvU32, + #[doc = "!< Operating system display device rect in desktop coordinates displayId is scanning out from."] + pub sourceDesktopRect: NvSBox, + #[doc = "!< Area inside the sourceDesktopRect which is scanned out to the display."] + pub sourceViewportRect: NvSBox, + #[doc = "!< Area inside the rect described by targetDisplayWidth/Height sourceViewportRect is scanned out to."] + pub targetViewportRect: NvSBox, + #[doc = "!< Horizontal size of the active resolution scanned out to the display."] + pub targetDisplayWidth: NvU32, + #[doc = "!< Vertical size of the active resolution scanned out to the display."] + pub targetDisplayHeight: NvU32, + #[doc = "!< If targets are cloned views of the sourceDesktopRect the cloned targets have an importance assigned (0:primary,1 secondary,...)."] + pub cloneImportance: NvU32, + #[doc = "!< Rotation performed between the sourceViewportRect and the targetViewportRect."] + pub sourceToTargetRotation: NV_ROTATE, +} +#[doc = "! \\ingroup gpu\n! Used in NvAPI_GPU_GetScanoutConfigurationEx()."] +pub type NV_SCANOUT_INFORMATION = _NV_SCANOUT_INFORMATION; +#[doc = "!< Represents Bare Metal GPU"] +pub const _NV_VIRTUALIZATION_MODE_NV_VIRTUALIZATION_MODE_NONE: _NV_VIRTUALIZATION_MODE = 0; +#[doc = "!< Represents GPU-Passthrough"] +pub const _NV_VIRTUALIZATION_MODE_NV_VIRTUALIZATION_MODE_NMOS: _NV_VIRTUALIZATION_MODE = 1; +#[doc = "!< Represents vGPU inside virtual machine"] +pub const _NV_VIRTUALIZATION_MODE_NV_VIRTUALIZATION_MODE_VGX: _NV_VIRTUALIZATION_MODE = 2; +#[doc = "!< Represents VGX hypervisor in vGPU mode"] +pub const _NV_VIRTUALIZATION_MODE_NV_VIRTUALIZATION_MODE_HOST_VGPU: _NV_VIRTUALIZATION_MODE = 3; +#[doc = "! \\ingroup gpu"] +pub type _NV_VIRTUALIZATION_MODE = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpu"] +pub use self::_NV_VIRTUALIZATION_MODE as NV_VIRTUALIZATION_MODE; +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_VIRTUALIZATION_INFO { + #[doc = "!< Structure version"] + pub version: NvU32, + #[doc = "!< one of NV_VIRTUALIZATION_MODE."] + pub virtualizationMode: NV_VIRTUALIZATION_MODE, + #[doc = "!< reserved for future use. Should be set to ZERO."] + pub reserved: NvU32, +} +#[doc = "! \\ingroup gpu"] +pub type NV_GPU_VIRTUALIZATION_INFO_V1 = _NV_GPU_VIRTUALIZATION_INFO; +#[doc = "! \\ingroup gpu"] +pub type NV_GPU_VIRTUALIZATION_INFO = NV_GPU_VIRTUALIZATION_INFO_V1; +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LOGICAL_GPU_DATA_V1 { + #[doc = "!< [in] Structure version."] + pub version: NvU32, + #[doc = "!< [out] Returns OS-AdapterId. User must send memory buffer of size atleast equal to the size of LUID structure before calling the NVAPI."] + pub pOSAdapterId: *mut ::std::os::raw::c_void, + #[doc = "!< [out] Number of physical GPU handles associated with the specified logical GPU handle."] + pub physicalGpuCount: NvU32, + #[doc = "!< [out] This array will be filled with physical GPU handles associated with the given logical GPU handle.\n!< The array index refers to the Physical Gpu Index (Idx).\n!< Idx value is the same as D3D11 MultiGPUDevice GPU index, D3D12 node index, OpenGL GL_NV_gpu_multicast GPU index.\n!< When converted to a bit mask (1 << Idx), it matches:\n!< 1. Vulkan deviceNodeMask in VkPhysicalDeviceIDProperties\n!< 2. CUDA deviceNodeMask returned by cuDeviceGetLuid"] + pub physicalGpuHandles: [NvPhysicalGpuHandle; 64usize], + #[doc = "!< Reserved for future use. Should be set to ZERO."] + pub reserved: [NvU32; 8usize], +} +#[doc = "! \\ingroup gpu"] +pub type NV_LOGICAL_GPU_DATA_V1 = _NV_LOGICAL_GPU_DATA_V1; +#[doc = "! \\ingroup gpu"] +pub type NV_LOGICAL_GPU_DATA = NV_LOGICAL_GPU_DATA_V1; +#[doc = "! License string"] +pub type NvAPI_LicenseString = [::std::os::raw::c_char; 128usize]; +pub const _NV_LICENSE_FEATURE_TYPE_NV_LICENSE_FEATURE_UNKNOWN: _NV_LICENSE_FEATURE_TYPE = 0; +pub const _NV_LICENSE_FEATURE_TYPE_NV_LICENSE_FEATURE_VGPU: _NV_LICENSE_FEATURE_TYPE = 1; +pub const _NV_LICENSE_FEATURE_TYPE_NV_LICENSE_FEATURE_NVIDIA_RTX: _NV_LICENSE_FEATURE_TYPE = 2; +#[doc = "!< DEPRECATED name - do not use"] +pub const _NV_LICENSE_FEATURE_TYPE_NV_LICENSE_FEATURE_QUADRO: _NV_LICENSE_FEATURE_TYPE = 2; +pub const _NV_LICENSE_FEATURE_TYPE_NV_LICENSE_FEATURE_GAMING: _NV_LICENSE_FEATURE_TYPE = 3; +pub const _NV_LICENSE_FEATURE_TYPE_NV_LICENSE_FEATURE_COMPUTE: _NV_LICENSE_FEATURE_TYPE = 4; +#[doc = "! Used in NV_LICENSE_FEATURE_DETAILS"] +pub type _NV_LICENSE_FEATURE_TYPE = ::std::os::raw::c_int; +#[doc = "! Used in NV_LICENSE_FEATURE_DETAILS"] +pub use self::_NV_LICENSE_FEATURE_TYPE as NV_LICENSE_FEATURE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LICENSE_EXPIRY_DETAILS { + #[doc = "!< Year value of license expiry"] + pub year: NvU32, + #[doc = "!< Month value of license expiry"] + pub month: NvU16, + #[doc = "!< Day value of license expiry"] + pub day: NvU16, + #[doc = "!< Hour value of license expiry"] + pub hour: NvU16, + #[doc = "!< Minutes value of license expiry"] + pub min: NvU16, + #[doc = "!< Seconds value of license expiry"] + pub sec: NvU16, + #[doc = "!< License expiry status"] + pub status: NvU8, +} +pub type NV_LICENSE_EXPIRY_DETAILS = _NV_LICENSE_EXPIRY_DETAILS; +#[doc = "! Used in NV_LICENSABLE_FEATURES"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LICENSE_FEATURE_DETAILS_V1 { + #[doc = "!< IN - Structure version."] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Feature code that corresponds to the licensable feature."] + pub featureCode: NV_LICENSE_FEATURE_TYPE, + #[doc = "!< Deprecated"] + pub licenseInfo: NvAPI_LicenseString, +} +impl _NV_LICENSE_FEATURE_DETAILS_V1 { + #[inline] + pub fn isEnabled(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isEnabled(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isEnabled_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isEnabled_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isEnabled: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isEnabled: u32 = unsafe { ::std::mem::transmute(isEnabled) }; + isEnabled as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! Used in NV_LICENSABLE_FEATURES"] +pub type NV_LICENSE_FEATURE_DETAILS_V1 = _NV_LICENSE_FEATURE_DETAILS_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LICENSE_FEATURE_DETAILS_V2 { + #[doc = "!< Unused."] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Feature code that corresponds to the licensable feature."] + pub featureCode: NV_LICENSE_FEATURE_TYPE, + #[doc = "!< Deprecated"] + pub licenseInfo: NvAPI_LicenseString, + #[doc = "!< Nvidia Grid licensable product name."] + pub productName: NvAPI_LicenseString, +} +impl _NV_LICENSE_FEATURE_DETAILS_V2 { + #[inline] + pub fn isEnabled(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isEnabled(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isEnabled_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isEnabled_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isEnabled: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isEnabled: u32 = unsafe { ::std::mem::transmute(isEnabled) }; + isEnabled as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_LICENSE_FEATURE_DETAILS_V2 = _NV_LICENSE_FEATURE_DETAILS_V2; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LICENSE_FEATURE_DETAILS_V3 { + #[doc = "!< Unused."] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Feature code that corresponds to the licensable feature."] + pub featureCode: NV_LICENSE_FEATURE_TYPE, + #[doc = "!< Deprecated"] + pub licenseInfo: NvAPI_LicenseString, + #[doc = "!< Nvidia Grid licensable product name."] + pub productName: NvAPI_LicenseString, +} +impl _NV_LICENSE_FEATURE_DETAILS_V3 { + #[inline] + pub fn isEnabled(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isEnabled(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isEnabled_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isEnabled_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isFeatureEnabled(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_isFeatureEnabled(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isFeatureEnabled_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isFeatureEnabled_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 30u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 30u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isEnabled: NvU32, + isFeatureEnabled: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isEnabled: u32 = unsafe { ::std::mem::transmute(isEnabled) }; + isEnabled as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let isFeatureEnabled: u32 = unsafe { ::std::mem::transmute(isFeatureEnabled) }; + isFeatureEnabled as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_LICENSE_FEATURE_DETAILS_V3 = _NV_LICENSE_FEATURE_DETAILS_V3; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LICENSE_FEATURE_DETAILS_V4 { + #[doc = "!< Unused."] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Feature code that corresponds to the licensable feature."] + pub featureCode: NV_LICENSE_FEATURE_TYPE, + #[doc = "!< Deprecated"] + pub licenseInfo: NvAPI_LicenseString, + #[doc = "!< Nvidia Grid licensable product name."] + pub productName: NvAPI_LicenseString, + #[doc = "!< License expiry information."] + pub licenseExpiry: NV_LICENSE_EXPIRY_DETAILS, +} +impl _NV_LICENSE_FEATURE_DETAILS_V4 { + #[inline] + pub fn isEnabled(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isEnabled(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isEnabled_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isEnabled_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isFeatureEnabled(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_isFeatureEnabled(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isFeatureEnabled_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isFeatureEnabled_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 30u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 30u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isEnabled: NvU32, + isFeatureEnabled: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isEnabled: u32 = unsafe { ::std::mem::transmute(isEnabled) }; + isEnabled as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let isFeatureEnabled: u32 = unsafe { ::std::mem::transmute(isFeatureEnabled) }; + isFeatureEnabled as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_LICENSE_FEATURE_DETAILS_V4 = _NV_LICENSE_FEATURE_DETAILS_V4; +#[doc = "! Used in NV_LICENSABLE_FEATURES"] +pub type NV_LICENSE_FEATURE_DETAILS = NV_LICENSE_FEATURE_DETAILS_V1; +#[doc = "! Licensable features"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LICENSABLE_FEATURES_V1 { + #[doc = "!< IN - Structure version."] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< The number of licensable features."] + pub licensableFeatureCount: NvU32, + #[doc = "!< Dynamic signature required for Authentication of the components,\n!< signature length limited to NV_LICENSE_SIGNATURE_SIZE"] + pub signature: [NvU8; 128usize], + #[doc = "!< Array of licensable features"] + pub licenseDetails: [NV_LICENSE_FEATURE_DETAILS_V1; 3usize], +} +impl _NV_LICENSABLE_FEATURES_V1 { + #[inline] + pub fn isLicenseSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isLicenseSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isLicenseSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isLicenseSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isLicenseSupported: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isLicenseSupported: u32 = unsafe { ::std::mem::transmute(isLicenseSupported) }; + isLicenseSupported as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! Licensable features"] +pub type NV_LICENSABLE_FEATURES_V1 = _NV_LICENSABLE_FEATURES_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LICENSABLE_FEATURES_V2 { + #[doc = "!< IN - Structure version."] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< The number of licensable features."] + pub licensableFeatureCount: NvU32, + #[doc = "!< Dynamic signature required for Authentication of the components,\n!< signature length limited to NV_LICENSE_SIGNATURE_SIZE"] + pub signature: [NvU8; 128usize], + #[doc = "!< Array of licensable features"] + pub licenseDetails: [NV_LICENSE_FEATURE_DETAILS_V2; 3usize], +} +impl _NV_LICENSABLE_FEATURES_V2 { + #[inline] + pub fn isLicenseSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isLicenseSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isLicenseSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isLicenseSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isLicenseSupported: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isLicenseSupported: u32 = unsafe { ::std::mem::transmute(isLicenseSupported) }; + isLicenseSupported as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_LICENSABLE_FEATURES_V2 = _NV_LICENSABLE_FEATURES_V2; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LICENSABLE_FEATURES_V3 { + #[doc = "!< IN - Structure version."] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< The number of licensable features."] + pub licensableFeatureCount: NvU32, + #[doc = "!< Dynamic signature required for Authentication of the components,\n!< signature length limited to NV_LICENSE_SIGNATURE_SIZE"] + pub signature: [NvU8; 128usize], + #[doc = "!< Array of licensable features"] + pub licenseDetails: [NV_LICENSE_FEATURE_DETAILS_V3; 3usize], +} +impl _NV_LICENSABLE_FEATURES_V3 { + #[inline] + pub fn isLicenseSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isLicenseSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isLicenseSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isLicenseSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isLicenseSupported: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isLicenseSupported: u32 = unsafe { ::std::mem::transmute(isLicenseSupported) }; + isLicenseSupported as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_LICENSABLE_FEATURES_V3 = _NV_LICENSABLE_FEATURES_V3; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LICENSABLE_FEATURES_V4 { + #[doc = "!< IN - Structure version."] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< The number of licensable features."] + pub licensableFeatureCount: NvU32, + #[doc = "!< Dynamic signature required for Authentication of the components,\n!< signature length limited to NV_LICENSE_SIGNATURE_SIZE"] + pub signature: [NvU8; 128usize], + #[doc = "!< Array of licensable features"] + pub licenseDetails: [NV_LICENSE_FEATURE_DETAILS_V4; 3usize], +} +impl _NV_LICENSABLE_FEATURES_V4 { + #[inline] + pub fn isLicenseSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isLicenseSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isLicenseSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isLicenseSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isLicenseSupported: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isLicenseSupported: u32 = unsafe { ::std::mem::transmute(isLicenseSupported) }; + isLicenseSupported as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_LICENSABLE_FEATURES_V4 = _NV_LICENSABLE_FEATURES_V4; +pub type NV_LICENSABLE_FEATURES = NV_LICENSABLE_FEATURES_V4; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_ENCODER_STATISTICS_V1 { + #[doc = "!< [in] Structure version value."] + pub version: NvU32, + #[doc = "!< [out] Count of active encoder sessions."] + pub sessionsCount: NvU32, + #[doc = "!< [out] Trailing average FPS of all active sessions."] + pub averageFps: NvU32, + #[doc = "!< [out] Encode latency in microseconds."] + pub averageLatency: NvU32, +} +pub type NV_ENCODER_STATISTICS_V1 = _NV_ENCODER_STATISTICS_V1; +pub type NV_ENCODER_STATISTICS = NV_ENCODER_STATISTICS_V1; +pub const _NV_ENCODER_TYPE_NV_ENCODER_H264: _NV_ENCODER_TYPE = 0; +pub const _NV_ENCODER_TYPE_NV_ENCODER_HEVC: _NV_ENCODER_TYPE = 1; +pub const _NV_ENCODER_TYPE_NV_ENCODER_UNKNOWN: _NV_ENCODER_TYPE = -1; +pub type _NV_ENCODER_TYPE = ::std::os::raw::c_int; +pub use self::_NV_ENCODER_TYPE as NV_ENCODER_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_ENCODER_PER_SESSION_INFO_V1 { + #[doc = "!< Unique session ID."] + pub sessionId: NvU32, + #[doc = "!< Owning process ID."] + pub processId: NvU32, + #[doc = "!< Owning vGPU instance ID (only valid on vGPU hosts, otherwise zero)."] + pub vgpuInstance: NvU32, + #[doc = "!< Video encoder type."] + pub codecType: NV_ENCODER_TYPE, + #[doc = "!< Current encode horizontal resolution."] + pub hResolution: NvU32, + #[doc = "!< Current encode vertical resolution."] + pub vResolution: NvU32, + #[doc = "!< Moving average encode frames per second."] + pub averageEncodeFps: NvU32, + #[doc = "!< Moving average encode latency in microseconds."] + pub averageEncodeLatency: NvU32, +} +pub type NV_ENCODER_PER_SESSION_INFO_V1 = _NV_ENCODER_PER_SESSION_INFO_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_ENCODER_SESSIONS_INFO_V1 { + #[doc = "!< [in] Structure version value."] + pub version: NvU32, + #[doc = "!< [out] Count of active encoder sessions."] + pub sessionsCount: NvU32, + #[doc = "!< [out] Array of session info. Caller should allocate memory for this field before making\n!< the NvAPI_GPU_GetEncoderSessionsInfo() call, memory allocated should be of\n!< size = sizeof(NV_ENCODER_PER_SESSION_INFO_V1) * NV_ENCODER_SESSION_INFO_MAX_ENTRIES_V1."] + pub pSessionInfo: *mut NV_ENCODER_PER_SESSION_INFO_V1, +} +pub type NV_ENCODER_SESSIONS_INFO_V1 = _NV_ENCODER_SESSIONS_INFO_V1; +pub type NV_ENCODER_SESSIONS_INFO = NV_ENCODER_SESSIONS_INFO_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_INFO_V1 { + #[doc = "!< Structure Version."] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl _NV_GPU_INFO_V1 { + #[inline] + pub fn bIsExternalGpu(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsExternalGpu(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsExternalGpu_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsExternalGpu_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsExternalGpu: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsExternalGpu: u32 = unsafe { ::std::mem::transmute(bIsExternalGpu) }; + bIsExternalGpu as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_GPU_INFO_V1 = _NV_GPU_INFO_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_INFO_V2 { + #[doc = "!< Structure Version."] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Reserved for future use"] + pub reserved1: NvU64, + #[doc = "!< Number of \"Ray Tracing Cores\" supported by the GPU."] + pub rayTracingCores: NvU32, + #[doc = "!< Number of \"Tensor Cores\" supported by the GPU."] + pub tensorCores: NvU32, + #[doc = "!< Reserved for future use."] + pub reserved2: [NvU32; 14usize], +} +impl _NV_GPU_INFO_V2 { + #[inline] + pub fn bIsExternalGpu(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsExternalGpu(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsExternalGpu_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsExternalGpu_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved0(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved0(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved0_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved0_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsExternalGpu: NvU32, + reserved0: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsExternalGpu: u32 = unsafe { ::std::mem::transmute(bIsExternalGpu) }; + bIsExternalGpu as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved0: u32 = unsafe { ::std::mem::transmute(reserved0) }; + reserved0 as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_GPU_INFO_V2 = _NV_GPU_INFO_V2; +pub type NV_GPU_INFO = NV_GPU_INFO_V2; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_VR_READY_V1 { + #[doc = "!< Structure Version."] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl _NV_GPU_VR_READY_V1 { + #[inline] + pub fn isVRReady(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isVRReady(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isVRReady_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isVRReady_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isVRReady: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isVRReady: u32 = unsafe { ::std::mem::transmute(isVRReady) }; + isVRReady as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_GPU_VR_READY_V1 = _NV_GPU_VR_READY_V1; +pub type NV_GPU_VR_READY = NV_GPU_VR_READY_V1; +pub const _NV_ADAPTER_TYPE_NV_ADAPTER_TYPE_UNKNOWN: _NV_ADAPTER_TYPE = 0; +pub const _NV_ADAPTER_TYPE_NV_ADAPTER_TYPE_WDDM: _NV_ADAPTER_TYPE = 1; +pub const _NV_ADAPTER_TYPE_NV_ADAPTER_TYPE_MCDM: _NV_ADAPTER_TYPE = 2; +pub const _NV_ADAPTER_TYPE_NV_ADAPTER_TYPE_TCC: _NV_ADAPTER_TYPE = 4; +pub const _NV_ADAPTER_TYPE_NV_ADAPTER_TYPE_LAST: _NV_ADAPTER_TYPE = -1; +pub type _NV_ADAPTER_TYPE = ::std::os::raw::c_int; +pub use self::_NV_ADAPTER_TYPE as NV_ADAPTER_TYPE; +#[doc = "! \\ingroup gpu\n! Used in NvAPI_GPU_GetGspFeatures()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_GSP_INFO_V1 { + #[doc = "!< [in] Structure version"] + pub version: NvU32, + #[doc = "!< [out] Contains GSP firmware version"] + pub firmwareVersion: [NvU8; 64usize], + #[doc = "!< Reserved for future use"] + pub reserved: NvU32, +} +#[doc = "! \\ingroup gpu\n! Used in NvAPI_GPU_GetGspFeatures()."] +pub type NV_GPU_GSP_INFO_V1 = _NV_GPU_GSP_INFO_V1; +#[doc = "! \\ingroup gpu\n! Used in NvAPI_GPU_GetGspFeatures()."] +pub type NV_GPU_GSP_INFO = NV_GPU_GSP_INFO_V1; +#[doc = "! \\fn NvAPI_GPU_GetUUID(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_UUID *pGpuUuid)\n! DESCRIPTION: This function returns the GPU UUID for the specified physical GPU handle.\n! The UUID is returned in GUID format (16 bytes).\n!\n! SUPPORTED OS: Windows 10 and higher\n!\n!\n! TCC_SUPPORTED\n!\n! MCDM_SUPPORTED\n!\n! \\since Release: 595\n!\n! \\param [in] hPhysicalGpu Physical GPU handle to get UUID for\n! \\param [in,out] pGpuUuid Pointer to structure that will receive the GPU UUID\n!\n! \\retval NVAPI_OK Request completed successfully\n! \\return This API can return any of the error codes enumerated in #NvAPI_Status.\n!\n! \\ingroup gpu\n\n! Used in NvAPI_GPU_GetUUID()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_UUID_V1 { + pub version: NvU32, + pub uuid: [NvU8; 16usize], +} +#[doc = "! \\fn NvAPI_GPU_GetUUID(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_UUID *pGpuUuid)\n! DESCRIPTION: This function returns the GPU UUID for the specified physical GPU handle.\n! The UUID is returned in GUID format (16 bytes).\n!\n! SUPPORTED OS: Windows 10 and higher\n!\n!\n! TCC_SUPPORTED\n!\n! MCDM_SUPPORTED\n!\n! \\since Release: 595\n!\n! \\param [in] hPhysicalGpu Physical GPU handle to get UUID for\n! \\param [in,out] pGpuUuid Pointer to structure that will receive the GPU UUID\n!\n! \\retval NVAPI_OK Request completed successfully\n! \\return This API can return any of the error codes enumerated in #NvAPI_Status.\n!\n! \\ingroup gpu\n\n! Used in NvAPI_GPU_GetUUID()"] +pub type NV_GPU_UUID_V1 = _NV_GPU_UUID_V1; +#[doc = "! \\fn NvAPI_GPU_GetUUID(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_UUID *pGpuUuid)\n! DESCRIPTION: This function returns the GPU UUID for the specified physical GPU handle.\n! The UUID is returned in GUID format (16 bytes).\n!\n! SUPPORTED OS: Windows 10 and higher\n!\n!\n! TCC_SUPPORTED\n!\n! MCDM_SUPPORTED\n!\n! \\since Release: 595\n!\n! \\param [in] hPhysicalGpu Physical GPU handle to get UUID for\n! \\param [in,out] pGpuUuid Pointer to structure that will receive the GPU UUID\n!\n! \\retval NVAPI_OK Request completed successfully\n! \\return This API can return any of the error codes enumerated in #NvAPI_Status.\n!\n! \\ingroup gpu\n\n! Used in NvAPI_GPU_GetUUID()"] +pub type NV_GPU_UUID = NV_GPU_UUID_V1; +#[doc = "! \\ingroup gpupstate\n! Used in NvAPI_GPU_GetPstatesInfoEx()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PERF_PSTATES_INFO_V1 { + pub version: NvU32, + #[doc = "!< - bit 0 indicates if perfmon is enabled or not\n!< - bit 1 indicates if dynamic Pstate is capable or not\n!< - bit 2 indicates if dynamic Pstate is enable or not\n!< - all other bits must be set to 0"] + pub flags: NvU32, + #[doc = "!< The number of available p-states"] + pub numPstates: NvU32, + #[doc = "!< The number of clock domains supported by each P-State"] + pub numClocks: NvU32, + pub pstates: [NV_GPU_PERF_PSTATES_INFO_V1__bindgen_ty_1; 16usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PERF_PSTATES_INFO_V1__bindgen_ty_1 { + #[doc = "!< ID of the p-state."] + pub pstateId: NV_GPU_PERF_PSTATE_ID, + #[doc = "!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2\n!< - bit 1 indicates if the Pstate is overclocked or not\n!< - bit 2 indicates if the Pstate is overclockable or not\n!< - all other bits must be set to 0"] + pub flags: NvU32, + pub clocks: [NV_GPU_PERF_PSTATES_INFO_V1__bindgen_ty_1__bindgen_ty_1; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PERF_PSTATES_INFO_V1__bindgen_ty_1__bindgen_ty_1 { + #[doc = "!< ID of the clock domain"] + pub domainId: NV_GPU_PUBLIC_CLOCK_ID, + #[doc = "!< Reserved. Must be set to 0"] + pub flags: NvU32, + #[doc = "!< Clock frequency in kHz"] + pub freq: NvU32, +} +#[doc = "! \\ingroup gpupstate"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PERF_PSTATES_INFO_V2 { + pub version: NvU32, + #[doc = "!< - bit 0 indicates if perfmon is enabled or not\n!< - bit 1 indicates if dynamic Pstate is capable or not\n!< - bit 2 indicates if dynamic Pstate is enable or not\n!< - all other bits must be set to 0"] + pub flags: NvU32, + #[doc = "!< The number of available p-states"] + pub numPstates: NvU32, + #[doc = "!< The number of clock domains supported by each P-State"] + pub numClocks: NvU32, + pub numVoltages: NvU32, + #[doc = "!< Valid index range is 0 to numVoltages-1"] + pub pstates: [NV_GPU_PERF_PSTATES_INFO_V2__bindgen_ty_1; 16usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PERF_PSTATES_INFO_V2__bindgen_ty_1 { + #[doc = "!< ID of the p-state."] + pub pstateId: NV_GPU_PERF_PSTATE_ID, + #[doc = "!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2\n!< - bit 1 indicates if the Pstate is overclocked or not\n!< - bit 2 indicates if the Pstate is overclockable or not\n!< - all other bits must be set to 0"] + pub flags: NvU32, + pub clocks: [NV_GPU_PERF_PSTATES_INFO_V2__bindgen_ty_1__bindgen_ty_1; 32usize], + pub voltages: [NV_GPU_PERF_PSTATES_INFO_V2__bindgen_ty_1__bindgen_ty_2; 16usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PERF_PSTATES_INFO_V2__bindgen_ty_1__bindgen_ty_1 { + pub domainId: NV_GPU_PUBLIC_CLOCK_ID, + #[doc = "!< bit 0 indicates if this clock is overclockable\n!< all other bits must be set to 0"] + pub flags: NvU32, + pub freq: NvU32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_PERF_PSTATES_INFO_V2__bindgen_ty_1__bindgen_ty_2 { + #[doc = "!< ID of the voltage domain, containing flags and mvolt info"] + pub domainId: NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID, + #[doc = "!< Reserved for future use. Must be set to 0"] + pub flags: NvU32, + #[doc = "!< Voltage in mV"] + pub mvolt: NvU32, +} +#[doc = "! \\ingroup gpupstate"] +pub type NV_GPU_PERF_PSTATES_INFO = NV_GPU_PERF_PSTATES_INFO_V2; +#[doc = "! \\ingroup gpupstate\n! Used in NvAPI_GPU_GetDynamicPstatesInfoEx()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_DYNAMIC_PSTATES_INFO_EX { + #[doc = "!< Structure version"] + pub version: NvU32, + #[doc = "!< bit 0 indicates if the dynamic Pstate is enabled or not"] + pub flags: NvU32, + pub utilization: [NV_GPU_DYNAMIC_PSTATES_INFO_EX__bindgen_ty_1; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_DYNAMIC_PSTATES_INFO_EX__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + #[doc = "!< Percentage of time where the domain is considered busy in the last 1 second interval"] + pub percentage: NvU32, +} +impl NV_GPU_DYNAMIC_PSTATES_INFO_EX__bindgen_ty_1 { + #[inline] + pub fn bIsPresent(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsPresent(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsPresent_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsPresent_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1(bIsPresent: NvU32) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsPresent: u32 = unsafe { ::std::mem::transmute(bIsPresent) }; + bIsPresent as u64 + }); + __bindgen_bitfield_unit + } +} +pub const NV_THERMAL_TARGET_NVAPI_THERMAL_TARGET_NONE: NV_THERMAL_TARGET = 0; +#[doc = "!< GPU core temperature requires NvPhysicalGpuHandle"] +pub const NV_THERMAL_TARGET_NVAPI_THERMAL_TARGET_GPU: NV_THERMAL_TARGET = 1; +#[doc = "!< GPU memory temperature requires NvPhysicalGpuHandle"] +pub const NV_THERMAL_TARGET_NVAPI_THERMAL_TARGET_MEMORY: NV_THERMAL_TARGET = 2; +#[doc = "!< GPU power supply temperature requires NvPhysicalGpuHandle"] +pub const NV_THERMAL_TARGET_NVAPI_THERMAL_TARGET_POWER_SUPPLY: NV_THERMAL_TARGET = 4; +#[doc = "!< GPU board ambient temperature requires NvPhysicalGpuHandle"] +pub const NV_THERMAL_TARGET_NVAPI_THERMAL_TARGET_BOARD: NV_THERMAL_TARGET = 8; +#[doc = "!< Visual Computing Device Board temperature requires NvVisualComputingDeviceHandle"] +pub const NV_THERMAL_TARGET_NVAPI_THERMAL_TARGET_VCD_BOARD: NV_THERMAL_TARGET = 9; +#[doc = "!< Visual Computing Device Inlet temperature requires NvVisualComputingDeviceHandle"] +pub const NV_THERMAL_TARGET_NVAPI_THERMAL_TARGET_VCD_INLET: NV_THERMAL_TARGET = 10; +#[doc = "!< Visual Computing Device Outlet temperature requires NvVisualComputingDeviceHandle"] +pub const NV_THERMAL_TARGET_NVAPI_THERMAL_TARGET_VCD_OUTLET: NV_THERMAL_TARGET = 11; +pub const NV_THERMAL_TARGET_NVAPI_THERMAL_TARGET_ALL: NV_THERMAL_TARGET = 15; +pub const NV_THERMAL_TARGET_NVAPI_THERMAL_TARGET_UNKNOWN: NV_THERMAL_TARGET = -1; +#[doc = "! \\ingroup gputhermal\n! Used in NV_GPU_THERMAL_SETTINGS"] +pub type NV_THERMAL_TARGET = ::std::os::raw::c_int; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_NONE: NV_THERMAL_CONTROLLER = 0; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_GPU_INTERNAL: NV_THERMAL_CONTROLLER = 1; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_ADM1032: NV_THERMAL_CONTROLLER = 2; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_MAX6649: NV_THERMAL_CONTROLLER = 3; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_MAX1617: NV_THERMAL_CONTROLLER = 4; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_LM99: NV_THERMAL_CONTROLLER = 5; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_LM89: NV_THERMAL_CONTROLLER = 6; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_LM64: NV_THERMAL_CONTROLLER = 7; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_ADT7473: NV_THERMAL_CONTROLLER = 8; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_SBMAX6649: NV_THERMAL_CONTROLLER = 9; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_VBIOSEVT: NV_THERMAL_CONTROLLER = 10; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_OS: NV_THERMAL_CONTROLLER = 11; +pub const NV_THERMAL_CONTROLLER_NVAPI_THERMAL_CONTROLLER_UNKNOWN: NV_THERMAL_CONTROLLER = -1; +#[doc = "! \\ingroup gputhermal\n! Used in NV_GPU_THERMAL_SETTINGS"] +pub type NV_THERMAL_CONTROLLER = ::std::os::raw::c_int; +#[doc = "! \\ingroup gputhermal\n! Used in NvAPI_GPU_GetThermalSettings()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_THERMAL_SETTINGS_V1 { + #[doc = "!< structure version"] + pub version: NvU32, + #[doc = "!< number of associated thermal sensors"] + pub count: NvU32, + pub sensor: [NV_GPU_THERMAL_SETTINGS_V1__bindgen_ty_1; 3usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_THERMAL_SETTINGS_V1__bindgen_ty_1 { + #[doc = "!< internal, ADM1032, MAX6649..."] + pub controller: NV_THERMAL_CONTROLLER, + #[doc = "!< The min default temperature value of the thermal sensor in degree Celsius"] + pub defaultMinTemp: NvU32, + #[doc = "!< The max default temperature value of the thermal sensor in degree Celsius"] + pub defaultMaxTemp: NvU32, + #[doc = "!< The current temperature value of the thermal sensor in degree Celsius"] + pub currentTemp: NvU32, + #[doc = "!< Thermal sensor targeted @ GPU, memory, chipset, powersupply, Visual Computing Device, etc."] + pub target: NV_THERMAL_TARGET, +} +#[doc = "! \\ingroup gputhermal"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_THERMAL_SETTINGS_V2 { + #[doc = "!< structure version"] + pub version: NvU32, + #[doc = "!< number of associated thermal sensors"] + pub count: NvU32, + pub sensor: [NV_GPU_THERMAL_SETTINGS_V2__bindgen_ty_1; 3usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_THERMAL_SETTINGS_V2__bindgen_ty_1 { + #[doc = "!< internal, ADM1032, MAX6649..."] + pub controller: NV_THERMAL_CONTROLLER, + #[doc = "!< Minimum default temperature value of the thermal sensor in degree Celsius"] + pub defaultMinTemp: NvS32, + #[doc = "!< Maximum default temperature value of the thermal sensor in degree Celsius"] + pub defaultMaxTemp: NvS32, + #[doc = "!< Current temperature value of the thermal sensor in degree Celsius"] + pub currentTemp: NvS32, + #[doc = "!< Thermal sensor targeted - GPU, memory, chipset, powersupply, Visual Computing Device, etc"] + pub target: NV_THERMAL_TARGET, +} +#[doc = "! \\ingroup gputhermal"] +pub type NV_GPU_THERMAL_SETTINGS = NV_GPU_THERMAL_SETTINGS_V2; +#[doc = "! \\ingroup gpuclock\n! Used in NvAPI_GPU_GetAllClockFrequencies()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_CLOCK_FREQUENCIES_V1 { + #[doc = "!< Structure version"] + pub version: NvU32, + #[doc = "!< These bits are reserved for future use."] + pub reserved: NvU32, + pub domain: [NV_GPU_CLOCK_FREQUENCIES_V1__bindgen_ty_1; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_CLOCK_FREQUENCIES_V1__bindgen_ty_1 { + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Clock frequency (kHz)"] + pub frequency: NvU32, +} +impl NV_GPU_CLOCK_FREQUENCIES_V1__bindgen_ty_1 { + #[inline] + pub fn bIsPresent(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsPresent(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsPresent_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsPresent_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsPresent: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsPresent: u32 = unsafe { ::std::mem::transmute(bIsPresent) }; + bIsPresent as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub const NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE_NV_GPU_CLOCK_FREQUENCIES_CURRENT_FREQ: + NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE = 0; +pub const NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE_NV_GPU_CLOCK_FREQUENCIES_BASE_CLOCK: + NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE = 1; +pub const NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE_NV_GPU_CLOCK_FREQUENCIES_BOOST_CLOCK: + NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE = 2; +pub const NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE_NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE_NUM: + NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE = 3; +#[doc = "! \\ingroup gpuclock\n! Used in NvAPI_GPU_GetAllClockFrequencies()"] +pub type NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpuclock\n! Used in NvAPI_GPU_GetAllClockFrequencies()"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_CLOCK_FREQUENCIES_V2 { + #[doc = "!< Structure version"] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + pub domain: [NV_GPU_CLOCK_FREQUENCIES_V2__bindgen_ty_1; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_CLOCK_FREQUENCIES_V2__bindgen_ty_1 { + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Clock frequency (kHz)"] + pub frequency: NvU32, +} +impl NV_GPU_CLOCK_FREQUENCIES_V2__bindgen_ty_1 { + #[inline] + pub fn bIsPresent(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsPresent(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsPresent_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsPresent_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsPresent: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsPresent: u32 = unsafe { ::std::mem::transmute(bIsPresent) }; + bIsPresent as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +impl NV_GPU_CLOCK_FREQUENCIES_V2 { + #[inline] + pub fn ClockType(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) } + } + #[inline] + pub fn set_ClockType(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn ClockType_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 4u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_ClockType_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 20u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 20u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 20u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 20u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved1(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + } + #[inline] + pub fn set_reserved1(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved1_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 24usize, + 8u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved1_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 24usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + ClockType: NvU32, + reserved: NvU32, + reserved1: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let ClockType: u32 = unsafe { ::std::mem::transmute(ClockType) }; + ClockType as u64 + }); + __bindgen_bitfield_unit.set(4usize, 20u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit.set(24usize, 8u8, { + let reserved1: u32 = unsafe { ::std::mem::transmute(reserved1) }; + reserved1 as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup gpuclock\n! Used in NvAPI_GPU_GetAllClockFrequencies()"] +pub type NV_GPU_CLOCK_FREQUENCIES = NV_GPU_CLOCK_FREQUENCIES_V2; +pub const _NV_GPU_ILLUMINATION_ATTRIB_NV_GPU_IA_LOGO_BRIGHTNESS: _NV_GPU_ILLUMINATION_ATTRIB = 0; +pub const _NV_GPU_ILLUMINATION_ATTRIB_NV_GPU_IA_SLI_BRIGHTNESS: _NV_GPU_ILLUMINATION_ATTRIB = 1; +#[doc = "! \\ingroup gpu"] +pub type _NV_GPU_ILLUMINATION_ATTRIB = ::std::os::raw::c_int; +#[doc = "! \\ingroup gpu"] +pub use self::_NV_GPU_ILLUMINATION_ATTRIB as NV_GPU_ILLUMINATION_ATTRIB; +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< The handle of the GPU that you are checking for the specified attribute.\n!< note that this is the GPU that is managing the attribute.\n!< Only a single GPU can manage an given attribute on a given HW element,\n!< regardless of how many are attatched.\n!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,\n!< regardless of how many are physicaly attached.\n!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute."] + pub hPhysicalGpu: NvPhysicalGpuHandle, + #[doc = "!< An enumeration value specifying the Illumination attribute to be querried.\n!< refer to enum \\ref NV_GPU_ILLUMINATION_ATTRIB."] + pub Attribute: NV_GPU_ILLUMINATION_ATTRIB, + #[doc = "!< A boolean indicating if the attribute is supported."] + pub bSupported: NvU32, +} +#[doc = "! \\ingroup gpu"] +pub type NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1 = _NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1; +#[doc = "! \\ingroup gpu"] +pub type NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM = NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1; +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_GET_ILLUMINATION_PARM_V1 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< The handle of the GPU that you are checking for the specified attribute.\n!< Note that this is the GPU that is managing the attribute.\n!< Only a single GPU can manage an given attribute on a given HW element,\n!< regardless of how many are attatched.\n!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,\n!< regardless of how many are physicaly attached.\n!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute."] + pub hPhysicalGpu: NvPhysicalGpuHandle, + #[doc = "!< An enumeration value specifying the Illumination attribute to be querried.\n!< refer to enum \\ref NV_GPU_ILLUMINATION_ATTRIB."] + pub Attribute: NV_GPU_ILLUMINATION_ATTRIB, + #[doc = "!< A DWORD that will contain the current value of the specified attribute."] + pub Value: NvU32, +} +#[doc = "! \\ingroup gpu"] +pub type NV_GPU_GET_ILLUMINATION_PARM_V1 = _NV_GPU_GET_ILLUMINATION_PARM_V1; +#[doc = "! \\ingroup gpu"] +pub type NV_GPU_GET_ILLUMINATION_PARM = NV_GPU_GET_ILLUMINATION_PARM_V1; +#[doc = "! \\ingroup gpu"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_SET_ILLUMINATION_PARM_V1 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< The handle of the GPU that you are checking for the specified attribute.\n!< Note that this is the GPU that is managing the attribute.\n!< Only a single GPU can manage an given attribute on a given HW element,\n!< regardless of how many are attatched.\n!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,\n!< regardless of how many are physicaly attached.\n!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute."] + pub hPhysicalGpu: NvPhysicalGpuHandle, + #[doc = "!< An enumeration value specifying the Illumination attribute to be querried.\n!< refer to enum \\ref NV_GPU_ILLUMINATION_ATTRIB."] + pub Attribute: NV_GPU_ILLUMINATION_ATTRIB, + #[doc = "!< A DWORD containing the new value for the specified attribute.\n!< This should be specified as a percentage of the full range of the attribute\n!< (0-100; 0 = off, 100 = full brightness)\n!< If a value is specified outside this range, NVAPI_INVALID_ARGUMENT will be returned."] + pub Value: NvU32, +} +#[doc = "! \\ingroup gpu"] +pub type NV_GPU_SET_ILLUMINATION_PARM_V1 = _NV_GPU_SET_ILLUMINATION_PARM_V1; +#[doc = "! \\ingroup gpu"] +pub type NV_GPU_SET_ILLUMINATION_PARM = NV_GPU_SET_ILLUMINATION_PARM_V1; +pub const NV_GPU_CLIENT_ILLUM_CTRL_MODE_NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB: + NV_GPU_CLIENT_ILLUM_CTRL_MODE = 0; +pub const NV_GPU_CLIENT_ILLUM_CTRL_MODE_NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB: + NV_GPU_CLIENT_ILLUM_CTRL_MODE = 1; +pub const NV_GPU_CLIENT_ILLUM_CTRL_MODE_NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL: + NV_GPU_CLIENT_ILLUM_CTRL_MODE = 0; +pub const NV_GPU_CLIENT_ILLUM_CTRL_MODE_NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR: + NV_GPU_CLIENT_ILLUM_CTRL_MODE = 1; +pub const NV_GPU_CLIENT_ILLUM_CTRL_MODE_NV_GPU_CLIENT_ILLUM_CTRL_MODE_INVALID: + NV_GPU_CLIENT_ILLUM_CTRL_MODE = 255; +#[doc = " Enumeration of control modes that can be applied to Illumination Zones."] +pub type NV_GPU_CLIENT_ILLUM_CTRL_MODE = ::std::os::raw::c_int; +pub const NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_TOP_0: + NV_GPU_CLIENT_ILLUM_ZONE_LOCATION = 0; +pub const NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_FRONT_0: + NV_GPU_CLIENT_ILLUM_ZONE_LOCATION = 8; +pub const NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_BACK_0: + NV_GPU_CLIENT_ILLUM_ZONE_LOCATION = 12; +pub const NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_SLI_TOP_0: + NV_GPU_CLIENT_ILLUM_ZONE_LOCATION = 32; +pub const NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_INVALID: + NV_GPU_CLIENT_ILLUM_ZONE_LOCATION = -1; +#[doc = " Enumeration of locations where an Illumination Zone might be present.\n Encoding used -\n 1:0 - Number specifier (0)\n 4:2 - Location (TOP)\n 7:5 - Type (GPU/SLI)"] +pub type NV_GPU_CLIENT_ILLUM_ZONE_LOCATION = ::std::os::raw::c_int; +pub const NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_INVALID: + NV_GPU_CLIENT_ILLUM_DEVICE_TYPE = 0; +pub const NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_MCUV10: + NV_GPU_CLIENT_ILLUM_DEVICE_TYPE = 1; +pub const NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_GPIO_PWM_RGBW_V10: + NV_GPU_CLIENT_ILLUM_DEVICE_TYPE = 2; +pub const NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_GPIO_PWM_SINGLE_COLOR_V10 : NV_GPU_CLIENT_ILLUM_DEVICE_TYPE = 3 ; +#[doc = " Enumeration of ILLUM_DEVICEs."] +pub type NV_GPU_CLIENT_ILLUM_DEVICE_TYPE = ::std::os::raw::c_int; +pub const NV_GPU_CLIENT_ILLUM_ZONE_TYPE_NV_GPU_CLIENT_ILLUM_ZONE_TYPE_INVALID: + NV_GPU_CLIENT_ILLUM_ZONE_TYPE = 0; +pub const NV_GPU_CLIENT_ILLUM_ZONE_TYPE_NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB: + NV_GPU_CLIENT_ILLUM_ZONE_TYPE = 1; +pub const NV_GPU_CLIENT_ILLUM_ZONE_TYPE_NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED: + NV_GPU_CLIENT_ILLUM_ZONE_TYPE = 2; +pub const NV_GPU_CLIENT_ILLUM_ZONE_TYPE_NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGBW: + NV_GPU_CLIENT_ILLUM_ZONE_TYPE = 3; +pub const NV_GPU_CLIENT_ILLUM_ZONE_TYPE_NV_GPU_CLIENT_ILLUM_ZONE_TYPE_SINGLE_COLOR: + NV_GPU_CLIENT_ILLUM_ZONE_TYPE = 4; +#[doc = " Enumeration of ILLUM_ZONEs."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_TYPE = ::std::os::raw::c_int; +pub const NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE_NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_HALF_HALT : NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE = 0 ; +pub const NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE_NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_FULL_HALT : NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE = 1 ; +pub const NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE_NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_FULL_REPEAT : NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE = 2 ; +pub const NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE_NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_INVALID : NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE = 255 ; +#[doc = " Enumeration of Cycle types for piecewise linear control mode."] +pub type NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE = ::std::os::raw::c_int; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1\n Describes the static information of illumination device type MCUV10."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10 { + #[doc = " I2C Device Index: Pointing to the illumination device in I2C Devices Table."] + pub i2cDevIdx: NvU8, +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1\n Describes the static information of illumination device type MCUV10."] +pub type NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10 = _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1\n Describes the static information of illum device type GPIO_PWM_RGBW."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW { + #[doc = " Red drive GPIO pin."] + pub gpioPinRed: NvU8, + #[doc = " Green drive GPIO pin."] + pub gpioPinGreen: NvU8, + #[doc = " Blue drive GPIO pin."] + pub gpioPinBlue: NvU8, + #[doc = " White drive GPIO pin."] + pub gpioPinWhite: NvU8, +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1\n Describes the static information of illum device type GPIO_PWM_RGBW."] +pub type NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW = + _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1\n Describes the static information of illum device type GPIO_PWM_SINGLE_COLOR."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR { + #[doc = " Single Color GPIO pin."] + pub gpioPinSingleColor: NvU8, +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1\n Describes the static information of illum device type GPIO_PWM_SINGLE_COLOR."] +pub type NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR = + _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 { + #[doc = " Type of the illumination device."] + pub type_: NV_GPU_CLIENT_ILLUM_DEVICE_TYPE, + #[doc = " Supported control modes for this illumination device."] + pub ctrlModeMask: NvU32, + pub data: _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1__bindgen_ty_1, + #[doc = " Reserved for future."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Union of illumination device info data. Interpreted as per\n @ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1::type"] +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1__bindgen_ty_1 { + pub mcuv10: NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10, + pub gpioPwmRgbwv10: NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW, + pub gpioPwmSingleColorv10: NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR, + #[doc = " Reserved bytes for possible future extension of this struct."] + pub rsvd: [NvU8; 64usize], +} +pub type NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 = _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1 { + #[doc = " Version of structure. Must always be first member."] + pub version: NvU32, + #[doc = " Number of illumination devices present."] + pub numIllumDevices: NvU32, + #[doc = " Reserved bytes for possible future extension of this struct."] + pub rsvd: [NvU8; 64usize], + pub devices: [NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1; 32usize], +} +pub type NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1 = _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1; +pub type NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS = NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1; +#[doc = " Structure representing the data required for synchronization."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_CLIENT_ILLUM_DEVICE_SYNC_V1 { + #[doc = " Boolean representing the need for synchronization."] + pub bSync: NvBool, + #[doc = " Time stamp value required for synchronization."] + pub timeStampms: NvU64, + #[doc = " Reserved for future."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Structure representing the device control parameters of each ILLUM_DEVICE."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1 { + #[doc = " Type of the illum device."] + pub type_: NV_GPU_CLIENT_ILLUM_DEVICE_TYPE, + #[doc = " Structure containing the synchronization data for the illumination device."] + pub syncData: NV_GPU_CLIENT_ILLUM_DEVICE_SYNC_V1, + #[doc = " Reserved for future."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Structure representing the device control parameters of each ILLUM_DEVICE."] +pub type NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL = NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1; +#[doc = " Structure representing the control parameters of ILLUM_DEVICE-s."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1 { + #[doc = " Version of structure. Must always be first member."] + pub version: NvU32, + #[doc = " Number of illumination devices present."] + pub numIllumDevices: NvU32, + #[doc = " Reserved bytes for possible future extension of this struct."] + pub rsvd: [NvU8; 64usize], + pub devices: [NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1; 32usize], +} +#[doc = " Structure representing the control parameters of ILLUM_DEVICE-s."] +pub type NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS = NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB { + pub rsvd: NvU8, +} +pub type NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB = _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1\n Describes the static information of illum zone type RGBW."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW { + pub rsvd: NvU8, +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1\n Describes the static information of illum zone type RGBW."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW = _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1\n Describes the static information of illum zone type SINGLE_COLOR."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR { + pub rsvd: NvU8, +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1\n Describes the static information of illum zone type SINGLE_COLOR."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR = + _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 { + pub type_: NV_GPU_CLIENT_ILLUM_ZONE_TYPE, + #[doc = " Index pointing to an Illumination Device that controls this zone."] + pub illumDeviceIdx: NvU8, + #[doc = " Provider index for representing logical to physical zone mapping."] + pub provIdx: NvU8, + #[doc = " Location of the zone on the board."] + pub zoneLocation: NV_GPU_CLIENT_ILLUM_ZONE_LOCATION, + pub data: _NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1__bindgen_ty_1, + pub rsvd: [NvU8; 64usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1__bindgen_ty_1 { + pub rgb: NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB, + pub rgbw: NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW, + pub singleColor: NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR, + #[doc = " Reserved bytes for possible future extension of this struct."] + pub rsvd: [NvU8; 64usize], +} +pub type NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 = _NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1 { + #[doc = " Version of structure. Must always be first member."] + pub version: NvU32, + #[doc = " Number of illumination zones present."] + pub numIllumZones: NvU32, + #[doc = " Reserved bytes for possible future extension of this struct."] + pub rsvd: [NvU8; 64usize], + pub zones: [NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1; 32usize], +} +pub type NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1 = _NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1; +pub type NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS = NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB\n Parameters required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS { + #[doc = " Red compenent of color applied to the zone."] + pub colorR: NvU8, + #[doc = " Green compenent of color applied to the zone."] + pub colorG: NvU8, + #[doc = " Blue compenent of color applied to the zone."] + pub colorB: NvU8, + #[doc = " Brightness perecentage value of the zone."] + pub brightnessPct: NvU8, +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB\n Parameters required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB\n Data required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB { + #[doc = " Parameters required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB."] + pub rgbParams: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS, +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB\n Data required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB; +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB\n Data required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR { + #[doc = " Type of cycle effect to apply."] + pub cycleType: NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE, + #[doc = " Number of times to repeat function within group period."] + pub grpCount: NvU8, + #[doc = " Time in ms to transition from color A to color B."] + pub riseTimems: NvU16, + #[doc = " Time in ms to transition from color B to color A."] + pub fallTimems: NvU16, + #[doc = " Time in ms to remain at color A before color A to color B transition."] + pub ATimems: NvU16, + #[doc = " Time in ms to remain at color B before color B to color A transition."] + pub BTimems: NvU16, + #[doc = " Time in ms to remain idle before next group of repeated function cycles."] + pub grpIdleTimems: NvU16, + #[doc = " Time in ms to offset the cycle relative to other zones."] + pub phaseOffsetms: NvU16, +} +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB\n Data required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB\n Data required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB { + #[doc = " Parameters required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB."] + pub rgbParams: [NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS; 2usize], + pub piecewiseLinearData: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR, +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB\n Data required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1\n Describes the control data for illumination zone of type\n \\ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB."] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB { + pub data: _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB__bindgen_ty_1, + #[doc = " Reserved for future."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Union of illumination zone control data for zone of type NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB.\n Interpreted as per ctrlMode."] +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB__bindgen_ty_1 { + pub manualRGB: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB, + pub piecewiseLinearRGB: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB, + #[doc = " Reserved bytes for possible future extension of this struct."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1\n Describes the control data for illumination zone of type\n \\ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB = _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB; +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED\n Parameters required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGB."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS { + #[doc = " Brightness percentage value of the zone."] + pub brightnessPct: NvU8, +} +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED\n Parameters required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGB."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED\n Data required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED { + #[doc = " Parameters required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB."] + pub colorFixedParams: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS, +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED\n Data required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED\n Data required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED { + #[doc = " Parameters required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB."] + pub colorFixedParams: [NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS; 2usize], + pub piecewiseLinearData: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR, +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED\n Data required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1\n Describes the control data for illum zone of type\n \\ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED."] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED { + pub data: _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED__bindgen_ty_1, + #[doc = " Reserved for future."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Union of illum zone control data for zone of type NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED.\n Interpreted as per ctrlMode."] +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED__bindgen_ty_1 { + pub manualColorFixed: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED, + pub piecewiseLinearColorFixed: + NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED, + #[doc = " Reserved bytes for possible future extension of this struct."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1\n Describes the control data for illum zone of type\n \\ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED; +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW\n Parameters required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGBW."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS { + #[doc = " Red component of color applied to the zone."] + pub colorR: NvU8, + #[doc = " Green component of color applied to the zone."] + pub colorG: NvU8, + #[doc = " Blue component of color applied to the zone."] + pub colorB: NvU8, + #[doc = " White component of color applied to the zone."] + pub colorW: NvU8, + #[doc = " Brightness percentage value of the zone."] + pub brightnessPct: NvU8, +} +#[doc = " Used in \\ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW\n Parameters required to represent control mode of type\n \\ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGBW."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS; +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_RGBW\n Data required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGBW."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW { + #[doc = " Parameters required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGBW."] + pub rgbwParams: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS, +} +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_RGBW\n Data required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGBW."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW; +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_RGBW\n Data required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGBW."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW { + #[doc = " Parameters required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGBW."] + pub rgbwParams: [NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS; 2usize], + pub piecewiseLinearData: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR, +} +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_RGBW\n Data required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGBW."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW; +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_V1\n Describes the control data for illum zone of type\n \\ref NV_GPU_ILLUM_ZONE_TYPE_RGBW."] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW { + pub data: _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW__bindgen_ty_1, + #[doc = " Reserved for future."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Union of illum zone control data for zone of type NV_GPU_ILLUM_ZONE_TYPE_RGBW.\n Interpreted as per ctrlMode."] +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW__bindgen_ty_1 { + pub manualRGBW: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW, + pub piecewiseLinearRGBW: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW, + #[doc = " Reserved bytes for possible future extension of this struct."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_V1\n Describes the control data for illum zone of type\n \\ref NV_GPU_ILLUM_ZONE_TYPE_RGBW."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW = _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW; +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR\n Parameters required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS { + #[doc = " Brightness percentage value of the zone."] + pub brightnessPct: NvU8, +} +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR\n Parameters required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS; +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR\n Data required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR { + #[doc = " Parameters required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR."] + pub singleColorParams: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS, +} +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR\n Data required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR; +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR\n Data required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_SINGLE_COLOR."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR { + #[doc = " Parameters required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_SINGLE_COLOR."] + pub singleColorParams: + [NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS; 2usize], + pub piecewiseLinearData: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR, +} +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR\n Data required to represent control mode of type\n \\ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_SINGLE_COLOR."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR; +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_V1\n Describes the control data for illum zone of type\n \\ref NV_GPU_ILLUM_ZONE_TYPE_SINGLE_COLOR."] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR { + pub data: _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR__bindgen_ty_1, + #[doc = " Reserved for future."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Union of illum zone control data for zone of type NV_GPU_ILLUM_ZONE_TYPE_SINGLE_COLOR.\n Interpreted as per ctrlMode."] +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR__bindgen_ty_1 { + pub manualSingleColor: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR, + pub piecewiseLinearSingleColor: + NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR, + #[doc = " Reserved bytes for possible future extension of this struct."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Used in \\ref NV_GPU_ILLUM_ZONE_CONTROL_V1\n Describes the control data for illum zone of type\n \\ref NV_GPU_ILLUM_ZONE_TYPE_SINGLE_COLOR."] +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR = + _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 { + pub type_: NV_GPU_CLIENT_ILLUM_ZONE_TYPE, + pub ctrlMode: NV_GPU_CLIENT_ILLUM_CTRL_MODE, + pub data: _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1__bindgen_ty_1, + pub rsvd: [NvU8; 64usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1__bindgen_ty_1 { + pub rgb: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB, + pub colorFixed: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED, + pub rgbw: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW, + pub singleColor: NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR, + pub rsvd: [NvU8; 64usize], +} +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 = _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1 { + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = " Number of illumination zones present."] + pub numIllumZonesControl: NvU32, + #[doc = " Reserved bytes for possible future extension of this struct."] + pub rsvd: [NvU8; 64usize], + pub zones: [NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1; 32usize], +} +impl _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1 { + #[inline] + pub fn bDefault(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bDefault(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bDefault_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bDefault_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn rsvdField(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_rsvdField(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn rsvdField_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_rsvdField_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bDefault: NvU32, + rsvdField: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bDefault: u32 = unsafe { ::std::mem::transmute(bDefault) }; + bDefault as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let rsvdField: u32 = unsafe { ::std::mem::transmute(rsvdField) }; + rsvdField as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1 = _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1; +pub type NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS = NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1; +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_GetDisplayPortInfo()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_DISPLAY_PORT_INFO_V1 { + #[doc = "!< Structure version"] + pub version: NvU32, + #[doc = "!< DPCD version of the monitor"] + pub dpcd_ver: NvU32, + #[doc = "!< Maximum supported link rate"] + pub maxLinkRate: NV_DP_LINK_RATE, + #[doc = "!< Maximum supported lane count"] + pub maxLaneCount: NV_DP_LANE_COUNT, + #[doc = "!< Current link rate"] + pub curLinkRate: NV_DP_LINK_RATE, + #[doc = "!< Current lane count"] + pub curLaneCount: NV_DP_LANE_COUNT, + #[doc = "!< Current color format"] + pub colorFormat: NV_DP_COLOR_FORMAT, + #[doc = "!< Dynamic range"] + pub dynamicRange: NV_DP_DYNAMIC_RANGE, + #[doc = "!< Ignored in RGB space"] + pub colorimetry: NV_DP_COLORIMETRY, + #[doc = "!< Current bit-per-component"] + pub bpc: NV_DP_BPC, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl _NV_DISPLAY_PORT_INFO_V1 { + #[inline] + pub fn isDp(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isDp(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isDp_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isDp_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isInternalDp(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_isInternalDp(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isInternalDp_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isInternalDp_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isColorCtrlSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_isColorCtrlSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isColorCtrlSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isColorCtrlSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn is6BPCSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_is6BPCSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn is6BPCSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_is6BPCSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn is8BPCSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_is8BPCSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn is8BPCSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_is8BPCSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn is10BPCSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_is10BPCSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn is10BPCSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_is10BPCSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn is12BPCSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + } + #[inline] + pub fn set_is12BPCSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn is12BPCSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_is12BPCSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn is16BPCSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } + } + #[inline] + pub fn set_is16BPCSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn is16BPCSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_is16BPCSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isYCrCb420Supported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) } + } + #[inline] + pub fn set_isYCrCb420Supported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isYCrCb420Supported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isYCrCb420Supported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isYCrCb422Supported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) } + } + #[inline] + pub fn set_isYCrCb422Supported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(9usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isYCrCb422Supported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 9usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isYCrCb422Supported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 9usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isYCrCb444Supported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) } + } + #[inline] + pub fn set_isYCrCb444Supported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(10usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isYCrCb444Supported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 10usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isYCrCb444Supported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 10usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isRgb444SupportedOnCurrentMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) } + } + #[inline] + pub fn set_isRgb444SupportedOnCurrentMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isRgb444SupportedOnCurrentMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 11usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isRgb444SupportedOnCurrentMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 11usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isYCbCr444SupportedOnCurrentMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) } + } + #[inline] + pub fn set_isYCbCr444SupportedOnCurrentMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isYCbCr444SupportedOnCurrentMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 12usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isYCbCr444SupportedOnCurrentMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 12usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isYCbCr422SupportedOnCurrentMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) } + } + #[inline] + pub fn set_isYCbCr422SupportedOnCurrentMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isYCbCr422SupportedOnCurrentMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 13usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isYCbCr422SupportedOnCurrentMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 13usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isYCbCr420SupportedOnCurrentMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u32) } + } + #[inline] + pub fn set_isYCbCr420SupportedOnCurrentMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(14usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isYCbCr420SupportedOnCurrentMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 14usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isYCbCr420SupportedOnCurrentMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 14usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn is6BPCSupportedOnCurrentMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) } + } + #[inline] + pub fn set_is6BPCSupportedOnCurrentMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn is6BPCSupportedOnCurrentMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 15usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_is6BPCSupportedOnCurrentMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 15usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn is8BPCSupportedOnCurrentMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u32) } + } + #[inline] + pub fn set_is8BPCSupportedOnCurrentMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn is8BPCSupportedOnCurrentMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 16usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_is8BPCSupportedOnCurrentMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 16usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn is10BPCSupportedOnCurrentMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u32) } + } + #[inline] + pub fn set_is10BPCSupportedOnCurrentMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn is10BPCSupportedOnCurrentMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 17usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_is10BPCSupportedOnCurrentMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 17usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn is12BPCSupportedOnCurrentMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u32) } + } + #[inline] + pub fn set_is12BPCSupportedOnCurrentMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(18usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn is12BPCSupportedOnCurrentMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 18usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_is12BPCSupportedOnCurrentMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 18usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn is16BPCSupportedOnCurrentMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u32) } + } + #[inline] + pub fn set_is16BPCSupportedOnCurrentMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn is16BPCSupportedOnCurrentMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 19usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_is16BPCSupportedOnCurrentMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 19usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonxvYCC601Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonxvYCC601Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(20usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonxvYCC601Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 20usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonxvYCC601Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 20usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonxvYCC709Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonxvYCC709Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonxvYCC709Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 21usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonxvYCC709Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 21usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonsYCC601Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonsYCC601Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(22usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonsYCC601Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 22usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonsYCC601Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 22usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonAdobeYCC601Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonAdobeYCC601Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(23usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonAdobeYCC601Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 23usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonAdobeYCC601Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 23usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonAdobeRGBCapable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonAdobeRGBCapable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonAdobeRGBCapable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 24usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonAdobeRGBCapable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 24usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonBT2020RGBCapable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonBT2020RGBCapable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(25usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonBT2020RGBCapable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 25usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonBT2020RGBCapable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 25usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonBT2020YCCCapable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonBT2020YCCCapable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(26usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonBT2020YCCCapable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 26usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonBT2020YCCCapable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 26usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonBT2020cYCCCapable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonBT2020cYCCCapable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(27usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonBT2020cYCCCapable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 27usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonBT2020cYCCCapable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 27usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(28usize, 4u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(28usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 28usize, + 4u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 28usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isDp: NvU32, + isInternalDp: NvU32, + isColorCtrlSupported: NvU32, + is6BPCSupported: NvU32, + is8BPCSupported: NvU32, + is10BPCSupported: NvU32, + is12BPCSupported: NvU32, + is16BPCSupported: NvU32, + isYCrCb420Supported: NvU32, + isYCrCb422Supported: NvU32, + isYCrCb444Supported: NvU32, + isRgb444SupportedOnCurrentMode: NvU32, + isYCbCr444SupportedOnCurrentMode: NvU32, + isYCbCr422SupportedOnCurrentMode: NvU32, + isYCbCr420SupportedOnCurrentMode: NvU32, + is6BPCSupportedOnCurrentMode: NvU32, + is8BPCSupportedOnCurrentMode: NvU32, + is10BPCSupportedOnCurrentMode: NvU32, + is12BPCSupportedOnCurrentMode: NvU32, + is16BPCSupportedOnCurrentMode: NvU32, + isMonxvYCC601Capable: NvU32, + isMonxvYCC709Capable: NvU32, + isMonsYCC601Capable: NvU32, + isMonAdobeYCC601Capable: NvU32, + isMonAdobeRGBCapable: NvU32, + isMonBT2020RGBCapable: NvU32, + isMonBT2020YCCCapable: NvU32, + isMonBT2020cYCCCapable: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isDp: u32 = unsafe { ::std::mem::transmute(isDp) }; + isDp as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let isInternalDp: u32 = unsafe { ::std::mem::transmute(isInternalDp) }; + isInternalDp as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let isColorCtrlSupported: u32 = unsafe { ::std::mem::transmute(isColorCtrlSupported) }; + isColorCtrlSupported as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let is6BPCSupported: u32 = unsafe { ::std::mem::transmute(is6BPCSupported) }; + is6BPCSupported as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let is8BPCSupported: u32 = unsafe { ::std::mem::transmute(is8BPCSupported) }; + is8BPCSupported as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let is10BPCSupported: u32 = unsafe { ::std::mem::transmute(is10BPCSupported) }; + is10BPCSupported as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let is12BPCSupported: u32 = unsafe { ::std::mem::transmute(is12BPCSupported) }; + is12BPCSupported as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let is16BPCSupported: u32 = unsafe { ::std::mem::transmute(is16BPCSupported) }; + is16BPCSupported as u64 + }); + __bindgen_bitfield_unit.set(8usize, 1u8, { + let isYCrCb420Supported: u32 = unsafe { ::std::mem::transmute(isYCrCb420Supported) }; + isYCrCb420Supported as u64 + }); + __bindgen_bitfield_unit.set(9usize, 1u8, { + let isYCrCb422Supported: u32 = unsafe { ::std::mem::transmute(isYCrCb422Supported) }; + isYCrCb422Supported as u64 + }); + __bindgen_bitfield_unit.set(10usize, 1u8, { + let isYCrCb444Supported: u32 = unsafe { ::std::mem::transmute(isYCrCb444Supported) }; + isYCrCb444Supported as u64 + }); + __bindgen_bitfield_unit.set(11usize, 1u8, { + let isRgb444SupportedOnCurrentMode: u32 = + unsafe { ::std::mem::transmute(isRgb444SupportedOnCurrentMode) }; + isRgb444SupportedOnCurrentMode as u64 + }); + __bindgen_bitfield_unit.set(12usize, 1u8, { + let isYCbCr444SupportedOnCurrentMode: u32 = + unsafe { ::std::mem::transmute(isYCbCr444SupportedOnCurrentMode) }; + isYCbCr444SupportedOnCurrentMode as u64 + }); + __bindgen_bitfield_unit.set(13usize, 1u8, { + let isYCbCr422SupportedOnCurrentMode: u32 = + unsafe { ::std::mem::transmute(isYCbCr422SupportedOnCurrentMode) }; + isYCbCr422SupportedOnCurrentMode as u64 + }); + __bindgen_bitfield_unit.set(14usize, 1u8, { + let isYCbCr420SupportedOnCurrentMode: u32 = + unsafe { ::std::mem::transmute(isYCbCr420SupportedOnCurrentMode) }; + isYCbCr420SupportedOnCurrentMode as u64 + }); + __bindgen_bitfield_unit.set(15usize, 1u8, { + let is6BPCSupportedOnCurrentMode: u32 = + unsafe { ::std::mem::transmute(is6BPCSupportedOnCurrentMode) }; + is6BPCSupportedOnCurrentMode as u64 + }); + __bindgen_bitfield_unit.set(16usize, 1u8, { + let is8BPCSupportedOnCurrentMode: u32 = + unsafe { ::std::mem::transmute(is8BPCSupportedOnCurrentMode) }; + is8BPCSupportedOnCurrentMode as u64 + }); + __bindgen_bitfield_unit.set(17usize, 1u8, { + let is10BPCSupportedOnCurrentMode: u32 = + unsafe { ::std::mem::transmute(is10BPCSupportedOnCurrentMode) }; + is10BPCSupportedOnCurrentMode as u64 + }); + __bindgen_bitfield_unit.set(18usize, 1u8, { + let is12BPCSupportedOnCurrentMode: u32 = + unsafe { ::std::mem::transmute(is12BPCSupportedOnCurrentMode) }; + is12BPCSupportedOnCurrentMode as u64 + }); + __bindgen_bitfield_unit.set(19usize, 1u8, { + let is16BPCSupportedOnCurrentMode: u32 = + unsafe { ::std::mem::transmute(is16BPCSupportedOnCurrentMode) }; + is16BPCSupportedOnCurrentMode as u64 + }); + __bindgen_bitfield_unit.set(20usize, 1u8, { + let isMonxvYCC601Capable: u32 = unsafe { ::std::mem::transmute(isMonxvYCC601Capable) }; + isMonxvYCC601Capable as u64 + }); + __bindgen_bitfield_unit.set(21usize, 1u8, { + let isMonxvYCC709Capable: u32 = unsafe { ::std::mem::transmute(isMonxvYCC709Capable) }; + isMonxvYCC709Capable as u64 + }); + __bindgen_bitfield_unit.set(22usize, 1u8, { + let isMonsYCC601Capable: u32 = unsafe { ::std::mem::transmute(isMonsYCC601Capable) }; + isMonsYCC601Capable as u64 + }); + __bindgen_bitfield_unit.set(23usize, 1u8, { + let isMonAdobeYCC601Capable: u32 = + unsafe { ::std::mem::transmute(isMonAdobeYCC601Capable) }; + isMonAdobeYCC601Capable as u64 + }); + __bindgen_bitfield_unit.set(24usize, 1u8, { + let isMonAdobeRGBCapable: u32 = unsafe { ::std::mem::transmute(isMonAdobeRGBCapable) }; + isMonAdobeRGBCapable as u64 + }); + __bindgen_bitfield_unit.set(25usize, 1u8, { + let isMonBT2020RGBCapable: u32 = + unsafe { ::std::mem::transmute(isMonBT2020RGBCapable) }; + isMonBT2020RGBCapable as u64 + }); + __bindgen_bitfield_unit.set(26usize, 1u8, { + let isMonBT2020YCCCapable: u32 = + unsafe { ::std::mem::transmute(isMonBT2020YCCCapable) }; + isMonBT2020YCCCapable as u64 + }); + __bindgen_bitfield_unit.set(27usize, 1u8, { + let isMonBT2020cYCCCapable: u32 = + unsafe { ::std::mem::transmute(isMonBT2020cYCCCapable) }; + isMonBT2020cYCCCapable as u64 + }); + __bindgen_bitfield_unit.set(28usize, 4u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_GetDisplayPortInfo()."] +pub type NV_DISPLAY_PORT_INFO_V1 = _NV_DISPLAY_PORT_INFO_V1; +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_GetDisplayPortInfo()."] +pub type NV_DISPLAY_PORT_INFO = NV_DISPLAY_PORT_INFO_V1; +#[doc = "! \\ingroup dispcontrol\n! DisplayPort configuration settings - used in NvAPI_SetDisplayPort()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_DISPLAY_PORT_CONFIG { + #[doc = "!< Structure version - 2 is the latest"] + pub version: NvU32, + #[doc = "!< Link rate"] + pub linkRate: NV_DP_LINK_RATE, + #[doc = "!< Lane count"] + pub laneCount: NV_DP_LANE_COUNT, + #[doc = "!< Color format to set"] + pub colorFormat: NV_DP_COLOR_FORMAT, + #[doc = "!< Dynamic range"] + pub dynamicRange: NV_DP_DYNAMIC_RANGE, + #[doc = "!< Ignored in RGB space"] + pub colorimetry: NV_DP_COLORIMETRY, + #[doc = "!< Bit-per-component"] + pub bpc: NV_DP_BPC, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub __bindgen_padding_0: [u8; 3usize], +} +impl NV_DISPLAY_PORT_CONFIG { + #[inline] + pub fn isHPD(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isHPD(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isHPD_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isHPD_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isSetDeferred(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_isSetDeferred(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isSetDeferred_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isSetDeferred_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isChromaLpfOff(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_isChromaLpfOff(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isChromaLpfOff_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isChromaLpfOff_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isDitherOff(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_isDitherOff(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isDitherOff_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isDitherOff_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn testLinkTrain(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_testLinkTrain(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn testLinkTrain_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_testLinkTrain_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn testColorChange(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_testColorChange(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn testColorChange_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_testColorChange_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isHPD: NvU32, + isSetDeferred: NvU32, + isChromaLpfOff: NvU32, + isDitherOff: NvU32, + testLinkTrain: NvU32, + testColorChange: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isHPD: u32 = unsafe { ::std::mem::transmute(isHPD) }; + isHPD as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let isSetDeferred: u32 = unsafe { ::std::mem::transmute(isSetDeferred) }; + isSetDeferred as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let isChromaLpfOff: u32 = unsafe { ::std::mem::transmute(isChromaLpfOff) }; + isChromaLpfOff as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let isDitherOff: u32 = unsafe { ::std::mem::transmute(isDitherOff) }; + isDitherOff as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let testLinkTrain: u32 = unsafe { ::std::mem::transmute(testLinkTrain) }; + testLinkTrain as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let testColorChange: u32 = unsafe { ::std::mem::transmute(testColorChange) }; + testColorChange as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_GetHDMISupportInfo()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDMI_SUPPORT_INFO_V1 { + #[doc = "!< Structure version"] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Revision number of the EDID 861 extension"] + pub EDID861ExtRev: NvU32, +} +impl _NV_HDMI_SUPPORT_INFO_V1 { + #[inline] + pub fn isGpuHDMICapable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isGpuHDMICapable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isGpuHDMICapable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isGpuHDMICapable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonUnderscanCapable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonUnderscanCapable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonUnderscanCapable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonUnderscanCapable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonBasicAudioCapable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonBasicAudioCapable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonBasicAudioCapable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonBasicAudioCapable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonYCbCr444Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonYCbCr444Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonYCbCr444Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonYCbCr444Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonYCbCr422Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonYCbCr422Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonYCbCr422Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonYCbCr422Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonxvYCC601Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonxvYCC601Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonxvYCC601Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonxvYCC601Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonxvYCC709Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonxvYCC709Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonxvYCC709Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonxvYCC709Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonHDMI(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonHDMI(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonHDMI_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonHDMI_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 24u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 24u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 24u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 24u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isGpuHDMICapable: NvU32, + isMonUnderscanCapable: NvU32, + isMonBasicAudioCapable: NvU32, + isMonYCbCr444Capable: NvU32, + isMonYCbCr422Capable: NvU32, + isMonxvYCC601Capable: NvU32, + isMonxvYCC709Capable: NvU32, + isMonHDMI: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isGpuHDMICapable: u32 = unsafe { ::std::mem::transmute(isGpuHDMICapable) }; + isGpuHDMICapable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let isMonUnderscanCapable: u32 = + unsafe { ::std::mem::transmute(isMonUnderscanCapable) }; + isMonUnderscanCapable as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let isMonBasicAudioCapable: u32 = + unsafe { ::std::mem::transmute(isMonBasicAudioCapable) }; + isMonBasicAudioCapable as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let isMonYCbCr444Capable: u32 = unsafe { ::std::mem::transmute(isMonYCbCr444Capable) }; + isMonYCbCr444Capable as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let isMonYCbCr422Capable: u32 = unsafe { ::std::mem::transmute(isMonYCbCr422Capable) }; + isMonYCbCr422Capable as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let isMonxvYCC601Capable: u32 = unsafe { ::std::mem::transmute(isMonxvYCC601Capable) }; + isMonxvYCC601Capable as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let isMonxvYCC709Capable: u32 = unsafe { ::std::mem::transmute(isMonxvYCC709Capable) }; + isMonxvYCC709Capable as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let isMonHDMI: u32 = unsafe { ::std::mem::transmute(isMonHDMI) }; + isMonHDMI as u64 + }); + __bindgen_bitfield_unit.set(8usize, 24u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_GetHDMISupportInfo()."] +pub type NV_HDMI_SUPPORT_INFO_V1 = _NV_HDMI_SUPPORT_INFO_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDMI_SUPPORT_INFO_V2 { + #[doc = "!< Structure version"] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Revision number of the EDID 861 extension"] + pub EDID861ExtRev: NvU32, +} +impl _NV_HDMI_SUPPORT_INFO_V2 { + #[inline] + pub fn isGpuHDMICapable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isGpuHDMICapable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isGpuHDMICapable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isGpuHDMICapable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonUnderscanCapable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonUnderscanCapable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonUnderscanCapable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonUnderscanCapable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonBasicAudioCapable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonBasicAudioCapable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonBasicAudioCapable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonBasicAudioCapable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonYCbCr444Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonYCbCr444Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonYCbCr444Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonYCbCr444Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonYCbCr422Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonYCbCr422Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonYCbCr422Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonYCbCr422Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonxvYCC601Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonxvYCC601Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonxvYCC601Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonxvYCC601Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonxvYCC709Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonxvYCC709Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonxvYCC709Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonxvYCC709Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonHDMI(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonHDMI(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonHDMI_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonHDMI_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonsYCC601Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonsYCC601Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonsYCC601Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonsYCC601Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonAdobeYCC601Capable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonAdobeYCC601Capable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(9usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonAdobeYCC601Capable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 9usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonAdobeYCC601Capable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 9usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isMonAdobeRGBCapable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMonAdobeRGBCapable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(10usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMonAdobeRGBCapable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 10usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMonAdobeRGBCapable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 10usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 21u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 21u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 11usize, + 21u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 11usize, + 21u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isGpuHDMICapable: NvU32, + isMonUnderscanCapable: NvU32, + isMonBasicAudioCapable: NvU32, + isMonYCbCr444Capable: NvU32, + isMonYCbCr422Capable: NvU32, + isMonxvYCC601Capable: NvU32, + isMonxvYCC709Capable: NvU32, + isMonHDMI: NvU32, + isMonsYCC601Capable: NvU32, + isMonAdobeYCC601Capable: NvU32, + isMonAdobeRGBCapable: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isGpuHDMICapable: u32 = unsafe { ::std::mem::transmute(isGpuHDMICapable) }; + isGpuHDMICapable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let isMonUnderscanCapable: u32 = + unsafe { ::std::mem::transmute(isMonUnderscanCapable) }; + isMonUnderscanCapable as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let isMonBasicAudioCapable: u32 = + unsafe { ::std::mem::transmute(isMonBasicAudioCapable) }; + isMonBasicAudioCapable as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let isMonYCbCr444Capable: u32 = unsafe { ::std::mem::transmute(isMonYCbCr444Capable) }; + isMonYCbCr444Capable as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let isMonYCbCr422Capable: u32 = unsafe { ::std::mem::transmute(isMonYCbCr422Capable) }; + isMonYCbCr422Capable as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let isMonxvYCC601Capable: u32 = unsafe { ::std::mem::transmute(isMonxvYCC601Capable) }; + isMonxvYCC601Capable as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let isMonxvYCC709Capable: u32 = unsafe { ::std::mem::transmute(isMonxvYCC709Capable) }; + isMonxvYCC709Capable as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let isMonHDMI: u32 = unsafe { ::std::mem::transmute(isMonHDMI) }; + isMonHDMI as u64 + }); + __bindgen_bitfield_unit.set(8usize, 1u8, { + let isMonsYCC601Capable: u32 = unsafe { ::std::mem::transmute(isMonsYCC601Capable) }; + isMonsYCC601Capable as u64 + }); + __bindgen_bitfield_unit.set(9usize, 1u8, { + let isMonAdobeYCC601Capable: u32 = + unsafe { ::std::mem::transmute(isMonAdobeYCC601Capable) }; + isMonAdobeYCC601Capable as u64 + }); + __bindgen_bitfield_unit.set(10usize, 1u8, { + let isMonAdobeRGBCapable: u32 = unsafe { ::std::mem::transmute(isMonAdobeRGBCapable) }; + isMonAdobeRGBCapable as u64 + }); + __bindgen_bitfield_unit.set(11usize, 21u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_HDMI_SUPPORT_INFO_V2 = _NV_HDMI_SUPPORT_INFO_V2; +pub type NV_HDMI_SUPPORT_INFO = NV_HDMI_SUPPORT_INFO_V2; +#[doc = "!< Returns the fields in the infoframe with values set by the manufacturer - NVIDIA/OEM."] +pub const NV_INFOFRAME_CMD_NV_INFOFRAME_CMD_GET_DEFAULT: NV_INFOFRAME_CMD = 0; +#[doc = "!< Sets the fields in the infoframe to auto, and infoframe to the default infoframe for use in a set."] +pub const NV_INFOFRAME_CMD_NV_INFOFRAME_CMD_RESET: NV_INFOFRAME_CMD = 1; +#[doc = "!< Get the current infoframe state."] +pub const NV_INFOFRAME_CMD_NV_INFOFRAME_CMD_GET: NV_INFOFRAME_CMD = 2; +#[doc = "!< Set the current infoframe state (flushed to the monitor), the values are one time and do not persist."] +pub const NV_INFOFRAME_CMD_NV_INFOFRAME_CMD_SET: NV_INFOFRAME_CMD = 3; +#[doc = "!< Get the override infoframe state, non-override fields will be set to value = AUTO, overridden fields will have the current override values."] +pub const NV_INFOFRAME_CMD_NV_INFOFRAME_CMD_GET_OVERRIDE: NV_INFOFRAME_CMD = 4; +#[doc = "!< Set the override infoframe state, non-override fields will be set to value = AUTO, other values indicate override; persist across modeset/reboot"] +pub const NV_INFOFRAME_CMD_NV_INFOFRAME_CMD_SET_OVERRIDE: NV_INFOFRAME_CMD = 5; +#[doc = "!< get properties associated with infoframe (each of the infoframe type will have properties)"] +pub const NV_INFOFRAME_CMD_NV_INFOFRAME_CMD_GET_PROPERTY: NV_INFOFRAME_CMD = 6; +#[doc = "!< set properties associated with infoframe"] +pub const NV_INFOFRAME_CMD_NV_INFOFRAME_CMD_SET_PROPERTY: NV_INFOFRAME_CMD = 7; +#[doc = "! \\ingroup dispcontrol"] +pub type NV_INFOFRAME_CMD = ::std::os::raw::c_int; +#[doc = "!< Driver determines whether to send infoframes."] +pub const NV_INFOFRAME_PROPERTY_MODE_NV_INFOFRAME_PROPERTY_MODE_AUTO: NV_INFOFRAME_PROPERTY_MODE = + 0; +#[doc = "!< Driver always sends infoframe."] +pub const NV_INFOFRAME_PROPERTY_MODE_NV_INFOFRAME_PROPERTY_MODE_ENABLE: NV_INFOFRAME_PROPERTY_MODE = + 1; +#[doc = "!< Driver never sends infoframe."] +pub const NV_INFOFRAME_PROPERTY_MODE_NV_INFOFRAME_PROPERTY_MODE_DISABLE: + NV_INFOFRAME_PROPERTY_MODE = 2; +#[doc = "!< Driver only sends infoframe when client requests it via infoframe escape call."] +pub const NV_INFOFRAME_PROPERTY_MODE_NV_INFOFRAME_PROPERTY_MODE_ALLOW_OVERRIDE: + NV_INFOFRAME_PROPERTY_MODE = 3; +pub type NV_INFOFRAME_PROPERTY_MODE = ::std::os::raw::c_int; +pub const NV_INFOFRAME_PROPERTY_BLACKLIST_NV_INFOFRAME_PROPERTY_BLACKLIST_FALSE: + NV_INFOFRAME_PROPERTY_BLACKLIST = 0; +pub const NV_INFOFRAME_PROPERTY_BLACKLIST_NV_INFOFRAME_PROPERTY_BLACKLIST_TRUE: + NV_INFOFRAME_PROPERTY_BLACKLIST = 1; +#[doc = "! Returns whether the current monitor is in blacklist or force this monitor to be in blacklist."] +pub type NV_INFOFRAME_PROPERTY_BLACKLIST = ::std::os::raw::c_int; +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct NV_INFOFRAME_PROPERTY { + pub _bitfield_align_1: [u16; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl NV_INFOFRAME_PROPERTY { + #[inline] + pub fn mode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) } + } + #[inline] + pub fn set_mode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn mode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 4u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_mode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn blackList(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u32) } + } + #[inline] + pub fn set_blackList(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn blackList_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_blackList_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 10u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 10u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 10u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 10u8, + val as u64, + ) + } + } + #[inline] + pub fn version(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u32) } + } + #[inline] + pub fn set_version(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn version_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 16usize, + 8u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_version_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 16usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn length(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + } + #[inline] + pub fn set_length(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn length_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 24usize, + 8u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_length_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 24usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + mode: NvU32, + blackList: NvU32, + reserved: NvU32, + version: NvU32, + length: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let mode: u32 = unsafe { ::std::mem::transmute(mode) }; + mode as u64 + }); + __bindgen_bitfield_unit.set(4usize, 2u8, { + let blackList: u32 = unsafe { ::std::mem::transmute(blackList) }; + blackList as u64 + }); + __bindgen_bitfield_unit.set(6usize, 10u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit.set(16usize, 8u8, { + let version: u32 = unsafe { ::std::mem::transmute(version) }; + version as u64 + }); + __bindgen_bitfield_unit.set(24usize, 8u8, { + let length: u32 = unsafe { ::std::mem::transmute(length) }; + length as u64 + }); + __bindgen_bitfield_unit + } +} +pub const NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NODATA: + NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO = 0; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_OVERSCAN: + NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO = 1; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_UNDERSCAN: + NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO = 2; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_FUTURE: + NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO = 3; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_AUTO: + NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO = 7; +#[doc = "! Byte1 related"] +pub type NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NOT_PRESENT: + NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA = 0; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_VERTICAL_PRESENT : NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_HORIZONTAL_PRESENT : NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_BOTH_PRESENT: + NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA = 3; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_AUTO: + NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA = 7; +pub type NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO_NV_INFOFRAME_FIELD_VALUE_AVI_AFI_ABSENT: + NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO = 0; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO_NV_INFOFRAME_FIELD_VALUE_AVI_AFI_PRESENT: + NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO = 1; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO_NV_INFOFRAME_FIELD_VALUE_AVI_AFI_AUTO: + NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO = 3; +pub type NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_RGB: + NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT = 0; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr422 : NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr444 : NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_FUTURE : NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_AUTO: + NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT = 7; +pub type NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_F17_NV_INFOFRAME_FIELD_VALUE_AVI_F17_FALSE: + NV_INFOFRAME_FIELD_VALUE_AVI_F17 = 0; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_F17_NV_INFOFRAME_FIELD_VALUE_AVI_F17_TRUE: + NV_INFOFRAME_FIELD_VALUE_AVI_F17 = 1; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_F17_NV_INFOFRAME_FIELD_VALUE_AVI_F17_AUTO: + NV_INFOFRAME_FIELD_VALUE_AVI_F17 = 3; +pub type NV_INFOFRAME_FIELD_VALUE_AVI_F17 = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NO_AFD : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE01 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE02 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE03 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_LETTERBOX_GT16x9 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 4 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE05 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 5 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE06 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 6 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE07 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 7 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_EQUAL_CODEDFRAME : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 8 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_4x3 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 9 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_16x9 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 10 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_14x9 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 11 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE12 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 12 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_4x3_ON_14x9 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 13 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_14x9 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 14 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_4x3 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 15 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_AUTO : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = 31 ; +#[doc = "! Byte2 related"] +pub type NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NO_DATA : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_4x3 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_16x9 : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_FUTURE : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_AUTO : NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME = 7 ; +pub type NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NO_DATA : NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_SMPTE_170M : NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_ITUR_BT709 : NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_USE_EXTENDED_COLORIMETRY : NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_AUTO: + NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY = 7; +pub type NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NO_DATA : NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_HORIZONTAL : NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_VERTICAL : NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_BOTH : NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_AUTO : NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING = 7 ; +#[doc = "! Byte 3 related"] +pub type NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_DEFAULT : NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_LIMITED_RANGE : NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_FULL_RANGE : NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_RESERVED : NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_AUTO : NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION = 7 ; +pub type NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC601 : NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC709 : NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_SYCC601 : NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBEYCC601 : NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBERGB : NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY = 4 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED05 : NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY = 5 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED06 : NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY = 6 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED07 : NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY = 7 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_AUTO : NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY = 15 ; +pub type NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ITC_NV_INFOFRAME_FIELD_VALUE_AVI_ITC_VIDEO_CONTENT: + NV_INFOFRAME_FIELD_VALUE_AVI_ITC = 0; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ITC_NV_INFOFRAME_FIELD_VALUE_AVI_ITC_ITCONTENT: + NV_INFOFRAME_FIELD_VALUE_AVI_ITC = 1; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_ITC_NV_INFOFRAME_FIELD_VALUE_AVI_ITC_AUTO: + NV_INFOFRAME_FIELD_VALUE_AVI_ITC = 3; +pub type NV_INFOFRAME_FIELD_VALUE_AVI_ITC = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NONE : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X02 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X03 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X04 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X05 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 4 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X06 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 5 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X07 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 6 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X08 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 7 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X09 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 8 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X10 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 9 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED10 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 10 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED11 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 11 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED12 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 12 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED13 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 13 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED14 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 14 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED15 : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 15 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_AUTO : NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = 31 ; +#[doc = "! Byte 4 related"] +pub type NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GRAPHICS : NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_PHOTO : NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_CINEMA : NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GAME: + NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE = 3; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_AUTO: + NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE = 7; +pub type NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_LIMITED_RANGE : NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_FULL_RANGE : NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED02 : NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED03 : NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_AUTO : NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION = 7 ; +pub type NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION = ::std::os::raw::c_int; +#[doc = "! Adding an Auto bit to each field"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_INFOFRAME_VIDEO { + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 23usize]>, +} +impl NV_INFOFRAME_VIDEO { + #[inline] + pub fn vic(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_vic(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn vic_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 8u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_vic_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn pixelRepeat(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 5u8) as u32) } + } + #[inline] + pub fn set_pixelRepeat(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 5u8, val as u64) + } + } + #[inline] + pub unsafe fn pixelRepeat_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 5u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_pixelRepeat_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 5u8, + val as u64, + ) + } + } + #[inline] + pub fn colorSpace(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 3u8) as u32) } + } + #[inline] + pub fn set_colorSpace(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn colorSpace_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 13usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_colorSpace_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 13usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn colorimetry(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 3u8) as u32) } + } + #[inline] + pub fn set_colorimetry(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn colorimetry_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 16usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_colorimetry_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 16usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn extendedColorimetry(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 4u8) as u32) } + } + #[inline] + pub fn set_extendedColorimetry(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn extendedColorimetry_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 19usize, + 4u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_extendedColorimetry_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 19usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn rgbQuantizationRange(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 3u8) as u32) } + } + #[inline] + pub fn set_rgbQuantizationRange(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(23usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn rgbQuantizationRange_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 23usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_rgbQuantizationRange_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 23usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn yccQuantizationRange(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 3u8) as u32) } + } + #[inline] + pub fn set_yccQuantizationRange(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(26usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn yccQuantizationRange_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 26usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_yccQuantizationRange_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 26usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn itContent(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(29usize, 2u8) as u32) } + } + #[inline] + pub fn set_itContent(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(29usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn itContent_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 29usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_itContent_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 29usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn contentTypes(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 3u8) as u32) } + } + #[inline] + pub fn set_contentTypes(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(32usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn contentTypes_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 32usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_contentTypes_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 32usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn scanInfo(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(35usize, 3u8) as u32) } + } + #[inline] + pub fn set_scanInfo(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(35usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn scanInfo_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 35usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_scanInfo_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 35usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn activeFormatInfoPresent(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(38usize, 2u8) as u32) } + } + #[inline] + pub fn set_activeFormatInfoPresent(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(38usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn activeFormatInfoPresent_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 38usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_activeFormatInfoPresent_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 38usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn activeFormatAspectRatio(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 5u8) as u32) } + } + #[inline] + pub fn set_activeFormatAspectRatio(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(40usize, 5u8, val as u64) + } + } + #[inline] + pub unsafe fn activeFormatAspectRatio_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 40usize, + 5u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_activeFormatAspectRatio_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 40usize, + 5u8, + val as u64, + ) + } + } + #[inline] + pub fn picAspectRatio(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(45usize, 3u8) as u32) } + } + #[inline] + pub fn set_picAspectRatio(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(45usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn picAspectRatio_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 45usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_picAspectRatio_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 45usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn nonuniformScaling(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(48usize, 3u8) as u32) } + } + #[inline] + pub fn set_nonuniformScaling(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(48usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn nonuniformScaling_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 48usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_nonuniformScaling_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 48usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn barInfo(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(51usize, 3u8) as u32) } + } + #[inline] + pub fn set_barInfo(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(51usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn barInfo_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 51usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_barInfo_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 51usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn top_bar(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(64usize, 17u8) as u32) } + } + #[inline] + pub fn set_top_bar(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(64usize, 17u8, val as u64) + } + } + #[inline] + pub unsafe fn top_bar_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 64usize, + 17u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_top_bar_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 64usize, + 17u8, + val as u64, + ) + } + } + #[inline] + pub fn bottom_bar(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(96usize, 17u8) as u32) } + } + #[inline] + pub fn set_bottom_bar(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(96usize, 17u8, val as u64) + } + } + #[inline] + pub unsafe fn bottom_bar_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 96usize, + 17u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bottom_bar_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 96usize, + 17u8, + val as u64, + ) + } + } + #[inline] + pub fn left_bar(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(128usize, 17u8) as u32) } + } + #[inline] + pub fn set_left_bar(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(128usize, 17u8, val as u64) + } + } + #[inline] + pub unsafe fn left_bar_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 128usize, + 17u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_left_bar_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 128usize, + 17u8, + val as u64, + ) + } + } + #[inline] + pub fn right_bar(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(160usize, 17u8) as u32) } + } + #[inline] + pub fn set_right_bar(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(160usize, 17u8, val as u64) + } + } + #[inline] + pub unsafe fn right_bar_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 160usize, + 17u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_right_bar_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 160usize, + 17u8, + val as u64, + ) + } + } + #[inline] + pub fn Future17(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(177usize, 2u8) as u32) } + } + #[inline] + pub fn set_Future17(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(177usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn Future17_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 177usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_Future17_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 177usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn Future47(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(179usize, 2u8) as u32) } + } + #[inline] + pub fn set_Future47(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(179usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn Future47_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 23usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 179usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_Future47_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 23usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 179usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + vic: NvU32, + pixelRepeat: NvU32, + colorSpace: NvU32, + colorimetry: NvU32, + extendedColorimetry: NvU32, + rgbQuantizationRange: NvU32, + yccQuantizationRange: NvU32, + itContent: NvU32, + contentTypes: NvU32, + scanInfo: NvU32, + activeFormatInfoPresent: NvU32, + activeFormatAspectRatio: NvU32, + picAspectRatio: NvU32, + nonuniformScaling: NvU32, + barInfo: NvU32, + top_bar: NvU32, + bottom_bar: NvU32, + left_bar: NvU32, + right_bar: NvU32, + Future17: NvU32, + Future47: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 23usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 23usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let vic: u32 = unsafe { ::std::mem::transmute(vic) }; + vic as u64 + }); + __bindgen_bitfield_unit.set(8usize, 5u8, { + let pixelRepeat: u32 = unsafe { ::std::mem::transmute(pixelRepeat) }; + pixelRepeat as u64 + }); + __bindgen_bitfield_unit.set(13usize, 3u8, { + let colorSpace: u32 = unsafe { ::std::mem::transmute(colorSpace) }; + colorSpace as u64 + }); + __bindgen_bitfield_unit.set(16usize, 3u8, { + let colorimetry: u32 = unsafe { ::std::mem::transmute(colorimetry) }; + colorimetry as u64 + }); + __bindgen_bitfield_unit.set(19usize, 4u8, { + let extendedColorimetry: u32 = unsafe { ::std::mem::transmute(extendedColorimetry) }; + extendedColorimetry as u64 + }); + __bindgen_bitfield_unit.set(23usize, 3u8, { + let rgbQuantizationRange: u32 = unsafe { ::std::mem::transmute(rgbQuantizationRange) }; + rgbQuantizationRange as u64 + }); + __bindgen_bitfield_unit.set(26usize, 3u8, { + let yccQuantizationRange: u32 = unsafe { ::std::mem::transmute(yccQuantizationRange) }; + yccQuantizationRange as u64 + }); + __bindgen_bitfield_unit.set(29usize, 2u8, { + let itContent: u32 = unsafe { ::std::mem::transmute(itContent) }; + itContent as u64 + }); + __bindgen_bitfield_unit.set(32usize, 3u8, { + let contentTypes: u32 = unsafe { ::std::mem::transmute(contentTypes) }; + contentTypes as u64 + }); + __bindgen_bitfield_unit.set(35usize, 3u8, { + let scanInfo: u32 = unsafe { ::std::mem::transmute(scanInfo) }; + scanInfo as u64 + }); + __bindgen_bitfield_unit.set(38usize, 2u8, { + let activeFormatInfoPresent: u32 = + unsafe { ::std::mem::transmute(activeFormatInfoPresent) }; + activeFormatInfoPresent as u64 + }); + __bindgen_bitfield_unit.set(40usize, 5u8, { + let activeFormatAspectRatio: u32 = + unsafe { ::std::mem::transmute(activeFormatAspectRatio) }; + activeFormatAspectRatio as u64 + }); + __bindgen_bitfield_unit.set(45usize, 3u8, { + let picAspectRatio: u32 = unsafe { ::std::mem::transmute(picAspectRatio) }; + picAspectRatio as u64 + }); + __bindgen_bitfield_unit.set(48usize, 3u8, { + let nonuniformScaling: u32 = unsafe { ::std::mem::transmute(nonuniformScaling) }; + nonuniformScaling as u64 + }); + __bindgen_bitfield_unit.set(51usize, 3u8, { + let barInfo: u32 = unsafe { ::std::mem::transmute(barInfo) }; + barInfo as u64 + }); + __bindgen_bitfield_unit.set(64usize, 17u8, { + let top_bar: u32 = unsafe { ::std::mem::transmute(top_bar) }; + top_bar as u64 + }); + __bindgen_bitfield_unit.set(96usize, 17u8, { + let bottom_bar: u32 = unsafe { ::std::mem::transmute(bottom_bar) }; + bottom_bar as u64 + }); + __bindgen_bitfield_unit.set(128usize, 17u8, { + let left_bar: u32 = unsafe { ::std::mem::transmute(left_bar) }; + left_bar as u64 + }); + __bindgen_bitfield_unit.set(160usize, 17u8, { + let right_bar: u32 = unsafe { ::std::mem::transmute(right_bar) }; + right_bar as u64 + }); + __bindgen_bitfield_unit.set(177usize, 2u8, { + let Future17: u32 = unsafe { ::std::mem::transmute(Future17) }; + Future17 as u64 + }); + __bindgen_bitfield_unit.set(179usize, 2u8, { + let Future47: u32 = unsafe { ::std::mem::transmute(Future47) }; + Future47 as u64 + }); + __bindgen_bitfield_unit + } +} +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_IN_HEADER : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_2 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_3 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_4 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_5 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT = 4 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_6 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT = 5 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_7 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT = 6 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_8 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT = 7 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_AUTO : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT = 15 ; +#[doc = "! Byte 1 related"] +pub type NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_IN_HEADER : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_PCM : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AC3 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG1 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MP3 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 4 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG2 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 5 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AACLC : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 6 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTS : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 7 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_ATRAC : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 8 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DSD : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 9 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_EAC3 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 10 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTSHD : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 11 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MLP : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 12 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DST : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 13 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_WMAPRO : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 14 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_USE_CODING_EXTENSION_TYPE : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 15 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AUTO : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = 31 ; +pub type NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_IN_HEADER : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_16BITS : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_20BITS : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_24BITS : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_AUTO : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE = 7 ; +#[doc = "! Byte 2 related"] +pub type NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_IN_HEADER : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_32000HZ : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_44100HZ : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_48000HZ : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_88200KHZ : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY = 4 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_96000KHZ : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY = 5 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_176400KHZ : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY = 6 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_192000KHZ : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY = 7 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_AUTO : NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY = 15 ; +pub type NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_USE_CODING_TYPE : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAAC : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAACV2 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_MPEGSURROUND : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE04 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 4 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE05 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 5 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE06 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 6 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE07 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 7 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE08 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 8 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE09 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 9 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE10 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 10 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE11 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 11 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE12 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 12 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE13 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 13 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE14 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 14 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE15 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 15 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE16 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 16 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE17 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 17 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE18 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 18 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE19 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 19 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE20 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 20 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE21 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 21 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE22 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 22 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE23 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 23 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE24 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 24 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE25 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 25 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE26 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 26 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE27 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 27 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE28 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 28 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE29 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 29 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE30 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 30 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE31 : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 31 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_AUTO : NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = 63 ; +#[doc = "! Byte 3 related"] +pub type NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 4 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 5 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 6 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 7 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 8 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 9 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 10 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 11 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 12 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 13 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 14 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 15 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 16 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 17 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 18 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 19 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 20 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 21 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 22 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 23 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 24 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 25 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 26 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 27 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 28 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 29 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 30 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 31 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 32 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 33 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 34 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 35 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 36 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 37 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 38 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 39 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 40 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 41 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 42 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 43 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 44 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 45 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 46 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 47 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_X_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 48 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_LFE_FR_FL : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 49 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_AUTO : NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = 511 ; +#[doc = "! Byte 4 related"] +pub type NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NO_DATA : NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_0DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_PLUS10DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_RESERVED03 : NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_AUTO : NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL = 7 ; +#[doc = "! Byte 5 related"] +pub type NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_0DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_1DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_2DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 2 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_3DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 3 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_4DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 4 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_5DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 5 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_6DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 6 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_7DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 7 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_8DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 8 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_9DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 9 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_10DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 10 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_11DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 11 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_12DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 12 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_13DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 13 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_14DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 14 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_15DB : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 15 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_AUTO : NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = 31 ; +pub type NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES = ::std::os::raw::c_int; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PERMITTED : NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX = 0 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PROHIBITED : NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX = 1 ; +pub const NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_AUTO: + NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX = 3; +pub type NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX = ::std::os::raw::c_int; +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct NV_INFOFRAME_AUDIO { + pub _bitfield_align_1: [u16; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 14usize]>, + pub __bindgen_padding_0: u16, +} +impl NV_INFOFRAME_AUDIO { + #[inline] + pub fn codingType(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 5u8) as u32) } + } + #[inline] + pub fn set_codingType(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 5u8, val as u64) + } + } + #[inline] + pub unsafe fn codingType_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 5u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_codingType_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 5u8, + val as u64, + ) + } + } + #[inline] + pub fn codingExtensionType(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 6u8) as u32) } + } + #[inline] + pub fn set_codingExtensionType(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 6u8, val as u64) + } + } + #[inline] + pub unsafe fn codingExtensionType_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 6u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_codingExtensionType_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 6u8, + val as u64, + ) + } + } + #[inline] + pub fn sampleSize(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 3u8) as u32) } + } + #[inline] + pub fn set_sampleSize(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn sampleSize_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 11usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_sampleSize_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 11usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn sampleRate(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 4u8) as u32) } + } + #[inline] + pub fn set_sampleRate(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(14usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn sampleRate_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 14usize, + 4u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_sampleRate_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 14usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn channelCount(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 4u8) as u32) } + } + #[inline] + pub fn set_channelCount(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(18usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn channelCount_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 18usize, + 4u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_channelCount_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 18usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn speakerPlacement(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 9u8) as u32) } + } + #[inline] + pub fn set_speakerPlacement(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(22usize, 9u8, val as u64) + } + } + #[inline] + pub unsafe fn speakerPlacement_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 22usize, + 9u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_speakerPlacement_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 22usize, + 9u8, + val as u64, + ) + } + } + #[inline] + pub fn downmixInhibit(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 2u8) as u32) } + } + #[inline] + pub fn set_downmixInhibit(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(32usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn downmixInhibit_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 32usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_downmixInhibit_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 32usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn lfePlaybackLevel(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(34usize, 3u8) as u32) } + } + #[inline] + pub fn set_lfePlaybackLevel(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(34usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn lfePlaybackLevel_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 34usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_lfePlaybackLevel_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 34usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn levelShift(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(37usize, 5u8) as u32) } + } + #[inline] + pub fn set_levelShift(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(37usize, 5u8, val as u64) + } + } + #[inline] + pub unsafe fn levelShift_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 37usize, + 5u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_levelShift_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 37usize, + 5u8, + val as u64, + ) + } + } + #[inline] + pub fn Future12(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(42usize, 2u8) as u32) } + } + #[inline] + pub fn set_Future12(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(42usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn Future12_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 42usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_Future12_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 42usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn Future2x(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(44usize, 4u8) as u32) } + } + #[inline] + pub fn set_Future2x(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(44usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn Future2x_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 44usize, + 4u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_Future2x_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 44usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn Future3x(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(48usize, 4u8) as u32) } + } + #[inline] + pub fn set_Future3x(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(48usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn Future3x_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 48usize, + 4u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_Future3x_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 48usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn Future52(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(52usize, 2u8) as u32) } + } + #[inline] + pub fn set_Future52(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(52usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn Future52_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 52usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_Future52_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 52usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn Future6(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(54usize, 9u8) as u32) } + } + #[inline] + pub fn set_Future6(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(54usize, 9u8, val as u64) + } + } + #[inline] + pub unsafe fn Future6_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 54usize, + 9u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_Future6_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 54usize, + 9u8, + val as u64, + ) + } + } + #[inline] + pub fn Future7(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(64usize, 9u8) as u32) } + } + #[inline] + pub fn set_Future7(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(64usize, 9u8, val as u64) + } + } + #[inline] + pub unsafe fn Future7_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 64usize, + 9u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_Future7_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 64usize, + 9u8, + val as u64, + ) + } + } + #[inline] + pub fn Future8(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(73usize, 9u8) as u32) } + } + #[inline] + pub fn set_Future8(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(73usize, 9u8, val as u64) + } + } + #[inline] + pub unsafe fn Future8_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 73usize, + 9u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_Future8_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 73usize, + 9u8, + val as u64, + ) + } + } + #[inline] + pub fn Future9(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(82usize, 9u8) as u32) } + } + #[inline] + pub fn set_Future9(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(82usize, 9u8, val as u64) + } + } + #[inline] + pub unsafe fn Future9_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 82usize, + 9u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_Future9_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 82usize, + 9u8, + val as u64, + ) + } + } + #[inline] + pub fn Future10(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(96usize, 9u8) as u32) } + } + #[inline] + pub fn set_Future10(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(96usize, 9u8, val as u64) + } + } + #[inline] + pub unsafe fn Future10_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 14usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 96usize, + 9u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_Future10_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 14usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 96usize, + 9u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + codingType: NvU32, + codingExtensionType: NvU32, + sampleSize: NvU32, + sampleRate: NvU32, + channelCount: NvU32, + speakerPlacement: NvU32, + downmixInhibit: NvU32, + lfePlaybackLevel: NvU32, + levelShift: NvU32, + Future12: NvU32, + Future2x: NvU32, + Future3x: NvU32, + Future52: NvU32, + Future6: NvU32, + Future7: NvU32, + Future8: NvU32, + Future9: NvU32, + Future10: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 14usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 14usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 5u8, { + let codingType: u32 = unsafe { ::std::mem::transmute(codingType) }; + codingType as u64 + }); + __bindgen_bitfield_unit.set(5usize, 6u8, { + let codingExtensionType: u32 = unsafe { ::std::mem::transmute(codingExtensionType) }; + codingExtensionType as u64 + }); + __bindgen_bitfield_unit.set(11usize, 3u8, { + let sampleSize: u32 = unsafe { ::std::mem::transmute(sampleSize) }; + sampleSize as u64 + }); + __bindgen_bitfield_unit.set(14usize, 4u8, { + let sampleRate: u32 = unsafe { ::std::mem::transmute(sampleRate) }; + sampleRate as u64 + }); + __bindgen_bitfield_unit.set(18usize, 4u8, { + let channelCount: u32 = unsafe { ::std::mem::transmute(channelCount) }; + channelCount as u64 + }); + __bindgen_bitfield_unit.set(22usize, 9u8, { + let speakerPlacement: u32 = unsafe { ::std::mem::transmute(speakerPlacement) }; + speakerPlacement as u64 + }); + __bindgen_bitfield_unit.set(32usize, 2u8, { + let downmixInhibit: u32 = unsafe { ::std::mem::transmute(downmixInhibit) }; + downmixInhibit as u64 + }); + __bindgen_bitfield_unit.set(34usize, 3u8, { + let lfePlaybackLevel: u32 = unsafe { ::std::mem::transmute(lfePlaybackLevel) }; + lfePlaybackLevel as u64 + }); + __bindgen_bitfield_unit.set(37usize, 5u8, { + let levelShift: u32 = unsafe { ::std::mem::transmute(levelShift) }; + levelShift as u64 + }); + __bindgen_bitfield_unit.set(42usize, 2u8, { + let Future12: u32 = unsafe { ::std::mem::transmute(Future12) }; + Future12 as u64 + }); + __bindgen_bitfield_unit.set(44usize, 4u8, { + let Future2x: u32 = unsafe { ::std::mem::transmute(Future2x) }; + Future2x as u64 + }); + __bindgen_bitfield_unit.set(48usize, 4u8, { + let Future3x: u32 = unsafe { ::std::mem::transmute(Future3x) }; + Future3x as u64 + }); + __bindgen_bitfield_unit.set(52usize, 2u8, { + let Future52: u32 = unsafe { ::std::mem::transmute(Future52) }; + Future52 as u64 + }); + __bindgen_bitfield_unit.set(54usize, 9u8, { + let Future6: u32 = unsafe { ::std::mem::transmute(Future6) }; + Future6 as u64 + }); + __bindgen_bitfield_unit.set(64usize, 9u8, { + let Future7: u32 = unsafe { ::std::mem::transmute(Future7) }; + Future7 as u64 + }); + __bindgen_bitfield_unit.set(73usize, 9u8, { + let Future8: u32 = unsafe { ::std::mem::transmute(Future8) }; + Future8 as u64 + }); + __bindgen_bitfield_unit.set(82usize, 9u8, { + let Future9: u32 = unsafe { ::std::mem::transmute(Future9) }; + Future9 as u64 + }); + __bindgen_bitfield_unit.set(96usize, 9u8, { + let Future10: u32 = unsafe { ::std::mem::transmute(Future10) }; + Future10 as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct NV_INFOFRAME_DATA { + #[doc = "!< version of this structure"] + pub version: NvU32, + #[doc = "!< size of this structure"] + pub size: NvU16, + #[doc = "!< The actions to perform from NV_INFOFRAME_CMD"] + pub cmd: NvU8, + #[doc = "!< type of infoframe"] + pub type_: NvU8, + pub infoframe: NV_INFOFRAME_DATA__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union NV_INFOFRAME_DATA__bindgen_ty_1 { + #[doc = "!< This is NVIDIA-specific and corresponds to the property cmds and associated infoframe."] + pub property: NV_INFOFRAME_PROPERTY, + pub audio: NV_INFOFRAME_AUDIO, + pub video: NV_INFOFRAME_VIDEO, +} +pub const NV_COLOR_CMD_NV_COLOR_CMD_GET: NV_COLOR_CMD = 1; +pub const NV_COLOR_CMD_NV_COLOR_CMD_SET: NV_COLOR_CMD = 2; +pub const NV_COLOR_CMD_NV_COLOR_CMD_IS_SUPPORTED_COLOR: NV_COLOR_CMD = 3; +pub const NV_COLOR_CMD_NV_COLOR_CMD_GET_DEFAULT: NV_COLOR_CMD = 4; +pub type NV_COLOR_CMD = ::std::os::raw::c_int; +pub const NV_COLOR_FORMAT_NV_COLOR_FORMAT_RGB: NV_COLOR_FORMAT = 0; +pub const NV_COLOR_FORMAT_NV_COLOR_FORMAT_YUV422: NV_COLOR_FORMAT = 1; +pub const NV_COLOR_FORMAT_NV_COLOR_FORMAT_YUV444: NV_COLOR_FORMAT = 2; +pub const NV_COLOR_FORMAT_NV_COLOR_FORMAT_YUV420: NV_COLOR_FORMAT = 3; +pub const NV_COLOR_FORMAT_NV_COLOR_FORMAT_DEFAULT: NV_COLOR_FORMAT = 254; +pub const NV_COLOR_FORMAT_NV_COLOR_FORMAT_AUTO: NV_COLOR_FORMAT = 255; +#[doc = "! See Table 14 of CEA-861E. Not all of this is supported by the GPU."] +pub type NV_COLOR_FORMAT = ::std::os::raw::c_int; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_RGB: NV_COLOR_COLORIMETRY = 0; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_YCC601: NV_COLOR_COLORIMETRY = 1; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_YCC709: NV_COLOR_COLORIMETRY = 2; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_XVYCC601: NV_COLOR_COLORIMETRY = 3; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_XVYCC709: NV_COLOR_COLORIMETRY = 4; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_SYCC601: NV_COLOR_COLORIMETRY = 5; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_ADOBEYCC601: NV_COLOR_COLORIMETRY = 6; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_ADOBERGB: NV_COLOR_COLORIMETRY = 7; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_BT2020RGB: NV_COLOR_COLORIMETRY = 8; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_BT2020YCC: NV_COLOR_COLORIMETRY = 9; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_BT2020cYCC: NV_COLOR_COLORIMETRY = 10; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_DEFAULT: NV_COLOR_COLORIMETRY = 254; +pub const NV_COLOR_COLORIMETRY_NV_COLOR_COLORIMETRY_AUTO: NV_COLOR_COLORIMETRY = 255; +pub type NV_COLOR_COLORIMETRY = ::std::os::raw::c_int; +pub const _NV_DYNAMIC_RANGE_NV_DYNAMIC_RANGE_VESA: _NV_DYNAMIC_RANGE = 0; +pub const _NV_DYNAMIC_RANGE_NV_DYNAMIC_RANGE_CEA: _NV_DYNAMIC_RANGE = 1; +pub const _NV_DYNAMIC_RANGE_NV_DYNAMIC_RANGE_AUTO: _NV_DYNAMIC_RANGE = 255; +pub type _NV_DYNAMIC_RANGE = ::std::os::raw::c_int; +pub use self::_NV_DYNAMIC_RANGE as NV_DYNAMIC_RANGE; +pub const _NV_BPC_NV_BPC_DEFAULT: _NV_BPC = 0; +pub const _NV_BPC_NV_BPC_6: _NV_BPC = 1; +pub const _NV_BPC_NV_BPC_8: _NV_BPC = 2; +pub const _NV_BPC_NV_BPC_10: _NV_BPC = 3; +pub const _NV_BPC_NV_BPC_12: _NV_BPC = 4; +pub const _NV_BPC_NV_BPC_16: _NV_BPC = 5; +pub type _NV_BPC = ::std::os::raw::c_int; +pub use self::_NV_BPC as NV_BPC; +#[doc = "!< app/nvcpl make decision to select the desire color format"] +pub const _NV_COLOR_SELECTION_POLICY_NV_COLOR_SELECTION_POLICY_USER: _NV_COLOR_SELECTION_POLICY = 0; +#[doc = "!< driver/ OS make decision to select the best color format"] +pub const _NV_COLOR_SELECTION_POLICY_NV_COLOR_SELECTION_POLICY_BEST_QUALITY: + _NV_COLOR_SELECTION_POLICY = 1; +pub const _NV_COLOR_SELECTION_POLICY_NV_COLOR_SELECTION_POLICY_DEFAULT: _NV_COLOR_SELECTION_POLICY = + 1; +pub const _NV_COLOR_SELECTION_POLICY_NV_COLOR_SELECTION_POLICY_UNKNOWN: _NV_COLOR_SELECTION_POLICY = + 255; +pub type _NV_COLOR_SELECTION_POLICY = ::std::os::raw::c_int; +pub use self::_NV_COLOR_SELECTION_POLICY as NV_COLOR_SELECTION_POLICY; +pub const _NV_DESKTOP_COLOR_DEPTH_NV_DESKTOP_COLOR_DEPTH_DEFAULT: _NV_DESKTOP_COLOR_DEPTH = 0; +pub const _NV_DESKTOP_COLOR_DEPTH_NV_DESKTOP_COLOR_DEPTH_8BPC: _NV_DESKTOP_COLOR_DEPTH = 1; +pub const _NV_DESKTOP_COLOR_DEPTH_NV_DESKTOP_COLOR_DEPTH_10BPC: _NV_DESKTOP_COLOR_DEPTH = 2; +pub const _NV_DESKTOP_COLOR_DEPTH_NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT: _NV_DESKTOP_COLOR_DEPTH = 3; +pub const _NV_DESKTOP_COLOR_DEPTH_NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_WCG: _NV_DESKTOP_COLOR_DEPTH = + 4; +pub const _NV_DESKTOP_COLOR_DEPTH_NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_HDR: _NV_DESKTOP_COLOR_DEPTH = + 5; +pub const _NV_DESKTOP_COLOR_DEPTH_NV_DESKTOP_COLOR_DEPTH_MAX_VALUE: _NV_DESKTOP_COLOR_DEPTH = 5; +pub type _NV_DESKTOP_COLOR_DEPTH = ::std::os::raw::c_int; +pub use self::_NV_DESKTOP_COLOR_DEPTH as NV_DESKTOP_COLOR_DEPTH; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COLOR_DATA_V1 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Size of this structure"] + pub size: NvU16, + pub cmd: NvU8, + pub data: _NV_COLOR_DATA_V1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COLOR_DATA_V1__bindgen_ty_1 { + #[doc = "!< One of NV_COLOR_FORMAT enum values."] + pub colorFormat: NvU8, + #[doc = "!< One of NV_COLOR_COLORIMETRY enum values."] + pub colorimetry: NvU8, +} +pub type NV_COLOR_DATA_V1 = _NV_COLOR_DATA_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COLOR_DATA_V2 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Size of this structure"] + pub size: NvU16, + pub cmd: NvU8, + pub data: _NV_COLOR_DATA_V2__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COLOR_DATA_V2__bindgen_ty_1 { + #[doc = "!< One of NV_COLOR_FORMAT enum values."] + pub colorFormat: NvU8, + #[doc = "!< One of NV_COLOR_COLORIMETRY enum values."] + pub colorimetry: NvU8, + #[doc = "!< One of NV_DYNAMIC_RANGE enum values."] + pub dynamicRange: NvU8, +} +pub type NV_COLOR_DATA_V2 = _NV_COLOR_DATA_V2; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COLOR_DATA_V3 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Size of this structure"] + pub size: NvU16, + pub cmd: NvU8, + pub data: _NV_COLOR_DATA_V3__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COLOR_DATA_V3__bindgen_ty_1 { + #[doc = "!< One of NV_COLOR_FORMAT enum values."] + pub colorFormat: NvU8, + #[doc = "!< One of NV_COLOR_COLORIMETRY enum values."] + pub colorimetry: NvU8, + #[doc = "!< One of NV_DYNAMIC_RANGE enum values."] + pub dynamicRange: NvU8, + #[doc = "!< One of NV_BPC enum values."] + pub bpc: NV_BPC, +} +pub type NV_COLOR_DATA_V3 = _NV_COLOR_DATA_V3; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COLOR_DATA_V4 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Size of this structure"] + pub size: NvU16, + pub cmd: NvU8, + pub data: _NV_COLOR_DATA_V4__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COLOR_DATA_V4__bindgen_ty_1 { + #[doc = "!< One of NV_COLOR_FORMAT enum values."] + pub colorFormat: NvU8, + #[doc = "!< One of NV_COLOR_COLORIMETRY enum values."] + pub colorimetry: NvU8, + #[doc = "!< One of NV_DYNAMIC_RANGE enum values."] + pub dynamicRange: NvU8, + #[doc = "!< One of NV_BPC enum values."] + pub bpc: NV_BPC, + #[doc = "!< One of the color selection policy"] + pub colorSelectionPolicy: NV_COLOR_SELECTION_POLICY, +} +pub type NV_COLOR_DATA_V4 = _NV_COLOR_DATA_V4; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COLOR_DATA_V5 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Size of this structure"] + pub size: NvU16, + pub cmd: NvU8, + pub data: _NV_COLOR_DATA_V5__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_COLOR_DATA_V5__bindgen_ty_1 { + #[doc = "!< One of NV_COLOR_FORMAT enum values."] + pub colorFormat: NvU8, + #[doc = "!< One of NV_COLOR_COLORIMETRY enum values."] + pub colorimetry: NvU8, + #[doc = "!< One of NV_DYNAMIC_RANGE enum values."] + pub dynamicRange: NvU8, + #[doc = "!< One of NV_BPC enum values."] + pub bpc: NV_BPC, + #[doc = "!< One of the color selection policy"] + pub colorSelectionPolicy: NV_COLOR_SELECTION_POLICY, + #[doc = "!< One of NV_DESKTOP_COLOR_DEPTH enum values."] + pub depth: NV_DESKTOP_COLOR_DEPTH, +} +pub type NV_COLOR_DATA_V5 = _NV_COLOR_DATA_V5; +pub type NV_COLOR_DATA = NV_COLOR_DATA_V5; +#[doc = "!< Tells the type of structure used to define the Static Metadata Descriptor block."] +pub const NV_STATIC_METADATA_DESCRIPTOR_ID_NV_STATIC_METADATA_TYPE_1: + NV_STATIC_METADATA_DESCRIPTOR_ID = 0; +#[doc = "! @}"] +pub type NV_STATIC_METADATA_DESCRIPTOR_ID = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_CAPABILITIES_V1 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Static Metadata Descriptor Id (0 for static metadata type 1)"] + pub static_metadata_descriptor_id: NV_STATIC_METADATA_DESCRIPTOR_ID, + pub display_data: _NV_HDR_CAPABILITIES_V1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_CAPABILITIES_V1__bindgen_ty_1 { + #[doc = "!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x0: NvU16, + #[doc = "!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y0: NvU16, + #[doc = "!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x1: NvU16, + #[doc = "!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y1: NvU16, + #[doc = "!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x2: NvU16, + #[doc = "!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y2: NvU16, + #[doc = "!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_x: NvU16, + #[doc = "!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_y: NvU16, + #[doc = "!< Maximum display luminance = desired max luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)"] + pub desired_content_max_luminance: NvU16, + #[doc = "!< Minimum display luminance = desired min luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)"] + pub desired_content_min_luminance: NvU16, + #[doc = "!< Desired maximum Frame-Average Light Level (MaxFALL) of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)"] + pub desired_content_max_frame_average_luminance: NvU16, +} +impl _NV_HDR_CAPABILITIES_V1 { + #[inline] + pub fn isST2084EotfSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isST2084EotfSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isST2084EotfSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isST2084EotfSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isTraditionalHdrGammaSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_isTraditionalHdrGammaSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isTraditionalHdrGammaSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isTraditionalHdrGammaSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isEdrSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_isEdrSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isEdrSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isEdrSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn driverExpandDefaultHdrParameters(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_driverExpandDefaultHdrParameters(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn driverExpandDefaultHdrParameters_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_driverExpandDefaultHdrParameters_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isTraditionalSdrGammaSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_isTraditionalSdrGammaSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isTraditionalSdrGammaSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isTraditionalSdrGammaSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 27u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 27u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 27u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 27u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isST2084EotfSupported: NvU32, + isTraditionalHdrGammaSupported: NvU32, + isEdrSupported: NvU32, + driverExpandDefaultHdrParameters: NvU32, + isTraditionalSdrGammaSupported: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isST2084EotfSupported: u32 = + unsafe { ::std::mem::transmute(isST2084EotfSupported) }; + isST2084EotfSupported as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let isTraditionalHdrGammaSupported: u32 = + unsafe { ::std::mem::transmute(isTraditionalHdrGammaSupported) }; + isTraditionalHdrGammaSupported as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let isEdrSupported: u32 = unsafe { ::std::mem::transmute(isEdrSupported) }; + isEdrSupported as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let driverExpandDefaultHdrParameters: u32 = + unsafe { ::std::mem::transmute(driverExpandDefaultHdrParameters) }; + driverExpandDefaultHdrParameters as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let isTraditionalSdrGammaSupported: u32 = + unsafe { ::std::mem::transmute(isTraditionalSdrGammaSupported) }; + isTraditionalSdrGammaSupported as u64 + }); + __bindgen_bitfield_unit.set(5usize, 27u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_HDR_CAPABILITIES_V1 = _NV_HDR_CAPABILITIES_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_CAPABILITIES_V2 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Static Metadata Descriptor Id (0 for static metadata type 1)"] + pub static_metadata_descriptor_id: NV_STATIC_METADATA_DESCRIPTOR_ID, + pub display_data: _NV_HDR_CAPABILITIES_V2__bindgen_ty_1, + pub dv_static_metadata: _NV_HDR_CAPABILITIES_V2__bindgen_ty_2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_CAPABILITIES_V2__bindgen_ty_1 { + #[doc = "!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x0: NvU16, + #[doc = "!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y0: NvU16, + #[doc = "!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x1: NvU16, + #[doc = "!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y1: NvU16, + #[doc = "!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x2: NvU16, + #[doc = "!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y2: NvU16, + #[doc = "!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_x: NvU16, + #[doc = "!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_y: NvU16, + #[doc = "!< Maximum display luminance = desired max luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)"] + pub desired_content_max_luminance: NvU16, + #[doc = "!< Minimum display luminance = desired min luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)"] + pub desired_content_min_luminance: NvU16, + #[doc = "!< Desired maximum Frame-Average Light Level (MaxFALL) of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)"] + pub desired_content_max_frame_average_luminance: NvU16, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_CAPABILITIES_V2__bindgen_ty_2 { + pub _bitfield_align_1: [u16; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Represents min luminance level of Sink"] + pub target_min_luminance: NvU16, + #[doc = "!< Represents max luminance level of sink"] + pub target_max_luminance: NvU16, + #[doc = "!< Red primary chromaticity coordinate x"] + pub cc_red_x: NvU16, + #[doc = "!< Red primary chromaticity coordinate y"] + pub cc_red_y: NvU16, + #[doc = "!< Green primary chromaticity coordinate x"] + pub cc_green_x: NvU16, + #[doc = "!< Green primary chromaticity coordinate Y"] + pub cc_green_y: NvU16, + #[doc = "!< Blue primary chromaticity coordinate x"] + pub cc_blue_x: NvU16, + #[doc = "!< Blue primary chromaticity coordinate y"] + pub cc_blue_y: NvU16, + #[doc = "!< White primary chromaticity coordinate x"] + pub cc_white_x: NvU16, + #[doc = "!< White primary chromaticity coordinate y"] + pub cc_white_y: NvU16, +} +impl _NV_HDR_CAPABILITIES_V2__bindgen_ty_2 { + #[inline] + pub fn VSVDB_version(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u32) } + } + #[inline] + pub fn set_VSVDB_version(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn VSVDB_version_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_VSVDB_version_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn dm_version(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 8u8) as u32) } + } + #[inline] + pub fn set_dm_version(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn dm_version_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 8u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_dm_version_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn supports_2160p60hz(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) } + } + #[inline] + pub fn set_supports_2160p60hz(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supports_2160p60hz_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 11usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_supports_2160p60hz_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 11usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn supports_YUV422_12bit(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) } + } + #[inline] + pub fn set_supports_YUV422_12bit(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supports_YUV422_12bit_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 12usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_supports_YUV422_12bit_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 12usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn supports_global_dimming(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) } + } + #[inline] + pub fn set_supports_global_dimming(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supports_global_dimming_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 13usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_supports_global_dimming_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 13usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn colorimetry(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u32) } + } + #[inline] + pub fn set_colorimetry(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(14usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn colorimetry_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 14usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_colorimetry_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 14usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn supports_backlight_control(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 2u8) as u32) } + } + #[inline] + pub fn set_supports_backlight_control(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn supports_backlight_control_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 15usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_supports_backlight_control_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 15usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn backlt_min_luma(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 2u8) as u32) } + } + #[inline] + pub fn set_backlt_min_luma(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn backlt_min_luma_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 17usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_backlt_min_luma_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 17usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn interface_supported_by_sink(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 2u8) as u32) } + } + #[inline] + pub fn set_interface_supported_by_sink(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn interface_supported_by_sink_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 19usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_interface_supported_by_sink_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 19usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn supports_10b_12b_444(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 2u8) as u32) } + } + #[inline] + pub fn set_supports_10b_12b_444(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn supports_10b_12b_444_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 21usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_supports_10b_12b_444_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 21usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 9u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(23usize, 9u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 23usize, + 9u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 23usize, + 9u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + VSVDB_version: NvU32, + dm_version: NvU32, + supports_2160p60hz: NvU32, + supports_YUV422_12bit: NvU32, + supports_global_dimming: NvU32, + colorimetry: NvU32, + supports_backlight_control: NvU32, + backlt_min_luma: NvU32, + interface_supported_by_sink: NvU32, + supports_10b_12b_444: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 3u8, { + let VSVDB_version: u32 = unsafe { ::std::mem::transmute(VSVDB_version) }; + VSVDB_version as u64 + }); + __bindgen_bitfield_unit.set(3usize, 8u8, { + let dm_version: u32 = unsafe { ::std::mem::transmute(dm_version) }; + dm_version as u64 + }); + __bindgen_bitfield_unit.set(11usize, 1u8, { + let supports_2160p60hz: u32 = unsafe { ::std::mem::transmute(supports_2160p60hz) }; + supports_2160p60hz as u64 + }); + __bindgen_bitfield_unit.set(12usize, 1u8, { + let supports_YUV422_12bit: u32 = + unsafe { ::std::mem::transmute(supports_YUV422_12bit) }; + supports_YUV422_12bit as u64 + }); + __bindgen_bitfield_unit.set(13usize, 1u8, { + let supports_global_dimming: u32 = + unsafe { ::std::mem::transmute(supports_global_dimming) }; + supports_global_dimming as u64 + }); + __bindgen_bitfield_unit.set(14usize, 1u8, { + let colorimetry: u32 = unsafe { ::std::mem::transmute(colorimetry) }; + colorimetry as u64 + }); + __bindgen_bitfield_unit.set(15usize, 2u8, { + let supports_backlight_control: u32 = + unsafe { ::std::mem::transmute(supports_backlight_control) }; + supports_backlight_control as u64 + }); + __bindgen_bitfield_unit.set(17usize, 2u8, { + let backlt_min_luma: u32 = unsafe { ::std::mem::transmute(backlt_min_luma) }; + backlt_min_luma as u64 + }); + __bindgen_bitfield_unit.set(19usize, 2u8, { + let interface_supported_by_sink: u32 = + unsafe { ::std::mem::transmute(interface_supported_by_sink) }; + interface_supported_by_sink as u64 + }); + __bindgen_bitfield_unit.set(21usize, 2u8, { + let supports_10b_12b_444: u32 = unsafe { ::std::mem::transmute(supports_10b_12b_444) }; + supports_10b_12b_444 as u64 + }); + __bindgen_bitfield_unit.set(23usize, 9u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +impl _NV_HDR_CAPABILITIES_V2 { + #[inline] + pub fn isST2084EotfSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isST2084EotfSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isST2084EotfSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isST2084EotfSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isTraditionalHdrGammaSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_isTraditionalHdrGammaSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isTraditionalHdrGammaSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isTraditionalHdrGammaSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isEdrSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_isEdrSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isEdrSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isEdrSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn driverExpandDefaultHdrParameters(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_driverExpandDefaultHdrParameters(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn driverExpandDefaultHdrParameters_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_driverExpandDefaultHdrParameters_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isTraditionalSdrGammaSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_isTraditionalSdrGammaSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isTraditionalSdrGammaSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isTraditionalSdrGammaSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isDolbyVisionSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_isDolbyVisionSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isDolbyVisionSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isDolbyVisionSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 26u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 26u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 26u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 26u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isST2084EotfSupported: NvU32, + isTraditionalHdrGammaSupported: NvU32, + isEdrSupported: NvU32, + driverExpandDefaultHdrParameters: NvU32, + isTraditionalSdrGammaSupported: NvU32, + isDolbyVisionSupported: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isST2084EotfSupported: u32 = + unsafe { ::std::mem::transmute(isST2084EotfSupported) }; + isST2084EotfSupported as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let isTraditionalHdrGammaSupported: u32 = + unsafe { ::std::mem::transmute(isTraditionalHdrGammaSupported) }; + isTraditionalHdrGammaSupported as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let isEdrSupported: u32 = unsafe { ::std::mem::transmute(isEdrSupported) }; + isEdrSupported as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let driverExpandDefaultHdrParameters: u32 = + unsafe { ::std::mem::transmute(driverExpandDefaultHdrParameters) }; + driverExpandDefaultHdrParameters as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let isTraditionalSdrGammaSupported: u32 = + unsafe { ::std::mem::transmute(isTraditionalSdrGammaSupported) }; + isTraditionalSdrGammaSupported as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let isDolbyVisionSupported: u32 = + unsafe { ::std::mem::transmute(isDolbyVisionSupported) }; + isDolbyVisionSupported as u64 + }); + __bindgen_bitfield_unit.set(6usize, 26u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_HDR_CAPABILITIES_V2 = _NV_HDR_CAPABILITIES_V2; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_CAPABILITIES_V3 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Static Metadata Descriptor Id (0 for static metadata type 1)"] + pub static_metadata_descriptor_id: NV_STATIC_METADATA_DESCRIPTOR_ID, + pub display_data: _NV_HDR_CAPABILITIES_V3__bindgen_ty_1, + pub dv_static_metadata: _NV_HDR_CAPABILITIES_V3__bindgen_ty_2, + pub hdr10plus_vsvdb: _NV_HDR_CAPABILITIES_V3__bindgen_ty_3, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_CAPABILITIES_V3__bindgen_ty_1 { + #[doc = "!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x0: NvU16, + #[doc = "!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y0: NvU16, + #[doc = "!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x1: NvU16, + #[doc = "!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y1: NvU16, + #[doc = "!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x2: NvU16, + #[doc = "!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y2: NvU16, + #[doc = "!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_x: NvU16, + #[doc = "!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_y: NvU16, + #[doc = "!< Maximum display luminance = desired max luminance of HDR content ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2)"] + pub desired_content_max_luminance: NvU16, + #[doc = "!< Minimum display luminance = desired min luminance of HDR content ([0x0000-0xFFFF] = [0.0 - 6.55350] cd/m^2, in units of 0.0001 cd/m^2)"] + pub desired_content_min_luminance: NvU16, + #[doc = "!< Desired maximum Frame-Average Light Level (MaxFALL) of HDR content ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2)"] + pub desired_content_max_frame_average_luminance: NvU16, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_CAPABILITIES_V3__bindgen_ty_2 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Represents min luminance level of Sink"] + pub target_min_luminance: NvU16, + #[doc = "!< Represents max luminance level of sink"] + pub target_max_luminance: NvU16, + #[doc = "!< Red primary chromaticity coordinate x"] + pub cc_red_x: NvU16, + #[doc = "!< Red primary chromaticity coordinate y"] + pub cc_red_y: NvU16, + #[doc = "!< Green primary chromaticity coordinate x"] + pub cc_green_x: NvU16, + #[doc = "!< Green primary chromaticity coordinate Y"] + pub cc_green_y: NvU16, + #[doc = "!< Blue primary chromaticity coordinate x"] + pub cc_blue_x: NvU16, + #[doc = "!< Blue primary chromaticity coordinate y"] + pub cc_blue_y: NvU16, + #[doc = "!< White primary chromaticity coordinate x"] + pub cc_white_x: NvU16, + #[doc = "!< White primary chromaticity coordinate y"] + pub cc_white_y: NvU16, +} +impl _NV_HDR_CAPABILITIES_V3__bindgen_ty_2 { + #[inline] + pub fn VSVDB_version(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u32) } + } + #[inline] + pub fn set_VSVDB_version(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn VSVDB_version_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 3u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_VSVDB_version_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn dm_version(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 8u8) as u32) } + } + #[inline] + pub fn set_dm_version(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn dm_version_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 8u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_dm_version_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn supports_2160p60hz(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) } + } + #[inline] + pub fn set_supports_2160p60hz(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supports_2160p60hz_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 11usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_supports_2160p60hz_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 11usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn supports_YUV422_12bit(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) } + } + #[inline] + pub fn set_supports_YUV422_12bit(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supports_YUV422_12bit_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 12usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_supports_YUV422_12bit_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 12usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn supports_global_dimming(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) } + } + #[inline] + pub fn set_supports_global_dimming(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supports_global_dimming_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 13usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_supports_global_dimming_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 13usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn colorimetry(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u32) } + } + #[inline] + pub fn set_colorimetry(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(14usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn colorimetry_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 14usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_colorimetry_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 14usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn supports_backlight_control(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 2u8) as u32) } + } + #[inline] + pub fn set_supports_backlight_control(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn supports_backlight_control_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 15usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_supports_backlight_control_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 15usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn backlt_min_luma(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 2u8) as u32) } + } + #[inline] + pub fn set_backlt_min_luma(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn backlt_min_luma_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 17usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_backlt_min_luma_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 17usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn interface_supported_by_sink(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 2u8) as u32) } + } + #[inline] + pub fn set_interface_supported_by_sink(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn interface_supported_by_sink_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 19usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_interface_supported_by_sink_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 19usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn supports_10b_12b_444(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 2u8) as u32) } + } + #[inline] + pub fn set_supports_10b_12b_444(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn supports_10b_12b_444_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 21usize, + 2u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_supports_10b_12b_444_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 21usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn parity(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) } + } + #[inline] + pub fn set_parity(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(23usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn parity_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 23usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_parity_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 23usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 24usize, + 8u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 24usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + VSVDB_version: NvU32, + dm_version: NvU32, + supports_2160p60hz: NvU32, + supports_YUV422_12bit: NvU32, + supports_global_dimming: NvU32, + colorimetry: NvU32, + supports_backlight_control: NvU32, + backlt_min_luma: NvU32, + interface_supported_by_sink: NvU32, + supports_10b_12b_444: NvU32, + parity: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 3u8, { + let VSVDB_version: u32 = unsafe { ::std::mem::transmute(VSVDB_version) }; + VSVDB_version as u64 + }); + __bindgen_bitfield_unit.set(3usize, 8u8, { + let dm_version: u32 = unsafe { ::std::mem::transmute(dm_version) }; + dm_version as u64 + }); + __bindgen_bitfield_unit.set(11usize, 1u8, { + let supports_2160p60hz: u32 = unsafe { ::std::mem::transmute(supports_2160p60hz) }; + supports_2160p60hz as u64 + }); + __bindgen_bitfield_unit.set(12usize, 1u8, { + let supports_YUV422_12bit: u32 = + unsafe { ::std::mem::transmute(supports_YUV422_12bit) }; + supports_YUV422_12bit as u64 + }); + __bindgen_bitfield_unit.set(13usize, 1u8, { + let supports_global_dimming: u32 = + unsafe { ::std::mem::transmute(supports_global_dimming) }; + supports_global_dimming as u64 + }); + __bindgen_bitfield_unit.set(14usize, 1u8, { + let colorimetry: u32 = unsafe { ::std::mem::transmute(colorimetry) }; + colorimetry as u64 + }); + __bindgen_bitfield_unit.set(15usize, 2u8, { + let supports_backlight_control: u32 = + unsafe { ::std::mem::transmute(supports_backlight_control) }; + supports_backlight_control as u64 + }); + __bindgen_bitfield_unit.set(17usize, 2u8, { + let backlt_min_luma: u32 = unsafe { ::std::mem::transmute(backlt_min_luma) }; + backlt_min_luma as u64 + }); + __bindgen_bitfield_unit.set(19usize, 2u8, { + let interface_supported_by_sink: u32 = + unsafe { ::std::mem::transmute(interface_supported_by_sink) }; + interface_supported_by_sink as u64 + }); + __bindgen_bitfield_unit.set(21usize, 2u8, { + let supports_10b_12b_444: u32 = unsafe { ::std::mem::transmute(supports_10b_12b_444) }; + supports_10b_12b_444 as u64 + }); + __bindgen_bitfield_unit.set(23usize, 1u8, { + let parity: u32 = unsafe { ::std::mem::transmute(parity) }; + parity as u64 + }); + __bindgen_bitfield_unit.set(24usize, 8u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[repr(align(2))] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_CAPABILITIES_V3__bindgen_ty_3 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, +} +impl _NV_HDR_CAPABILITIES_V3__bindgen_ty_3 { + #[inline] + pub fn application_version(&self) -> NvU16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u16) } + } + #[inline] + pub fn set_application_version(&mut self, val: NvU16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn application_version_raw(this: *const Self) -> NvU16 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 2u8, + ) as u16) + } + } + #[inline] + pub unsafe fn set_application_version_raw(this: *mut Self, val: NvU16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn full_frame_peak_luminance_index(&self) -> NvU16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 2u8) as u16) } + } + #[inline] + pub fn set_full_frame_peak_luminance_index(&mut self, val: NvU16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn full_frame_peak_luminance_index_raw(this: *const Self) -> NvU16 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 2u8, + ) as u16) + } + } + #[inline] + pub unsafe fn set_full_frame_peak_luminance_index_raw(this: *mut Self, val: NvU16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn peak_luminance_index(&self) -> NvU16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) } + } + #[inline] + pub fn set_peak_luminance_index(&mut self, val: NvU16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn peak_luminance_index_raw(this: *const Self) -> NvU16 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 4u8, + ) as u16) + } + } + #[inline] + pub unsafe fn set_peak_luminance_index_raw(this: *mut Self, val: NvU16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u16) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU16 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 8u8, + ) as u16) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + application_version: NvU16, + full_frame_peak_luminance_index: NvU16, + peak_luminance_index: NvU16, + reserved: NvU16, + ) -> __BindgenBitfieldUnit<[u8; 2usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 2u8, { + let application_version: u16 = unsafe { ::std::mem::transmute(application_version) }; + application_version as u64 + }); + __bindgen_bitfield_unit.set(2usize, 2u8, { + let full_frame_peak_luminance_index: u16 = + unsafe { ::std::mem::transmute(full_frame_peak_luminance_index) }; + full_frame_peak_luminance_index as u64 + }); + __bindgen_bitfield_unit.set(4usize, 4u8, { + let peak_luminance_index: u16 = unsafe { ::std::mem::transmute(peak_luminance_index) }; + peak_luminance_index as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let reserved: u16 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +impl _NV_HDR_CAPABILITIES_V3 { + #[inline] + pub fn isST2084EotfSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isST2084EotfSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isST2084EotfSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isST2084EotfSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isTraditionalHdrGammaSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_isTraditionalHdrGammaSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isTraditionalHdrGammaSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isTraditionalHdrGammaSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isEdrSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_isEdrSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isEdrSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isEdrSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn driverExpandDefaultHdrParameters(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_driverExpandDefaultHdrParameters(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn driverExpandDefaultHdrParameters_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_driverExpandDefaultHdrParameters_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isTraditionalSdrGammaSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_isTraditionalSdrGammaSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isTraditionalSdrGammaSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isTraditionalSdrGammaSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isDolbyVisionSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_isDolbyVisionSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isDolbyVisionSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isDolbyVisionSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isHdr10PlusSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + } + #[inline] + pub fn set_isHdr10PlusSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isHdr10PlusSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isHdr10PlusSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isHdr10PlusGamingSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } + } + #[inline] + pub fn set_isHdr10PlusGamingSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isHdr10PlusGamingSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isHdr10PlusGamingSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isNvidiaCertifiedDisplay(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) } + } + #[inline] + pub fn set_isNvidiaCertifiedDisplay(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isNvidiaCertifiedDisplay_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isNvidiaCertifiedDisplay_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 23u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(9usize, 23u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 9usize, + 23u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 9usize, + 23u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isST2084EotfSupported: NvU32, + isTraditionalHdrGammaSupported: NvU32, + isEdrSupported: NvU32, + driverExpandDefaultHdrParameters: NvU32, + isTraditionalSdrGammaSupported: NvU32, + isDolbyVisionSupported: NvU32, + isHdr10PlusSupported: NvU32, + isHdr10PlusGamingSupported: NvU32, + isNvidiaCertifiedDisplay: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isST2084EotfSupported: u32 = + unsafe { ::std::mem::transmute(isST2084EotfSupported) }; + isST2084EotfSupported as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let isTraditionalHdrGammaSupported: u32 = + unsafe { ::std::mem::transmute(isTraditionalHdrGammaSupported) }; + isTraditionalHdrGammaSupported as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let isEdrSupported: u32 = unsafe { ::std::mem::transmute(isEdrSupported) }; + isEdrSupported as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let driverExpandDefaultHdrParameters: u32 = + unsafe { ::std::mem::transmute(driverExpandDefaultHdrParameters) }; + driverExpandDefaultHdrParameters as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let isTraditionalSdrGammaSupported: u32 = + unsafe { ::std::mem::transmute(isTraditionalSdrGammaSupported) }; + isTraditionalSdrGammaSupported as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let isDolbyVisionSupported: u32 = + unsafe { ::std::mem::transmute(isDolbyVisionSupported) }; + isDolbyVisionSupported as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let isHdr10PlusSupported: u32 = unsafe { ::std::mem::transmute(isHdr10PlusSupported) }; + isHdr10PlusSupported as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let isHdr10PlusGamingSupported: u32 = + unsafe { ::std::mem::transmute(isHdr10PlusGamingSupported) }; + isHdr10PlusGamingSupported as u64 + }); + __bindgen_bitfield_unit.set(8usize, 1u8, { + let isNvidiaCertifiedDisplay: u32 = + unsafe { ::std::mem::transmute(isNvidiaCertifiedDisplay) }; + isNvidiaCertifiedDisplay as u64 + }); + __bindgen_bitfield_unit.set(9usize, 23u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_HDR_CAPABILITIES_V3 = _NV_HDR_CAPABILITIES_V3; +pub type NV_HDR_CAPABILITIES = NV_HDR_CAPABILITIES_V3; +#[doc = "!< Get current HDR output configuration"] +pub const NV_HDR_CMD_NV_HDR_CMD_GET: NV_HDR_CMD = 0; +#[doc = "!< Set HDR output configuration"] +pub const NV_HDR_CMD_NV_HDR_CMD_SET: NV_HDR_CMD = 1; +#[doc = "! @}"] +pub type NV_HDR_CMD = ::std::os::raw::c_int; +#[doc = "!< Turn off HDR"] +pub const NV_HDR_MODE_NV_HDR_MODE_OFF: NV_HDR_MODE = 0; +#[doc = "!< Source: CCCS [a.k.a FP16 scRGB, linear, sRGB primaries, [-65504,0, 65504] range, RGB(1,1,1) = 80nits] Output : UHDA HDR [a.k.a HDR10, RGB/YCC 10/12bpc ST2084(PQ) EOTF RGB(1,1,1) = 10000 nits, Rec2020 color primaries, ST2086 static HDR metadata]. This is the only supported production HDR mode."] +pub const NV_HDR_MODE_NV_HDR_MODE_UHDA: NV_HDR_MODE = 2; +#[doc = "!< Experimental mode only, not for production! Source: HDR10 RGB 10bpc Output: HDR10 RGB 10 bpc - signal UHDA HDR mode (PQ + Rec2020) to the sink but send source pixel values unmodified (no PQ or Rec2020 conversions) - assumes source is already in HDR10 format."] +pub const NV_HDR_MODE_NV_HDR_MODE_UHDA_PASSTHROUGH: NV_HDR_MODE = 5; +#[doc = "!< Experimental mode only, not for production! Source: RGB8 Dolby Vision encoded (12 bpc YCbCr422 packed into RGB8) Output: Dolby Vision encoded : Application is to encoded frames in DV format and embed DV dynamic metadata as described in Dolby Vision specification."] +pub const NV_HDR_MODE_NV_HDR_MODE_DOLBY_VISION: NV_HDR_MODE = 7; +#[doc = "!< Do not use! Internal test mode only, to be removed. Source: CCCS (a.k.a FP16 scRGB) Output : EDR (Extended Dynamic Range) - HDR content is tonemapped and gamut mapped to output on regular SDR display set to max luminance ( ~300 nits )."] +pub const NV_HDR_MODE_NV_HDR_MODE_EDR: NV_HDR_MODE = 3; +#[doc = "!< Do not use! Internal test mode only, to be removed. Source: any Output: SDR (Standard Dynamic Range), we continuously send SDR EOTF InfoFrame signaling, HDMI compliance testing."] +pub const NV_HDR_MODE_NV_HDR_MODE_SDR: NV_HDR_MODE = 4; +#[doc = "!< Do not use! Internal test mode only, to be removed. Source: CCCS (a.k.a FP16 scRGB) Output : notebook HDR"] +pub const NV_HDR_MODE_NV_HDR_MODE_UHDA_NB: NV_HDR_MODE = 6; +#[doc = "!< Do not use! Obsolete, to be removed. NV_HDR_MODE_UHDBD == NV_HDR_MODE_UHDA, reflects obsolete pre-UHDA naming convention."] +pub const NV_HDR_MODE_NV_HDR_MODE_UHDBD: NV_HDR_MODE = 2; +pub type NV_HDR_MODE = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_COLOR_DATA_V1 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Command get/set"] + pub cmd: NV_HDR_CMD, + #[doc = "!< HDR mode"] + pub hdrMode: NV_HDR_MODE, + #[doc = "!< Static Metadata Descriptor Id (0 for static metadata type 1)"] + pub static_metadata_descriptor_id: NV_STATIC_METADATA_DESCRIPTOR_ID, + pub mastering_display_data: _NV_HDR_COLOR_DATA_V1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_COLOR_DATA_V1__bindgen_ty_1 { + #[doc = "!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x0: NvU16, + #[doc = "!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y0: NvU16, + #[doc = "!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x1: NvU16, + #[doc = "!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y1: NvU16, + #[doc = "!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x2: NvU16, + #[doc = "!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y2: NvU16, + #[doc = "!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_x: NvU16, + #[doc = "!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_y: NvU16, + #[doc = "!< Maximum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)"] + pub max_display_mastering_luminance: NvU16, + #[doc = "!< Minimum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)"] + pub min_display_mastering_luminance: NvU16, + #[doc = "!< Maximum Content Light level (MaxCLL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)"] + pub max_content_light_level: NvU16, + #[doc = "!< Maximum Frame-Average Light Level (MaxFALL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)"] + pub max_frame_average_light_level: NvU16, +} +pub type NV_HDR_COLOR_DATA_V1 = _NV_HDR_COLOR_DATA_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_COLOR_DATA_V2 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Command get/set"] + pub cmd: NV_HDR_CMD, + #[doc = "!< HDR mode"] + pub hdrMode: NV_HDR_MODE, + #[doc = "!< Static Metadata Descriptor Id (0 for static metadata type 1)"] + pub static_metadata_descriptor_id: NV_STATIC_METADATA_DESCRIPTOR_ID, + pub mastering_display_data: _NV_HDR_COLOR_DATA_V2__bindgen_ty_1, + #[doc = "!< Optional, One of NV_COLOR_FORMAT enum values, if set it will apply requested color format for HDR session"] + pub hdrColorFormat: NV_COLOR_FORMAT, + #[doc = "!< Optional, One of NV_DYNAMIC_RANGE enum values, if set it will apply requested dynamic range for HDR session"] + pub hdrDynamicRange: NV_DYNAMIC_RANGE, + #[doc = "!< Optional, One of NV_BPC enum values, if set it will apply requested color depth\n!< Dolby Vision mode: DV supports specific combinations of colorformat, dynamic range and bpc. Please refer Dolby Vision specification.\n!< If invalid or no combination is passed driver will force default combination of RGB format + full range + 8bpc.\n!< HDR mode: These fields are ignored in hdr mode"] + pub hdrBpc: NV_BPC, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_COLOR_DATA_V2__bindgen_ty_1 { + #[doc = "!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x0: NvU16, + #[doc = "!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y0: NvU16, + #[doc = "!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x1: NvU16, + #[doc = "!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y1: NvU16, + #[doc = "!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x2: NvU16, + #[doc = "!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y2: NvU16, + #[doc = "!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_x: NvU16, + #[doc = "!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_y: NvU16, + #[doc = "!< Maximum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)"] + pub max_display_mastering_luminance: NvU16, + #[doc = "!< Minimum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)"] + pub min_display_mastering_luminance: NvU16, + #[doc = "!< Maximum Content Light level (MaxCLL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)"] + pub max_content_light_level: NvU16, + #[doc = "!< Maximum Frame-Average Light Level (MaxFALL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)"] + pub max_frame_average_light_level: NvU16, +} +pub type NV_HDR_COLOR_DATA_V2 = _NV_HDR_COLOR_DATA_V2; +pub type NV_HDR_COLOR_DATA = NV_HDR_COLOR_DATA_V2; +#[doc = "!< sRGB IEC 61966-2-1:1999 == DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709"] +pub const _NV_COLORSPACE_TYPE_NV_COLORSPACE_sRGB: _NV_COLORSPACE_TYPE = 0; +#[doc = "!< FP16 linear with sRGB color primaries == DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709"] +pub const _NV_COLORSPACE_TYPE_NV_COLORSPACE_xRGB: _NV_COLORSPACE_TYPE = 1; +#[doc = "!< ITU-R Rec BT.2100 (HDR10) == DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020"] +pub const _NV_COLORSPACE_TYPE_NV_COLORSPACE_REC2100: _NV_COLORSPACE_TYPE = 12; +pub type _NV_COLORSPACE_TYPE = ::std::os::raw::c_int; +pub use self::_NV_COLORSPACE_TYPE as NV_COLORSPACE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_HDR_METADATA_V1 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x0: NvU16, + #[doc = "!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y0: NvU16, + #[doc = "!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x1: NvU16, + #[doc = "!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y1: NvU16, + #[doc = "!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_x2: NvU16, + #[doc = "!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayPrimary_y2: NvU16, + #[doc = "!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_x: NvU16, + #[doc = "!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])"] + pub displayWhitePoint_y: NvU16, + #[doc = "!< Maximum display mastering luminance ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2)"] + pub max_display_mastering_luminance: NvU16, + #[doc = "!< Minimum display mastering luminance ([0x0000-0xFFFF] = [0.0 - 6.55350] cd/m^2, in units of 0.0001 cd/m^2)"] + pub min_display_mastering_luminance: NvU16, + #[doc = "!< Maximum Content Light level (MaxCLL) ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2)"] + pub max_content_light_level: NvU16, + #[doc = "!< Maximum Frame-Average Light Level (MaxFALL) ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2)"] + pub max_frame_average_light_level: NvU16, +} +pub type NV_HDR_METADATA_V1 = _NV_HDR_METADATA_V1; +pub type NV_HDR_METADATA = NV_HDR_METADATA_V1; +pub const _NV_DISPLAY_OUTPUT_MODE_NV_DISPLAY_OUTPUT_MODE_SDR: _NV_DISPLAY_OUTPUT_MODE = 0; +pub const _NV_DISPLAY_OUTPUT_MODE_NV_DISPLAY_OUTPUT_MODE_HDR10: _NV_DISPLAY_OUTPUT_MODE = 1; +pub const _NV_DISPLAY_OUTPUT_MODE_NV_DISPLAY_OUTPUT_MODE_HDR10PLUS_GAMING: _NV_DISPLAY_OUTPUT_MODE = + 2; +pub type _NV_DISPLAY_OUTPUT_MODE = ::std::os::raw::c_int; +pub use self::_NV_DISPLAY_OUTPUT_MODE as NV_DISPLAY_OUTPUT_MODE; +pub const _NV_HDR_TONEMAPPING_METHOD_NV_HDR_TONEMAPPING_APP: _NV_HDR_TONEMAPPING_METHOD = 0; +pub const _NV_HDR_TONEMAPPING_METHOD_NV_HDR_TONEMAPPING_GPU: _NV_HDR_TONEMAPPING_METHOD = 1; +pub type _NV_HDR_TONEMAPPING_METHOD = ::std::os::raw::c_int; +pub use self::_NV_HDR_TONEMAPPING_METHOD as NV_HDR_TONEMAPPING_METHOD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_DISPLAY_COLORIMETRY_V1 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< min luminance, cd/m^2"] + pub min_luminance: f32, + #[doc = "!< max 100% frame luminance, cd/m^2"] + pub max_full_frame_luminance: f32, + #[doc = "!< max 10% frame luminance, cd/m^2"] + pub max_luminance: f32, + #[doc = "!< HDR brightness luminance scaling factor applied by GPU on output pixels"] + pub hdrBrightnessLuminanceScalingFactor: f32, + #[doc = "!< red primary chromaticity coordinate x"] + pub red_primary_x: f32, + #[doc = "!< red primary chromaticity coordinate y"] + pub red_primary_y: f32, + #[doc = "!< green primary chromaticity coordinate x"] + pub green_primary_x: f32, + #[doc = "!< green primary chromaticity coordinate y"] + pub green_primary_y: f32, + #[doc = "!< blue primary chromaticity coordinate x"] + pub blue_primary_x: f32, + #[doc = "!< blue primary chromaticity coordinate y"] + pub blue_primary_y: f32, + #[doc = "!< white point chromaticity coordinate x"] + pub white_point_x: f32, + #[doc = "!< white point chromaticity coordinate y"] + pub white_point_y: f32, +} +pub type NV_DISPLAY_COLORIMETRY_V1 = _NV_DISPLAY_COLORIMETRY_V1; +pub type NV_DISPLAY_COLORIMETRY = NV_DISPLAY_COLORIMETRY_V1; +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_DISP_GetTiming()."] +#[repr(C)] +#[repr(align(4))] +#[derive(Copy, Clone)] +pub struct NV_TIMING_FLAG { + pub _bitfield_align_1: [u16; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, + pub __bindgen_anon_1: NV_TIMING_FLAG__bindgen_ty_1, + pub _bitfield_align_2: [u8; 0], + pub _bitfield_2: __BindgenBitfieldUnit<[u8; 1usize]>, + pub __bindgen_padding_0: [u8; 5usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union NV_TIMING_FLAG__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, +} +impl NV_TIMING_FLAG__bindgen_ty_1 { + #[inline] + pub fn tvFormat(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_tvFormat(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn tvFormat_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 8u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_tvFormat_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn ceaId(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } + } + #[inline] + pub fn set_ceaId(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn ceaId_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 8u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_ceaId_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn nvPsfId(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u32) } + } + #[inline] + pub fn set_nvPsfId(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn nvPsfId_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 16usize, + 8u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_nvPsfId_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 16usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + tvFormat: NvU32, + ceaId: NvU32, + nvPsfId: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 3usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let tvFormat: u32 = unsafe { ::std::mem::transmute(tvFormat) }; + tvFormat as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let ceaId: u32 = unsafe { ::std::mem::transmute(ceaId) }; + ceaId as u64 + }); + __bindgen_bitfield_unit.set(16usize, 8u8, { + let nvPsfId: u32 = unsafe { ::std::mem::transmute(nvPsfId) }; + nvPsfId as u64 + }); + __bindgen_bitfield_unit + } +} +impl NV_TIMING_FLAG { + #[inline] + pub fn isInterlaced(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) } + } + #[inline] + pub fn set_isInterlaced(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn isInterlaced_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 4u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isInterlaced_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved0(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 12u8) as u32) } + } + #[inline] + pub fn set_reserved0(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 12u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved0_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 12u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved0_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 12u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isInterlaced: NvU32, + reserved0: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 2usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let isInterlaced: u32 = unsafe { ::std::mem::transmute(isInterlaced) }; + isInterlaced as u64 + }); + __bindgen_bitfield_unit.set(4usize, 12u8, { + let reserved0: u32 = unsafe { ::std::mem::transmute(reserved0) }; + reserved0 as u64 + }); + __bindgen_bitfield_unit + } + #[inline] + pub fn scaling(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_scaling(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_2.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub unsafe fn scaling_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_2), + 0usize, + 8u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_scaling_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_2), + 0usize, + 8u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_2(scaling: NvU32) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let scaling: u32 = unsafe { ::std::mem::transmute(scaling) }; + scaling as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_DISP_GetTiming()."] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_TIMING_INPUT { + #[doc = "!< (IN) structure version"] + pub version: NvU32, + #[doc = "!< Visible horizontal size"] + pub width: NvU32, + #[doc = "!< Visible vertical size"] + pub height: NvU32, + #[doc = "!< Timing refresh rate"] + pub rr: f32, + #[doc = "!< Flag containing additional info for timing calculation."] + pub flag: NV_TIMING_FLAG, + #[doc = "!< Timing type(formula) to use for calculating the timing"] + pub type_: NV_TIMING_OVERRIDE, +} +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_DISP_GetTiming()."] +pub type NV_TIMING_INPUT = _NV_TIMING_INPUT; +pub const NV_MONITOR_CAPS_TYPE_NV_MONITOR_CAPS_TYPE_HDMI_VSDB: NV_MONITOR_CAPS_TYPE = 4096; +pub const NV_MONITOR_CAPS_TYPE_NV_MONITOR_CAPS_TYPE_HDMI_VCDB: NV_MONITOR_CAPS_TYPE = 4097; +pub const NV_MONITOR_CAPS_TYPE_NV_MONITOR_CAPS_TYPE_GENERIC: NV_MONITOR_CAPS_TYPE = 4098; +#[doc = "! HDMI-related and extended CAPs"] +pub type NV_MONITOR_CAPS_TYPE = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MONITOR_CAPS_VCDB { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +} +impl _NV_MONITOR_CAPS_VCDB { + #[inline] + pub fn quantizationRangeYcc(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_quantizationRangeYcc(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn quantizationRangeYcc_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_quantizationRangeYcc_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn quantizationRangeRgb(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_quantizationRangeRgb(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn quantizationRangeRgb_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_quantizationRangeRgb_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn scanInfoPreferredVideoFormat(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 2u8) as u8) } + } + #[inline] + pub fn set_scanInfoPreferredVideoFormat(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn scanInfoPreferredVideoFormat_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 2u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_scanInfoPreferredVideoFormat_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn scanInfoITVideoFormats(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u8) } + } + #[inline] + pub fn set_scanInfoITVideoFormats(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn scanInfoITVideoFormats_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 2u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_scanInfoITVideoFormats_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn scanInfoCEVideoFormats(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 2u8) as u8) } + } + #[inline] + pub fn set_scanInfoCEVideoFormats(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn scanInfoCEVideoFormats_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 2u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_scanInfoCEVideoFormats_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + quantizationRangeYcc: NvU8, + quantizationRangeRgb: NvU8, + scanInfoPreferredVideoFormat: NvU8, + scanInfoITVideoFormats: NvU8, + scanInfoCEVideoFormats: NvU8, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let quantizationRangeYcc: u8 = unsafe { ::std::mem::transmute(quantizationRangeYcc) }; + quantizationRangeYcc as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let quantizationRangeRgb: u8 = unsafe { ::std::mem::transmute(quantizationRangeRgb) }; + quantizationRangeRgb as u64 + }); + __bindgen_bitfield_unit.set(2usize, 2u8, { + let scanInfoPreferredVideoFormat: u8 = + unsafe { ::std::mem::transmute(scanInfoPreferredVideoFormat) }; + scanInfoPreferredVideoFormat as u64 + }); + __bindgen_bitfield_unit.set(4usize, 2u8, { + let scanInfoITVideoFormats: u8 = + unsafe { ::std::mem::transmute(scanInfoITVideoFormats) }; + scanInfoITVideoFormats as u64 + }); + __bindgen_bitfield_unit.set(6usize, 2u8, { + let scanInfoCEVideoFormats: u8 = + unsafe { ::std::mem::transmute(scanInfoCEVideoFormats) }; + scanInfoCEVideoFormats as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_MONITOR_CAPS_VCDB = _NV_MONITOR_CAPS_VCDB; +#[doc = "! See NvAPI_DISP_GetMonitorCapabilities()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MONITOR_CAPS_VSDB { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, + #[doc = "!< Bye 4"] + pub maxTmdsClock: NvU8, + pub _bitfield_align_2: [u8; 0], + pub _bitfield_2: __BindgenBitfieldUnit<[u8; 1usize]>, + #[doc = "!< Byte 6"] + pub videoLatency: NvU8, + #[doc = "!< Byte 7"] + pub audioLatency: NvU8, + #[doc = "!< Byte 8"] + pub interlacedVideoLatency: NvU8, + #[doc = "!< Byte 9"] + pub interlacedAudioLatency: NvU8, + pub _bitfield_align_3: [u8; 0], + pub _bitfield_3: __BindgenBitfieldUnit<[u8; 2usize]>, + #[doc = "!< Keeping maximum length for 3 bits"] + pub hdmi_vic: [NvU8; 7usize], + #[doc = "!< Keeping maximum length for 5 bits"] + pub hdmi_3d: [NvU8; 31usize], +} +impl _NV_MONITOR_CAPS_VSDB { + #[inline] + pub fn sourcePhysicalAddressB(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) } + } + #[inline] + pub fn set_sourcePhysicalAddressB(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn sourcePhysicalAddressB_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 4u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_sourcePhysicalAddressB_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn sourcePhysicalAddressA(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) } + } + #[inline] + pub fn set_sourcePhysicalAddressA(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn sourcePhysicalAddressA_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 4u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_sourcePhysicalAddressA_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn sourcePhysicalAddressD(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u8) } + } + #[inline] + pub fn set_sourcePhysicalAddressD(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn sourcePhysicalAddressD_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 4u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_sourcePhysicalAddressD_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn sourcePhysicalAddressC(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 4u8) as u8) } + } + #[inline] + pub fn set_sourcePhysicalAddressC(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn sourcePhysicalAddressC_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 12usize, + 4u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_sourcePhysicalAddressC_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 12usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn supportDualDviOperation(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u8) } + } + #[inline] + pub fn set_supportDualDviOperation(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supportDualDviOperation_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 16usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_supportDualDviOperation_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 16usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved6(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 2u8) as u8) } + } + #[inline] + pub fn set_reserved6(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved6_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 17usize, + 2u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_reserved6_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 17usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn supportDeepColorYCbCr444(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u8) } + } + #[inline] + pub fn set_supportDeepColorYCbCr444(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supportDeepColorYCbCr444_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 19usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_supportDeepColorYCbCr444_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 19usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn supportDeepColor30bits(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u8) } + } + #[inline] + pub fn set_supportDeepColor30bits(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(20usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supportDeepColor30bits_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 20usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_supportDeepColor30bits_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 20usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn supportDeepColor36bits(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u8) } + } + #[inline] + pub fn set_supportDeepColor36bits(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supportDeepColor36bits_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 21usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_supportDeepColor36bits_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 21usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn supportDeepColor48bits(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u8) } + } + #[inline] + pub fn set_supportDeepColor48bits(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(22usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supportDeepColor48bits_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 22usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_supportDeepColor48bits_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 22usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn supportAI(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u8) } + } + #[inline] + pub fn set_supportAI(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(23usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supportAI_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 23usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_supportAI_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 23usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + sourcePhysicalAddressB: NvU8, + sourcePhysicalAddressA: NvU8, + sourcePhysicalAddressD: NvU8, + sourcePhysicalAddressC: NvU8, + supportDualDviOperation: NvU8, + reserved6: NvU8, + supportDeepColorYCbCr444: NvU8, + supportDeepColor30bits: NvU8, + supportDeepColor36bits: NvU8, + supportDeepColor48bits: NvU8, + supportAI: NvU8, + ) -> __BindgenBitfieldUnit<[u8; 3usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let sourcePhysicalAddressB: u8 = + unsafe { ::std::mem::transmute(sourcePhysicalAddressB) }; + sourcePhysicalAddressB as u64 + }); + __bindgen_bitfield_unit.set(4usize, 4u8, { + let sourcePhysicalAddressA: u8 = + unsafe { ::std::mem::transmute(sourcePhysicalAddressA) }; + sourcePhysicalAddressA as u64 + }); + __bindgen_bitfield_unit.set(8usize, 4u8, { + let sourcePhysicalAddressD: u8 = + unsafe { ::std::mem::transmute(sourcePhysicalAddressD) }; + sourcePhysicalAddressD as u64 + }); + __bindgen_bitfield_unit.set(12usize, 4u8, { + let sourcePhysicalAddressC: u8 = + unsafe { ::std::mem::transmute(sourcePhysicalAddressC) }; + sourcePhysicalAddressC as u64 + }); + __bindgen_bitfield_unit.set(16usize, 1u8, { + let supportDualDviOperation: u8 = + unsafe { ::std::mem::transmute(supportDualDviOperation) }; + supportDualDviOperation as u64 + }); + __bindgen_bitfield_unit.set(17usize, 2u8, { + let reserved6: u8 = unsafe { ::std::mem::transmute(reserved6) }; + reserved6 as u64 + }); + __bindgen_bitfield_unit.set(19usize, 1u8, { + let supportDeepColorYCbCr444: u8 = + unsafe { ::std::mem::transmute(supportDeepColorYCbCr444) }; + supportDeepColorYCbCr444 as u64 + }); + __bindgen_bitfield_unit.set(20usize, 1u8, { + let supportDeepColor30bits: u8 = + unsafe { ::std::mem::transmute(supportDeepColor30bits) }; + supportDeepColor30bits as u64 + }); + __bindgen_bitfield_unit.set(21usize, 1u8, { + let supportDeepColor36bits: u8 = + unsafe { ::std::mem::transmute(supportDeepColor36bits) }; + supportDeepColor36bits as u64 + }); + __bindgen_bitfield_unit.set(22usize, 1u8, { + let supportDeepColor48bits: u8 = + unsafe { ::std::mem::transmute(supportDeepColor48bits) }; + supportDeepColor48bits as u64 + }); + __bindgen_bitfield_unit.set(23usize, 1u8, { + let supportAI: u8 = unsafe { ::std::mem::transmute(supportAI) }; + supportAI as u64 + }); + __bindgen_bitfield_unit + } + #[inline] + pub fn cnc0SupportGraphicsTextContent(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_cnc0SupportGraphicsTextContent(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_2.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn cnc0SupportGraphicsTextContent_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_2), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_cnc0SupportGraphicsTextContent_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_2), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn cnc1SupportPhotoContent(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_cnc1SupportPhotoContent(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_2.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn cnc1SupportPhotoContent_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_2), + 1usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_cnc1SupportPhotoContent_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_2), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn cnc2SupportCinemaContent(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(2usize, 1u8) as u8) } + } + #[inline] + pub fn set_cnc2SupportCinemaContent(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_2.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn cnc2SupportCinemaContent_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_2), + 2usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_cnc2SupportCinemaContent_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_2), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn cnc3SupportGameContent(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(3usize, 1u8) as u8) } + } + #[inline] + pub fn set_cnc3SupportGameContent(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_2.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn cnc3SupportGameContent_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_2), + 3usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_cnc3SupportGameContent_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_2), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved8(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(4usize, 1u8) as u8) } + } + #[inline] + pub fn set_reserved8(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_2.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved8_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_2), + 4usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_reserved8_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_2), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn hasVicEntries(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(5usize, 1u8) as u8) } + } + #[inline] + pub fn set_hasVicEntries(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_2.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn hasVicEntries_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_2), + 5usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_hasVicEntries_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_2), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn hasInterlacedLatencyField(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(6usize, 1u8) as u8) } + } + #[inline] + pub fn set_hasInterlacedLatencyField(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_2.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn hasInterlacedLatencyField_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_2), + 6usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_hasInterlacedLatencyField_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_2), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn hasLatencyField(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(7usize, 1u8) as u8) } + } + #[inline] + pub fn set_hasLatencyField(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_2.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn hasLatencyField_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_2), + 7usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_hasLatencyField_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_2), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_2( + cnc0SupportGraphicsTextContent: NvU8, + cnc1SupportPhotoContent: NvU8, + cnc2SupportCinemaContent: NvU8, + cnc3SupportGameContent: NvU8, + reserved8: NvU8, + hasVicEntries: NvU8, + hasInterlacedLatencyField: NvU8, + hasLatencyField: NvU8, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let cnc0SupportGraphicsTextContent: u8 = + unsafe { ::std::mem::transmute(cnc0SupportGraphicsTextContent) }; + cnc0SupportGraphicsTextContent as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let cnc1SupportPhotoContent: u8 = + unsafe { ::std::mem::transmute(cnc1SupportPhotoContent) }; + cnc1SupportPhotoContent as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let cnc2SupportCinemaContent: u8 = + unsafe { ::std::mem::transmute(cnc2SupportCinemaContent) }; + cnc2SupportCinemaContent as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let cnc3SupportGameContent: u8 = + unsafe { ::std::mem::transmute(cnc3SupportGameContent) }; + cnc3SupportGameContent as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let reserved8: u8 = unsafe { ::std::mem::transmute(reserved8) }; + reserved8 as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let hasVicEntries: u8 = unsafe { ::std::mem::transmute(hasVicEntries) }; + hasVicEntries as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let hasInterlacedLatencyField: u8 = + unsafe { ::std::mem::transmute(hasInterlacedLatencyField) }; + hasInterlacedLatencyField as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let hasLatencyField: u8 = unsafe { ::std::mem::transmute(hasLatencyField) }; + hasLatencyField as u64 + }); + __bindgen_bitfield_unit + } + #[inline] + pub fn reserved13(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_3.get(0usize, 7u8) as u8) } + } + #[inline] + pub fn set_reserved13(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_3.set(0usize, 7u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved13_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_3), + 0usize, + 7u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_reserved13_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_3), + 0usize, + 7u8, + val as u64, + ) + } + } + #[inline] + pub fn has3dEntries(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_3.get(7usize, 1u8) as u8) } + } + #[inline] + pub fn set_has3dEntries(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_3.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn has3dEntries_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_3), + 7usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_has3dEntries_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_3), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn hdmi3dLength(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_3.get(8usize, 5u8) as u8) } + } + #[inline] + pub fn set_hdmi3dLength(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_3.set(8usize, 5u8, val as u64) + } + } + #[inline] + pub unsafe fn hdmi3dLength_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_3), + 8usize, + 5u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_hdmi3dLength_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_3), + 8usize, + 5u8, + val as u64, + ) + } + } + #[inline] + pub fn hdmiVicLength(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_3.get(13usize, 3u8) as u8) } + } + #[inline] + pub fn set_hdmiVicLength(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_3.set(13usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn hdmiVicLength_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_3), + 13usize, + 3u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_hdmiVicLength_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_3), + 13usize, + 3u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_3( + reserved13: NvU8, + has3dEntries: NvU8, + hdmi3dLength: NvU8, + hdmiVicLength: NvU8, + ) -> __BindgenBitfieldUnit<[u8; 2usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 7u8, { + let reserved13: u8 = unsafe { ::std::mem::transmute(reserved13) }; + reserved13 as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let has3dEntries: u8 = unsafe { ::std::mem::transmute(has3dEntries) }; + has3dEntries as u64 + }); + __bindgen_bitfield_unit.set(8usize, 5u8, { + let hdmi3dLength: u8 = unsafe { ::std::mem::transmute(hdmi3dLength) }; + hdmi3dLength as u64 + }); + __bindgen_bitfield_unit.set(13usize, 3u8, { + let hdmiVicLength: u8 = unsafe { ::std::mem::transmute(hdmiVicLength) }; + hdmiVicLength as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! See NvAPI_DISP_GetMonitorCapabilities()."] +pub type NV_MONITOR_CAPS_VSDB = _NV_MONITOR_CAPS_VSDB; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MONITOR_CAPS_GENERIC { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +} +impl _NV_MONITOR_CAPS_GENERIC { + #[inline] + pub fn supportVRR(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_supportVRR(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supportVRR_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_supportVRR_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn supportULMB(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_supportULMB(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supportULMB_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_supportULMB_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isTrueGsync(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + } + #[inline] + pub fn set_isTrueGsync(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isTrueGsync_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_isTrueGsync_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isRLACapable(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) } + } + #[inline] + pub fn set_isRLACapable(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isRLACapable_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_isRLACapable_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn currentlyCapableOfVRR(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) } + } + #[inline] + pub fn set_currentlyCapableOfVRR(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn currentlyCapableOfVRR_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_currentlyCapableOfVRR_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn isBasicVRR(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u8) } + } + #[inline] + pub fn set_isBasicVRR(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isBasicVRR_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_isBasicVRR_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 2u8) as u8) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 2u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + supportVRR: NvU8, + supportULMB: NvU8, + isTrueGsync: NvU8, + isRLACapable: NvU8, + currentlyCapableOfVRR: NvU8, + isBasicVRR: NvU8, + reserved: NvU8, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let supportVRR: u8 = unsafe { ::std::mem::transmute(supportVRR) }; + supportVRR as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let supportULMB: u8 = unsafe { ::std::mem::transmute(supportULMB) }; + supportULMB as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let isTrueGsync: u8 = unsafe { ::std::mem::transmute(isTrueGsync) }; + isTrueGsync as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let isRLACapable: u8 = unsafe { ::std::mem::transmute(isRLACapable) }; + isRLACapable as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let currentlyCapableOfVRR: u8 = unsafe { ::std::mem::transmute(currentlyCapableOfVRR) }; + currentlyCapableOfVRR as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let isBasicVRR: u8 = unsafe { ::std::mem::transmute(isBasicVRR) }; + isBasicVRR as u64 + }); + __bindgen_bitfield_unit.set(6usize, 2u8, { + let reserved: u8 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_MONITOR_CAPS_GENERIC = _NV_MONITOR_CAPS_GENERIC; +#[doc = "! See NvAPI_DISP_GetMonitorCapabilities()."] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NV_MONITOR_CAPABILITIES_V1 { + pub version: NvU32, + pub size: NvU16, + pub infoType: NvU32, + #[doc = "!< Out: VGA, TV, DVI, HDMI, DP"] + pub connectorType: NvU32, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub data: _NV_MONITOR_CAPABILITIES_V1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NV_MONITOR_CAPABILITIES_V1__bindgen_ty_1 { + pub vsdb: NV_MONITOR_CAPS_VSDB, + pub vcdb: NV_MONITOR_CAPS_VCDB, + pub caps: NV_MONITOR_CAPS_GENERIC, +} +impl _NV_MONITOR_CAPABILITIES_V1 { + #[inline] + pub fn bIsValidInfo(&self) -> NvU8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_bIsValidInfo(&mut self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsValidInfo_raw(this: *const Self) -> NvU8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_bIsValidInfo_raw(this: *mut Self, val: NvU8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1(bIsValidInfo: NvU8) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsValidInfo: u8 = unsafe { ::std::mem::transmute(bIsValidInfo) }; + bIsValidInfo as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! See NvAPI_DISP_GetMonitorCapabilities()."] +pub type NV_MONITOR_CAPABILITIES_V1 = _NV_MONITOR_CAPABILITIES_V1; +#[doc = "! See NvAPI_DISP_GetMonitorCapabilities()."] +pub type NV_MONITOR_CAPABILITIES = NV_MONITOR_CAPABILITIES_V1; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MONITOR_COLOR_DATA { + pub version: NvU32, + #[doc = "!< One of the supported color formats"] + pub colorFormat: NV_DP_COLOR_FORMAT, + #[doc = "!< One of the supported bit depths"] + pub backendBitDepths: NV_DP_BPC, +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_MONITOR_COLOR_CAPS_V1 = _NV_MONITOR_COLOR_DATA; +#[doc = "! \\ingroup dispcontrol"] +pub type NV_MONITOR_COLOR_CAPS = NV_MONITOR_COLOR_CAPS_V1; +#[doc = "! \\ingroup dispcontrol\n! Used in NvAPI_DISP_EnumCustomDisplay() and NvAPI_DISP_TryCustomDisplay()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_CUSTOM_DISPLAY { + pub version: NvU32, + #[doc = "!< Source surface(source mode) width"] + pub width: NvU32, + #[doc = "!< Source surface(source mode) height"] + pub height: NvU32, + #[doc = "!< Source surface color depth.\"0\" means all 8/16/32bpp"] + pub depth: NvU32, + #[doc = "!< Color format (optional)"] + pub colorFormat: NV_FORMAT, + #[doc = "!< For multimon support, should be set to (0,0,1.0,1.0) for now."] + pub srcPartition: NV_VIEWPORTF, + #[doc = "!< Horizontal scaling ratio"] + pub xRatio: f32, + #[doc = "!< Vertical scaling ratio"] + pub yRatio: f32, + #[doc = "!< Timing used to program TMDS/DAC/LVDS/HDMI/TVEncoder, etc."] + pub timing: NV_TIMING, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub __bindgen_padding_0: [u8; 3usize], +} +impl NV_CUSTOM_DISPLAY { + #[inline] + pub fn hwModeSetOnly(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_hwModeSetOnly(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn hwModeSetOnly_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_hwModeSetOnly_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1(hwModeSetOnly: NvU32) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let hwModeSetOnly: u32 = unsafe { ::std::mem::transmute(hwModeSetOnly) }; + hwModeSetOnly as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup dispcontrol\n! @{"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_EDID_DATA_V1 { + #[doc = "!< Structure version."] + pub version: NvU32, + #[doc = "!< Pointer to EDID data."] + pub pEDID: *mut NvU8, + #[doc = "!< Size of EDID data."] + pub sizeOfEDID: NvU32, +} +#[doc = "! \\ingroup dispcontrol\n! @{"] +pub type NV_EDID_DATA_V1 = _NV_EDID_DATA_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_EDID_DATA_V2 { + #[doc = "!< Structure version."] + pub version: NvU32, + #[doc = "!< Pointer to EDID data."] + pub pEDID: *mut NvU8, + #[doc = "!< Size of EDID data."] + pub sizeOfEDID: NvU32, + #[doc = "!< Reserved for future use."] + pub reserved: [NvU32; 8usize], +} +pub type NV_EDID_DATA_V2 = _NV_EDID_DATA_V2; +pub type NV_EDID_DATA = NV_EDID_DATA_V2; +#[doc = "! @}"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GET_ADAPTIVE_SYNC_DATA_V1 { + #[doc = "!< [in] structure version"] + pub version: NvU32, + #[doc = "!< [out] maximum frame interval in micro seconds as set previously using NvAPI_DISP_SetAdaptiveSyncData function."] + pub maxFrameInterval: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< [out] Number of times the last flip was shown on the screen"] + pub lastFlipRefreshCount: NvU32, + #[doc = "!< [out] Timestamp for the lastest flip on the screen"] + pub lastFlipTimeStamp: NvU64, + #[doc = "!< reserved for future use."] + pub reservedEx: [NvU32; 4usize], +} +impl _NV_GET_ADAPTIVE_SYNC_DATA_V1 { + #[inline] + pub fn bDisableAdaptiveSync(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bDisableAdaptiveSync(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bDisableAdaptiveSync_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bDisableAdaptiveSync_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bDisableFrameSplitting(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_bDisableFrameSplitting(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bDisableFrameSplitting_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bDisableFrameSplitting_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 30u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 30u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bDisableAdaptiveSync: NvU32, + bDisableFrameSplitting: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bDisableAdaptiveSync: u32 = unsafe { ::std::mem::transmute(bDisableAdaptiveSync) }; + bDisableAdaptiveSync as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let bDisableFrameSplitting: u32 = + unsafe { ::std::mem::transmute(bDisableFrameSplitting) }; + bDisableFrameSplitting as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! @}"] +pub type NV_GET_ADAPTIVE_SYNC_DATA_V1 = _NV_GET_ADAPTIVE_SYNC_DATA_V1; +#[doc = "! @}"] +pub type NV_GET_ADAPTIVE_SYNC_DATA = NV_GET_ADAPTIVE_SYNC_DATA_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_SET_ADAPTIVE_SYNC_DATA_V1 { + #[doc = "!< [in] structure version"] + pub version: NvU32, + #[doc = "!< [in] deprecated, please use maxFrameIntervalNs instead\n!< If maxFrameInterval is sent as 0, default values from EDID will be used."] + pub maxFrameInterval: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Ensure the alignment is 8 bytes and reserve it for future use."] + pub reserved1: NvU32, + #[doc = "!< [in] maximum frame interval in nano seconds.\n!< If maxFrameIntervalNs is sent as 0, default values from EDID will be used."] + pub maxFrameIntervalNs: NvU64, + #[doc = "!< reserved for future use."] + pub reservedEx: [NvU32; 4usize], +} +impl _NV_SET_ADAPTIVE_SYNC_DATA_V1 { + #[inline] + pub fn bDisableAdaptiveSync(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bDisableAdaptiveSync(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bDisableAdaptiveSync_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bDisableAdaptiveSync_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bDisableFrameSplitting(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_bDisableFrameSplitting(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bDisableFrameSplitting_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bDisableFrameSplitting_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 30u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 30u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bDisableAdaptiveSync: NvU32, + bDisableFrameSplitting: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bDisableAdaptiveSync: u32 = unsafe { ::std::mem::transmute(bDisableAdaptiveSync) }; + bDisableAdaptiveSync as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let bDisableFrameSplitting: u32 = + unsafe { ::std::mem::transmute(bDisableFrameSplitting) }; + bDisableFrameSplitting as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_SET_ADAPTIVE_SYNC_DATA_V1 = _NV_SET_ADAPTIVE_SYNC_DATA_V1; +pub type NV_SET_ADAPTIVE_SYNC_DATA = NV_SET_ADAPTIVE_SYNC_DATA_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1 { + #[doc = "!< [in] structure version"] + pub version: NvU32, + #[doc = "!< [out] frame interval in micro seconds if Virtual RR is currently applied"] + pub frameIntervalUs: NvU32, + #[doc = "!< [out] Refresh Rate * 1000"] + pub rrx1k: NvU32, + #[doc = "!< [out] If the content is Gaming"] + pub bIsGamingVrr: NvU32, + #[doc = "!< reserved for future use."] + pub reservedEx: [NvU32; 6usize], +} +pub type NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1 = _NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GET_VIRTUAL_REFRESH_RATE_DATA_V2 { + #[doc = "!< [in] structure version"] + pub version: NvU32, + #[doc = "!< [out] frame interval in micro seconds if Virtual RR is currently applied. This variable is deprecated in V2 and should not be used."] + pub frameIntervalUs: NvU32, + #[doc = "!< [out] Refresh Rate * 1000"] + pub rrx1k: NvU32, + #[doc = "!< [out] If the content is Gaming"] + pub bIsGamingVrr: NvU32, + #[doc = "!< [out] frame interval in nano seconds if Virtual RR is currently applied"] + pub frameIntervalNs: NvU64, + #[doc = "!< reserved for future use."] + pub reservedEx: [NvU32; 4usize], +} +pub type NV_GET_VIRTUAL_REFRESH_RATE_DATA_V2 = _NV_GET_VIRTUAL_REFRESH_RATE_DATA_V2; +pub type NV_GET_VIRTUAL_REFRESH_RATE_DATA = NV_GET_VIRTUAL_REFRESH_RATE_DATA_V2; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1 { + #[doc = "!< [in] structure version"] + pub version: NvU32, + #[doc = "!< [in] frame interval in micro seconds if Virtual RR is currently applied"] + pub frameIntervalUs: NvU32, + #[doc = "!< [in] Refresh Rate * 1000"] + pub rrx1k: NvU32, + #[doc = "!< [in] If the content is Gaming"] + pub bIsGamingVrr: NvU32, + #[doc = "!< reserved for future use."] + pub reservedEx: [NvU32; 6usize], +} +pub type NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1 = _NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_SET_VIRTUAL_REFRESH_RATE_DATA_V2 { + #[doc = "!< [in] structure version"] + pub version: NvU32, + #[doc = "!< [in] frame interval in micro seconds if Virtual RR is currently applied. This variable is deprecated in V2 and should not be used."] + pub frameIntervalUs: NvU32, + #[doc = "!< [in] Refresh Rate * 1000"] + pub rrx1k: NvU32, + #[doc = "!< [in] If the content is Gaming"] + pub bIsGamingVrr: NvU32, + #[doc = "!< [in] frame interval in nano seconds if Virtual RR is currently applied"] + pub frameIntervalNs: NvU64, + #[doc = "!< reserved for future use."] + pub reservedEx: [NvU32; 4usize], +} +pub type NV_SET_VIRTUAL_REFRESH_RATE_DATA_V2 = _NV_SET_VIRTUAL_REFRESH_RATE_DATA_V2; +pub type NV_SET_VIRTUAL_REFRESH_RATE_DATA = NV_SET_VIRTUAL_REFRESH_RATE_DATA_V2; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_SET_PREFERRED_STEREO_DISPLAY_V1 { + #[doc = "!< [in] Structure version"] + pub version: NvU32, + #[doc = "!< [in] Monitor Identifier to be set"] + pub displayId: NvU32, + #[doc = "!< Reserved for future use without adding versioning"] + pub reserved: NvU32, +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_SET_PREFERRED_STEREO_DISPLAY = NV_SET_PREFERRED_STEREO_DISPLAY_V1; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_GET_PREFERRED_STEREO_DISPLAY_V1 { + #[doc = "!< [in] Structure version"] + pub version: NvU32, + #[doc = "!< [out] The queried stereo display"] + pub displayId: NvU32, + #[doc = "!< Reserved for future use without adding versioning"] + pub reserved: NvU32, +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_GET_PREFERRED_STEREO_DISPLAY = NV_GET_PREFERRED_STEREO_DISPLAY_V1; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_DISPLAY_ID_INFO_DATA_V1 { + #[doc = "!< [in] Structure version"] + pub version: NvU32, + #[doc = "!< [out] Locally unique ID (LUID) of the display adapter on which the given display is present."] + pub adapterId: LUID, + #[doc = "!< [out] The target identifier of the given display. This is also called AdapterRelativeId."] + pub targetId: NvU32, + #[doc = "!< Reserved for future use."] + pub reserved: [NvU32; 4usize], +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_DISPLAY_ID_INFO_DATA_V1 = _NV_DISPLAY_ID_INFO_DATA_V1; +#[doc = "! \\ingroup dispcontrol"] +pub type NV_DISPLAY_ID_INFO_DATA = NV_DISPLAY_ID_INFO_DATA_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_TARGET_INFO_DATA_V1 { + #[doc = "!< [in] Structure version"] + pub version: NvU32, + #[doc = "!< [in] Locally unique ID (LUID) of the display adapter on which the target is present."] + pub adapterId: LUID, + #[doc = "!< [in] The target identifier. This is also called AdapterRelativeId."] + pub targetId: NvU32, + #[doc = "!< [out] An array of displayIds corresponding to the input adapterId and targetId.\n!< If the input (targetId, adapterId) pair is a display grid (Mosaic/Surround),\n!< then the output contains the displayId of every display that is part of the display grid.\n!< Otherwise, it contains exactly one displayId.\n!< These displayId values are unique to this (targetId, adapterId) pair."] + pub displayId: [NvU32; 128usize], + #[doc = "!< [out] The number of displays returned in displayId array."] + pub displayIdCount: NvU32, + #[doc = "!< Reserved for future use."] + pub reserved: [NvU32; 4usize], +} +pub type NV_TARGET_INFO_DATA_V1 = _NV_TARGET_INFO_DATA_V1; +pub type NV_TARGET_INFO_DATA = NV_TARGET_INFO_DATA_V1; +#[doc = "! \\ingroup dispcontrol"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GET_VRR_INFO_V1 { + #[doc = "!< [in] Structure version"] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Reserved for future use"] + pub reservedEx: [NvU32; 4usize], +} +impl _NV_GET_VRR_INFO_V1 { + #[inline] + pub fn bIsVRREnabled(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsVRREnabled(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsVRREnabled_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsVRREnabled_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsVRRPossible(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsVRRPossible(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsVRRPossible_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsVRRPossible_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsVRRRequested(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsVRRRequested(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsVRRRequested_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsVRRRequested_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsVRRIndicatorEnabled(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsVRRIndicatorEnabled(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsVRRIndicatorEnabled_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsVRRIndicatorEnabled_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsDisplayInVRRMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsDisplayInVRRMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsDisplayInVRRMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsDisplayInVRRMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 27u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 27u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 27u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 27u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsVRREnabled: NvU32, + bIsVRRPossible: NvU32, + bIsVRRRequested: NvU32, + bIsVRRIndicatorEnabled: NvU32, + bIsDisplayInVRRMode: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsVRREnabled: u32 = unsafe { ::std::mem::transmute(bIsVRREnabled) }; + bIsVRREnabled as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let bIsVRRPossible: u32 = unsafe { ::std::mem::transmute(bIsVRRPossible) }; + bIsVRRPossible as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let bIsVRRRequested: u32 = unsafe { ::std::mem::transmute(bIsVRRRequested) }; + bIsVRRRequested as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let bIsVRRIndicatorEnabled: u32 = + unsafe { ::std::mem::transmute(bIsVRRIndicatorEnabled) }; + bIsVRRIndicatorEnabled as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let bIsDisplayInVRRMode: u32 = unsafe { ::std::mem::transmute(bIsDisplayInVRRMode) }; + bIsDisplayInVRRMode as u64 + }); + __bindgen_bitfield_unit.set(5usize, 27u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! \\ingroup dispcontrol"] +pub type NV_GET_VRR_INFO_V1 = _NV_GET_VRR_INFO_V1; +#[doc = "! \\ingroup dispcontrol"] +pub type NV_GET_VRR_INFO = NV_GET_VRR_INFO_V1; +#[doc = "! This structure defines the topology details."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_MOSAIC_TOPO_DETAILS { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Logical GPU for this topology"] + pub hLogicalGPU: NvLogicalGpuHandle, + #[doc = "!< 0 means topology is valid with the current hardware."] + pub validityMask: NvU32, + #[doc = "!< Number of displays in a row"] + pub rowCount: NvU32, + #[doc = "!< Number of displays in a column"] + pub colCount: NvU32, + pub gpuLayout: [[NV_MOSAIC_TOPO_DETAILS__bindgen_ty_1; 8usize]; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_MOSAIC_TOPO_DETAILS__bindgen_ty_1 { + #[doc = "!< Physical GPU to be used in the topology (0 if GPU missing)"] + pub hPhysicalGPU: NvPhysicalGpuHandle, + #[doc = "!< Connected display target (0 if no display connected)"] + pub displayOutputId: NvU32, + #[doc = "!< Pixels of overlap on left of target: (+overlap, -gap)"] + pub overlapX: NvS32, + #[doc = "!< Pixels of overlap on top of target: (+overlap, -gap)"] + pub overlapY: NvS32, +} +#[doc = "!< All mosaic topologies"] +pub const NV_MOSAIC_TOPO_TYPE_NV_MOSAIC_TOPO_TYPE_ALL: NV_MOSAIC_TOPO_TYPE = 0; +#[doc = "!< Basic Mosaic topologies"] +pub const NV_MOSAIC_TOPO_TYPE_NV_MOSAIC_TOPO_TYPE_BASIC: NV_MOSAIC_TOPO_TYPE = 1; +#[doc = "!< Passive Stereo topologies"] +pub const NV_MOSAIC_TOPO_TYPE_NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO: NV_MOSAIC_TOPO_TYPE = 2; +#[doc = "!< Not supported at this time"] +pub const NV_MOSAIC_TOPO_TYPE_NV_MOSAIC_TOPO_TYPE_SCALED_CLONE: NV_MOSAIC_TOPO_TYPE = 3; +#[doc = "!< Not supported at this time"] +pub const NV_MOSAIC_TOPO_TYPE_NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO_SCALED_CLONE: NV_MOSAIC_TOPO_TYPE = + 4; +#[doc = "!< Always leave this at end of the enum"] +pub const NV_MOSAIC_TOPO_TYPE_NV_MOSAIC_TOPO_TYPE_MAX: NV_MOSAIC_TOPO_TYPE = 5; +#[doc = "! These values refer to the different types of Mosaic topologies that are possible. When\n! getting the supported Mosaic topologies, you can specify one of these types to narrow down\n! the returned list to only those that match the given type."] +pub type NV_MOSAIC_TOPO_TYPE = ::std::os::raw::c_int; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_NONE: NV_MOSAIC_TOPO = 0; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_BEGIN_BASIC: NV_MOSAIC_TOPO = 1; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_1x2_BASIC: NV_MOSAIC_TOPO = 1; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_2x1_BASIC: NV_MOSAIC_TOPO = 2; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_1x3_BASIC: NV_MOSAIC_TOPO = 3; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_3x1_BASIC: NV_MOSAIC_TOPO = 4; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_1x4_BASIC: NV_MOSAIC_TOPO = 5; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_4x1_BASIC: NV_MOSAIC_TOPO = 6; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_2x2_BASIC: NV_MOSAIC_TOPO = 7; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_2x3_BASIC: NV_MOSAIC_TOPO = 8; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_2x4_BASIC: NV_MOSAIC_TOPO = 9; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_3x2_BASIC: NV_MOSAIC_TOPO = 10; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_4x2_BASIC: NV_MOSAIC_TOPO = 11; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_1x5_BASIC: NV_MOSAIC_TOPO = 12; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_1x6_BASIC: NV_MOSAIC_TOPO = 13; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_7x1_BASIC: NV_MOSAIC_TOPO = 14; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_END_BASIC: NV_MOSAIC_TOPO = 23; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO: NV_MOSAIC_TOPO = 24; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_1x2_PASSIVE_STEREO: NV_MOSAIC_TOPO = 24; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_2x1_PASSIVE_STEREO: NV_MOSAIC_TOPO = 25; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_1x3_PASSIVE_STEREO: NV_MOSAIC_TOPO = 26; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_3x1_PASSIVE_STEREO: NV_MOSAIC_TOPO = 27; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_1x4_PASSIVE_STEREO: NV_MOSAIC_TOPO = 28; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_4x1_PASSIVE_STEREO: NV_MOSAIC_TOPO = 29; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO: NV_MOSAIC_TOPO = 30; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_END_PASSIVE_STEREO: NV_MOSAIC_TOPO = 34; +pub const NV_MOSAIC_TOPO_NV_MOSAIC_TOPO_MAX: NV_MOSAIC_TOPO = 35; +#[doc = "! This is a complete list of supported Mosaic topologies.\n!\n! Using a \"Basic\" topology combines multiple monitors to create a single desktop.\n!\n! Using a \"Passive\" topology combines multiples monitors to create a passive stereo desktop.\n! In passive stereo, two identical topologies combine - one topology is used for the right eye and the other identical //! topology (targeting different displays) is used for the left eye. \\n\n! NOTE: common\\inc\\nvEscDef.h shadows a couple PASSIVE_STEREO enums. If this\n! enum list changes and effects the value of NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO\n! please update the corresponding value in nvEscDef.h"] +pub type NV_MOSAIC_TOPO = ::std::os::raw::c_int; +#[doc = "! This is a \"topology brief\" structure. It tells you what you need to know about\n! a topology at a high level. A list of these is returned when you query for the\n! supported Mosaic information.\n!\n! If you need more detailed information about the topology, call\n! NvAPI_Mosaic_GetTopoGroup() with the topology value from this structure."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_MOSAIC_TOPO_BRIEF { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< The topology"] + pub topo: NV_MOSAIC_TOPO, + #[doc = "!< 1 if topo is enabled, else 0"] + pub enabled: NvU32, + #[doc = "!< 1 if topo *can* be enabled, else 0"] + pub isPossible: NvU32, +} +#[doc = "! Basic per-display settings that are used in setting/getting the Mosaic mode"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MOSAIC_DISPLAY_SETTING_V1 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Per-display width"] + pub width: NvU32, + #[doc = "!< Per-display height"] + pub height: NvU32, + #[doc = "!< Bits per pixel"] + pub bpp: NvU32, + #[doc = "!< Display frequency"] + pub freq: NvU32, +} +#[doc = "! Basic per-display settings that are used in setting/getting the Mosaic mode"] +pub type NV_MOSAIC_DISPLAY_SETTING_V1 = _NV_MOSAIC_DISPLAY_SETTING_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_MOSAIC_DISPLAY_SETTING_V2 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Per-display width"] + pub width: NvU32, + #[doc = "!< Per-display height"] + pub height: NvU32, + #[doc = "!< Bits per pixel"] + pub bpp: NvU32, + #[doc = "!< Display frequency"] + pub freq: NvU32, + #[doc = "!< Display frequency in x1k"] + pub rrx1k: NvU32, +} +pub type NV_MOSAIC_DISPLAY_SETTING = NV_MOSAIC_DISPLAY_SETTING_V2; +#[doc = "! This structure is used to contain a list of supported Mosaic topologies\n! along with the display settings that can be used."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MOSAIC_SUPPORTED_TOPO_INFO_V1 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Number of topologies in below array"] + pub topoBriefsCount: NvU32, + #[doc = "!< List of supported topologies with only brief details"] + pub topoBriefs: [NV_MOSAIC_TOPO_BRIEF; 35usize], + #[doc = "!< Number of display settings in below array"] + pub displaySettingsCount: NvU32, + #[doc = "!< List of per display settings possible"] + pub displaySettings: [NV_MOSAIC_DISPLAY_SETTING_V1; 40usize], +} +#[doc = "! This structure is used to contain a list of supported Mosaic topologies\n! along with the display settings that can be used."] +pub type NV_MOSAIC_SUPPORTED_TOPO_INFO_V1 = _NV_MOSAIC_SUPPORTED_TOPO_INFO_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MOSAIC_SUPPORTED_TOPO_INFO_V2 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Number of topologies in below array"] + pub topoBriefsCount: NvU32, + #[doc = "!< List of supported topologies with only brief details"] + pub topoBriefs: [NV_MOSAIC_TOPO_BRIEF; 35usize], + #[doc = "!< Number of display settings in below array"] + pub displaySettingsCount: NvU32, + #[doc = "!< List of per display settings possible"] + pub displaySettings: [NV_MOSAIC_DISPLAY_SETTING_V2; 40usize], +} +pub type NV_MOSAIC_SUPPORTED_TOPO_INFO_V2 = _NV_MOSAIC_SUPPORTED_TOPO_INFO_V2; +pub type NV_MOSAIC_SUPPORTED_TOPO_INFO = NV_MOSAIC_SUPPORTED_TOPO_INFO_V2; +#[doc = "! This structure defines a group of topologies that work together to create one\n! overall layout. All of the supported topologies are represented with this\n! structure.\n!\n! For example, a 'Passive Stereo' topology would be represented with this\n! structure, and would have separate topology details for the left and right eyes.\n! The count would be 2. A 'Basic' topology is also represented by this structure,\n! with a count of 1.\n!\n! The structure is primarily used internally, but is exposed to applications in a\n! read-only fashion because there are some details in it that might be useful\n! (like the number of rows/cols, or connected display information). A user can\n! get the filled-in structure by calling NvAPI_Mosaic_GetTopoGroup().\n!\n! You can then look at the detailed values within the structure. There are no\n! entrypoints which take this structure as input (effectively making it read-only)."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_MOSAIC_TOPO_GROUP { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< The brief details of this topo"] + pub brief: NV_MOSAIC_TOPO_BRIEF, + #[doc = "!< Number of topos in array below"] + pub count: NvU32, + pub topos: [NV_MOSAIC_TOPO_DETAILS; 2usize], +} +#[doc = "! \\ingroup mosaicapi\n! @{"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MOSAIC_GRID_TOPO_DISPLAY_V1 { + #[doc = "!< DisplayID of the display"] + pub displayId: NvU32, + #[doc = "!< (+overlap, -gap)"] + pub overlapX: NvS32, + #[doc = "!< (+overlap, -gap)"] + pub overlapY: NvS32, + #[doc = "!< Rotation of display"] + pub rotation: NV_ROTATE, + #[doc = "!< Reserved, must be 0"] + pub cloneGroup: NvU32, +} +#[doc = "! \\ingroup mosaicapi\n! @{"] +pub type NV_MOSAIC_GRID_TOPO_DISPLAY_V1 = _NV_MOSAIC_GRID_TOPO_DISPLAY_V1; +#[doc = "!< No pixel shift will be applied to this display."] +pub const _NV_PIXEL_SHIFT_TYPE_NV_PIXEL_SHIFT_TYPE_NO_PIXEL_SHIFT: _NV_PIXEL_SHIFT_TYPE = 0; +#[doc = "!< This display will be used to scanout top left pixels in 2x2 PixelShift configuration"] +pub const _NV_PIXEL_SHIFT_TYPE_NV_PIXEL_SHIFT_TYPE_2x2_TOP_LEFT_PIXELS: _NV_PIXEL_SHIFT_TYPE = 1; +#[doc = "!< This display will be used to scanout bottom right pixels in 2x2 PixelShift configuration"] +pub const _NV_PIXEL_SHIFT_TYPE_NV_PIXEL_SHIFT_TYPE_2x2_BOTTOM_RIGHT_PIXELS: _NV_PIXEL_SHIFT_TYPE = + 2; +#[doc = "!< This display will be used to scanout top right pixels in 2x2 PixelShift configuration"] +pub const _NV_PIXEL_SHIFT_TYPE_NV_PIXEL_SHIFT_TYPE_2x2_TOP_RIGHT_PIXELS: _NV_PIXEL_SHIFT_TYPE = 4; +#[doc = "!< This display will be used to scanout bottom left pixels in 2x2 PixelShift configuration"] +pub const _NV_PIXEL_SHIFT_TYPE_NV_PIXEL_SHIFT_TYPE_2x2_BOTTOM_LEFT_PIXELS: _NV_PIXEL_SHIFT_TYPE = 8; +pub type _NV_PIXEL_SHIFT_TYPE = ::std::os::raw::c_int; +pub use self::_NV_PIXEL_SHIFT_TYPE as NV_PIXEL_SHIFT_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MOSAIC_GRID_TOPO_DISPLAY_V2 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< DisplayID of the display"] + pub displayId: NvU32, + #[doc = "!< (+overlap, -gap)"] + pub overlapX: NvS32, + #[doc = "!< (+overlap, -gap)"] + pub overlapY: NvS32, + #[doc = "!< Rotation of display"] + pub rotation: NV_ROTATE, + #[doc = "!< Reserved, must be 0"] + pub cloneGroup: NvU32, + #[doc = "!< Type of the pixel shift enabled display"] + pub pixelShiftType: NV_PIXEL_SHIFT_TYPE, +} +pub type NV_MOSAIC_GRID_TOPO_DISPLAY_V2 = _NV_MOSAIC_GRID_TOPO_DISPLAY_V2; +#[doc = "! \\ingroup mosaicapi\n! @{"] +pub type NV_MOSAIC_GRID_TOPO_DISPLAY = NV_MOSAIC_GRID_TOPO_DISPLAY_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MOSAIC_GRID_TOPO_V1 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Number of rows"] + pub rows: NvU32, + #[doc = "!< Number of columns"] + pub columns: NvU32, + #[doc = "!< Number of display details"] + pub displayCount: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Displays are done as [(row * columns) + column]"] + pub displays: [NV_MOSAIC_GRID_TOPO_DISPLAY_V1; 64usize], + #[doc = "!< Display settings"] + pub displaySettings: NV_MOSAIC_DISPLAY_SETTING_V1, +} +impl _NV_MOSAIC_GRID_TOPO_V1 { + #[inline] + pub fn applyWithBezelCorrect(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_applyWithBezelCorrect(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn applyWithBezelCorrect_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_applyWithBezelCorrect_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn immersiveGaming(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_immersiveGaming(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn immersiveGaming_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_immersiveGaming_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn baseMosaic(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_baseMosaic(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn baseMosaic_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_baseMosaic_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn driverReloadAllowed(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_driverReloadAllowed(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn driverReloadAllowed_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_driverReloadAllowed_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn acceleratePrimaryDisplay(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_acceleratePrimaryDisplay(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn acceleratePrimaryDisplay_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_acceleratePrimaryDisplay_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 27u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 27u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 27u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 27u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + applyWithBezelCorrect: NvU32, + immersiveGaming: NvU32, + baseMosaic: NvU32, + driverReloadAllowed: NvU32, + acceleratePrimaryDisplay: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let applyWithBezelCorrect: u32 = + unsafe { ::std::mem::transmute(applyWithBezelCorrect) }; + applyWithBezelCorrect as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let immersiveGaming: u32 = unsafe { ::std::mem::transmute(immersiveGaming) }; + immersiveGaming as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let baseMosaic: u32 = unsafe { ::std::mem::transmute(baseMosaic) }; + baseMosaic as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let driverReloadAllowed: u32 = unsafe { ::std::mem::transmute(driverReloadAllowed) }; + driverReloadAllowed as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let acceleratePrimaryDisplay: u32 = + unsafe { ::std::mem::transmute(acceleratePrimaryDisplay) }; + acceleratePrimaryDisplay as u64 + }); + __bindgen_bitfield_unit.set(5usize, 27u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_MOSAIC_GRID_TOPO_V1 = _NV_MOSAIC_GRID_TOPO_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MOSAIC_GRID_TOPO_V2 { + #[doc = "!< Version of this structure"] + pub version: NvU32, + #[doc = "!< Number of rows"] + pub rows: NvU32, + #[doc = "!< Number of columns"] + pub columns: NvU32, + #[doc = "!< Number of display details"] + pub displayCount: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Displays are done as [(row * columns) + column]"] + pub displays: [NV_MOSAIC_GRID_TOPO_DISPLAY_V2; 64usize], + #[doc = "!< Display settings"] + pub displaySettings: NV_MOSAIC_DISPLAY_SETTING_V1, +} +impl _NV_MOSAIC_GRID_TOPO_V2 { + #[inline] + pub fn applyWithBezelCorrect(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_applyWithBezelCorrect(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn applyWithBezelCorrect_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_applyWithBezelCorrect_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn immersiveGaming(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_immersiveGaming(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn immersiveGaming_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_immersiveGaming_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn baseMosaic(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_baseMosaic(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn baseMosaic_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_baseMosaic_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn driverReloadAllowed(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_driverReloadAllowed(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn driverReloadAllowed_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_driverReloadAllowed_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn acceleratePrimaryDisplay(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_acceleratePrimaryDisplay(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn acceleratePrimaryDisplay_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_acceleratePrimaryDisplay_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn pixelShift(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_pixelShift(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn pixelShift_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_pixelShift_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 26u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 26u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 26u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 26u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + applyWithBezelCorrect: NvU32, + immersiveGaming: NvU32, + baseMosaic: NvU32, + driverReloadAllowed: NvU32, + acceleratePrimaryDisplay: NvU32, + pixelShift: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let applyWithBezelCorrect: u32 = + unsafe { ::std::mem::transmute(applyWithBezelCorrect) }; + applyWithBezelCorrect as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let immersiveGaming: u32 = unsafe { ::std::mem::transmute(immersiveGaming) }; + immersiveGaming as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let baseMosaic: u32 = unsafe { ::std::mem::transmute(baseMosaic) }; + baseMosaic as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let driverReloadAllowed: u32 = unsafe { ::std::mem::transmute(driverReloadAllowed) }; + driverReloadAllowed as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let acceleratePrimaryDisplay: u32 = + unsafe { ::std::mem::transmute(acceleratePrimaryDisplay) }; + acceleratePrimaryDisplay as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let pixelShift: u32 = unsafe { ::std::mem::transmute(pixelShift) }; + pixelShift as u64 + }); + __bindgen_bitfield_unit.set(6usize, 26u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_MOSAIC_GRID_TOPO_V2 = _NV_MOSAIC_GRID_TOPO_V2; +pub type NV_MOSAIC_GRID_TOPO = NV_MOSAIC_GRID_TOPO_V2; +#[doc = "! \\ingroup mosaicapi"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_MOSAIC_DISPLAY_TOPO_STATUS { + pub version: NvU32, + #[doc = "!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_ERROR_* flags."] + pub errorFlags: NvU32, + #[doc = "!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags."] + pub warningFlags: NvU32, + #[doc = "!< (OUT) The number of valid entries in the displays array."] + pub displayCount: NvU32, + pub displays: [NV_MOSAIC_DISPLAY_TOPO_STATUS__bindgen_ty_1; 128usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_MOSAIC_DISPLAY_TOPO_STATUS__bindgen_ty_1 { + #[doc = "!< (OUT) The DisplayID of this display."] + pub displayId: NvU32, + #[doc = "!< (OUT) Any of the NV_MOSAIC_DISPLAYCAPS_PROBLEM_* flags."] + pub errorFlags: NvU32, + #[doc = "!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags."] + pub warningFlags: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl NV_MOSAIC_DISPLAY_TOPO_STATUS__bindgen_ty_1 { + #[inline] + pub fn supportsRotation(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_supportsRotation(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn supportsRotation_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_supportsRotation_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + supportsRotation: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let supportsRotation: u32 = unsafe { ::std::mem::transmute(supportsRotation) }; + supportsRotation as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! Used in NvAPI_GetCurrentMosaicTopology() and NvAPI_SetCurrentMosaicTopology()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_MOSAIC_TOPOLOGY { + #[doc = "!< Version number of the mosaic topology"] + pub version: NvU32, + #[doc = "!< Horizontal display count"] + pub rowCount: NvU32, + #[doc = "!< Vertical display count"] + pub colCount: NvU32, + pub gpuLayout: [[NV_MOSAIC_TOPOLOGY__bindgen_ty_1; 8usize]; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_MOSAIC_TOPOLOGY__bindgen_ty_1 { + #[doc = "!< Physical GPU to be used in the topology"] + pub hPhysicalGPU: NvPhysicalGpuHandle, + #[doc = "!< Connected display target"] + pub displayOutputId: NvU32, + #[doc = "!< Pixels of overlap on the left of target: (+overlap, -gap)"] + pub overlapX: NvS32, + #[doc = "!< Pixels of overlap on the top of target: (+overlap, -gap)"] + pub overlapY: NvS32, +} +#[doc = "! Used in NvAPI_GetSupportedMosaicTopologies()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NV_MOSAIC_SUPPORTED_TOPOLOGIES { + pub version: NvU32, + #[doc = "!< Count of valid topologies"] + pub totalCount: NvU32, + #[doc = "!< Maximum number of topologies"] + pub topos: [NV_MOSAIC_TOPOLOGY; 16usize], +} +#[doc = "! Used in NvAPI_GSync_QueryCapabilities()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GSYNC_CAPABILITIES_V1 { + #[doc = "!< Version of the structure"] + pub version: NvU32, + #[doc = "!< Board ID"] + pub boardId: NvU32, + #[doc = "!< FPGA Revision"] + pub revision: NvU32, + #[doc = "!< Capabilities of the Sync board. Reserved for future use"] + pub capFlags: NvU32, +} +#[doc = "! Used in NvAPI_GSync_QueryCapabilities()."] +pub type NV_GSYNC_CAPABILITIES_V1 = _NV_GSYNC_CAPABILITIES_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GSYNC_CAPABILITIES_V2 { + #[doc = "!< Version of the structure"] + pub version: NvU32, + #[doc = "!< Board ID"] + pub boardId: NvU32, + #[doc = "!< FPGA major revision"] + pub revision: NvU32, + #[doc = "!< Capabilities of the Sync board. Reserved for future use"] + pub capFlags: NvU32, + #[doc = "!< FPGA minor revision"] + pub extendedRevision: NvU32, +} +pub type NV_GSYNC_CAPABILITIES_V2 = _NV_GSYNC_CAPABILITIES_V2; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GSYNC_CAPABILITIES_V3 { + #[doc = "!< Version of the structure"] + pub version: NvU32, + #[doc = "!< Board ID"] + pub boardId: NvU32, + #[doc = "!< FPGA major revision"] + pub revision: NvU32, + #[doc = "!< Capabilities of the Sync board. Reserved for future use"] + pub capFlags: NvU32, + #[doc = "!< FPGA minor revision"] + pub extendedRevision: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< This parameter returns the maximum possible value that can be programmed\n!< for multiplying / dividing house sync. Only valid if bIsMulDivSupported is set to 1."] + pub maxMulDivValue: NvU32, +} +impl _NV_GSYNC_CAPABILITIES_V3 { + #[inline] + pub fn bIsMulDivSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsMulDivSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsMulDivSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsMulDivSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsMulDivSupported: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsMulDivSupported: u32 = unsafe { ::std::mem::transmute(bIsMulDivSupported) }; + bIsMulDivSupported as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_GSYNC_CAPABILITIES_V3 = _NV_GSYNC_CAPABILITIES_V3; +pub type NV_GSYNC_CAPABILITIES = NV_GSYNC_CAPABILITIES_V3; +pub const _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_NONE: + _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR = 0; +pub const _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_PRIMARY: + _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR = 1; +pub const _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_SECONDARY: + _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR = 2; +pub const _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_TERTIARY: + _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR = 3; +pub const _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_QUARTERNARY: + _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR = 4; +#[doc = "! Connector values for a GPU. Used in NV_GSYNC_GPU."] +pub type _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR = ::std::os::raw::c_int; +#[doc = "! Connector values for a GPU. Used in NV_GSYNC_GPU."] +pub use self::_NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR as NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR; +pub const _NVAPI_GSYNC_DISPLAY_SYNC_STATE_NVAPI_GSYNC_DISPLAY_SYNC_STATE_UNSYNCED: + _NVAPI_GSYNC_DISPLAY_SYNC_STATE = 0; +pub const _NVAPI_GSYNC_DISPLAY_SYNC_STATE_NVAPI_GSYNC_DISPLAY_SYNC_STATE_SLAVE: + _NVAPI_GSYNC_DISPLAY_SYNC_STATE = 1; +pub const _NVAPI_GSYNC_DISPLAY_SYNC_STATE_NVAPI_GSYNC_DISPLAY_SYNC_STATE_MASTER: + _NVAPI_GSYNC_DISPLAY_SYNC_STATE = 2; +#[doc = "! Display sync states. Used in NV_GSYNC_DISPLAY."] +pub type _NVAPI_GSYNC_DISPLAY_SYNC_STATE = ::std::os::raw::c_int; +#[doc = "! Display sync states. Used in NV_GSYNC_DISPLAY."] +pub use self::_NVAPI_GSYNC_DISPLAY_SYNC_STATE as NVAPI_GSYNC_DISPLAY_SYNC_STATE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GSYNC_GPU { + #[doc = "!< Version of the structure"] + pub version: NvU32, + #[doc = "!< GPU handle"] + pub hPhysicalGpu: NvPhysicalGpuHandle, + #[doc = "!< Indicates which connector on the device the GPU is connected to."] + pub connector: NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR, + #[doc = "!< GPU through which hPhysicalGpu is connected to the Sync device (if not directly connected)\n!< - this is NULL otherwise"] + pub hProxyPhysicalGpu: NvPhysicalGpuHandle, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + pub __bindgen_padding_0: u32, +} +impl _NV_GSYNC_GPU { + #[inline] + pub fn isSynced(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isSynced(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isSynced_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isSynced_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1(isSynced: NvU32, reserved: NvU32) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isSynced: u32 = unsafe { ::std::mem::transmute(isSynced) }; + isSynced as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_GSYNC_GPU = _NV_GSYNC_GPU; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GSYNC_DISPLAY { + #[doc = "!< Version of the structure"] + pub version: NvU32, + #[doc = "!< display identifier for displays.The GPU to which it is connected, can be retireved from NvAPI_SYS_GetPhysicalGpuFromDisplayId"] + pub displayId: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Is this display slave/master\n!< (Retrieved with topology or set by caller for enable/disable sync)"] + pub syncState: NVAPI_GSYNC_DISPLAY_SYNC_STATE, +} +impl _NV_GSYNC_DISPLAY { + #[inline] + pub fn isMasterable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_isMasterable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn isMasterable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_isMasterable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + isMasterable: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let isMasterable: u32 = unsafe { ::std::mem::transmute(isMasterable) }; + isMasterable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_GSYNC_DISPLAY = _NV_GSYNC_DISPLAY; +pub const _NVAPI_GSYNC_POLARITY_NVAPI_GSYNC_POLARITY_RISING_EDGE: _NVAPI_GSYNC_POLARITY = 0; +pub const _NVAPI_GSYNC_POLARITY_NVAPI_GSYNC_POLARITY_FALLING_EDGE: _NVAPI_GSYNC_POLARITY = 1; +pub const _NVAPI_GSYNC_POLARITY_NVAPI_GSYNC_POLARITY_BOTH_EDGES: _NVAPI_GSYNC_POLARITY = 2; +#[doc = "! Source signal edge to be used for output pulse. See NV_GSYNC_CONTROL_PARAMS."] +pub type _NVAPI_GSYNC_POLARITY = ::std::os::raw::c_int; +#[doc = "! Source signal edge to be used for output pulse. See NV_GSYNC_CONTROL_PARAMS."] +pub use self::_NVAPI_GSYNC_POLARITY as NVAPI_GSYNC_POLARITY; +pub const _NVAPI_GSYNC_VIDEO_MODE_NVAPI_GSYNC_VIDEO_MODE_NONE: _NVAPI_GSYNC_VIDEO_MODE = 0; +pub const _NVAPI_GSYNC_VIDEO_MODE_NVAPI_GSYNC_VIDEO_MODE_TTL: _NVAPI_GSYNC_VIDEO_MODE = 1; +pub const _NVAPI_GSYNC_VIDEO_MODE_NVAPI_GSYNC_VIDEO_MODE_NTSCPALSECAM: _NVAPI_GSYNC_VIDEO_MODE = 2; +pub const _NVAPI_GSYNC_VIDEO_MODE_NVAPI_GSYNC_VIDEO_MODE_HDTV: _NVAPI_GSYNC_VIDEO_MODE = 3; +pub const _NVAPI_GSYNC_VIDEO_MODE_NVAPI_GSYNC_VIDEO_MODE_COMPOSITE: _NVAPI_GSYNC_VIDEO_MODE = 4; +#[doc = "! Used in NV_GSYNC_CONTROL_PARAMS."] +pub type _NVAPI_GSYNC_VIDEO_MODE = ::std::os::raw::c_int; +#[doc = "! Used in NV_GSYNC_CONTROL_PARAMS."] +pub use self::_NVAPI_GSYNC_VIDEO_MODE as NVAPI_GSYNC_VIDEO_MODE; +pub const _NVAPI_GSYNC_SYNC_SOURCE_NVAPI_GSYNC_SYNC_SOURCE_VSYNC: _NVAPI_GSYNC_SYNC_SOURCE = 0; +pub const _NVAPI_GSYNC_SYNC_SOURCE_NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC: _NVAPI_GSYNC_SYNC_SOURCE = 1; +#[doc = "! Used in NV_GSYNC_CONTROL_PARAMS."] +pub type _NVAPI_GSYNC_SYNC_SOURCE = ::std::os::raw::c_int; +#[doc = "! Used in NV_GSYNC_CONTROL_PARAMS."] +pub use self::_NVAPI_GSYNC_SYNC_SOURCE as NVAPI_GSYNC_SYNC_SOURCE; +#[doc = "! Used in NV_GSYNC_CONTROL_PARAMS."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GSYNC_DELAY { + #[doc = "!< Version of the structure"] + pub version: NvU32, + #[doc = "!< delay to be induced in number of horizontal lines."] + pub numLines: NvU32, + #[doc = "!< delay to be induced in number of pixels."] + pub numPixels: NvU32, + #[doc = "!< maximum number of lines supported at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only."] + pub maxLines: NvU32, + #[doc = "!< minimum number of pixels required at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only."] + pub minPixels: NvU32, +} +#[doc = "! Used in NV_GSYNC_CONTROL_PARAMS."] +pub type NV_GSYNC_DELAY = _NV_GSYNC_DELAY; +#[doc = "! Used in NvAPI_GSync_GetControlParameters() and NvAPI_GSync_SetControlParameters()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GSYNC_CONTROL_PARAMS_V1 { + #[doc = "!< Version of the structure"] + pub version: NvU32, + #[doc = "!< Leading edge / Falling edge / both"] + pub polarity: NVAPI_GSYNC_POLARITY, + #[doc = "!< None, TTL, NTSCPALSECAM, HDTV"] + pub vmode: NVAPI_GSYNC_VIDEO_MODE, + #[doc = "!< Number of pulses to wait between framelock signal generation"] + pub interval: NvU32, + #[doc = "!< VSync/House sync"] + pub source: NVAPI_GSYNC_SYNC_SOURCE, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< The time delay between the frame sync signal and the GPUs signal."] + pub syncSkew: NV_GSYNC_DELAY, + #[doc = "!< Sync start delay for master."] + pub startupDelay: NV_GSYNC_DELAY, +} +impl _NV_GSYNC_CONTROL_PARAMS_V1 { + #[inline] + pub fn interlaceMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_interlaceMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn interlaceMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_interlaceMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn syncSourceIsOutput(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_syncSourceIsOutput(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn syncSourceIsOutput_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_syncSourceIsOutput_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 30u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 30u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + interlaceMode: NvU32, + syncSourceIsOutput: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let interlaceMode: u32 = unsafe { ::std::mem::transmute(interlaceMode) }; + interlaceMode as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let syncSourceIsOutput: u32 = unsafe { ::std::mem::transmute(syncSourceIsOutput) }; + syncSourceIsOutput as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! Used in NvAPI_GSync_GetControlParameters() and NvAPI_GSync_SetControlParameters()."] +pub type NV_GSYNC_CONTROL_PARAMS_V1 = _NV_GSYNC_CONTROL_PARAMS_V1; +pub const _NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE_NVAPI_GSYNC_UNDEFINED_MODE: + _NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE = 0; +pub const _NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE_NVAPI_GSYNC_MULTIPLY_MODE: + _NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE = 1; +pub const _NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE_NVAPI_GSYNC_DIVIDE_MODE: + _NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE = 2; +#[doc = "! Used in NV_GSYNC_CONTROL_PARAMS."] +pub type _NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE = ::std::os::raw::c_int; +#[doc = "! Used in NV_GSYNC_CONTROL_PARAMS."] +pub use self::_NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE as NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GSYNC_CONTROL_PARAMS_V2 { + #[doc = "!< Version of the structure"] + pub version: NvU32, + #[doc = "!< Leading edge / Falling edge / both"] + pub polarity: NVAPI_GSYNC_POLARITY, + #[doc = "!< None, TTL, NTSCPALSECAM, HDTV"] + pub vmode: NVAPI_GSYNC_VIDEO_MODE, + #[doc = "!< Number of pulses to wait between framelock signal generation"] + pub interval: NvU32, + #[doc = "!< VSync/House sync"] + pub source: NVAPI_GSYNC_SYNC_SOURCE, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< The time delay between the frame sync signal and the GPUs signal."] + pub syncSkew: NV_GSYNC_DELAY, + #[doc = "!< Sync start delay for master."] + pub startupDelay: NV_GSYNC_DELAY, + #[doc = "!< Indicates multiplier/divider mode for the housesync signal.\n!< While setting multiplyDivideMode, source needs to be set as NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC."] + pub multiplyDivideMode: NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE, + #[doc = "!< Indicates the multiplier/divider value for the housesync signal. Only supported if bIsMulDivSupported field of the structure NV_GSYNC_CAPABILITIES is set to 1.\n!< The maximum supported value for this field can be obtained from maxMulDivValue field of the structure NV_GSYNC_CAPABILITIES."] + pub multiplyDivideValue: NvU8, +} +impl _NV_GSYNC_CONTROL_PARAMS_V2 { + #[inline] + pub fn interlaceMode(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_interlaceMode(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn interlaceMode_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_interlaceMode_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn syncSourceIsOutput(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_syncSourceIsOutput(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn syncSourceIsOutput_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_syncSourceIsOutput_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 30u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 30u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + interlaceMode: NvU32, + syncSourceIsOutput: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let interlaceMode: u32 = unsafe { ::std::mem::transmute(interlaceMode) }; + interlaceMode as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let syncSourceIsOutput: u32 = unsafe { ::std::mem::transmute(syncSourceIsOutput) }; + syncSourceIsOutput as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_GSYNC_CONTROL_PARAMS_V2 = _NV_GSYNC_CONTROL_PARAMS_V2; +pub type NV_GSYNC_CONTROL_PARAMS = NV_GSYNC_CONTROL_PARAMS_V2; +#[doc = "! Used in NvAPI_GSync_GetSyncStatus()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GSYNC_STATUS { + #[doc = "!< Version of the structure"] + pub version: NvU32, + #[doc = "!< Is timing in sync?"] + pub bIsSynced: NvU32, + #[doc = "!< Does the phase of the timing signal from the GPU = the phase of the master sync signal?"] + pub bIsStereoSynced: NvU32, + #[doc = "!< Is the sync signal available?"] + pub bIsSyncSignalAvailable: NvU32, +} +#[doc = "! Used in NvAPI_GSync_GetSyncStatus()."] +pub type NV_GSYNC_STATUS = _NV_GSYNC_STATUS; +pub const _NVAPI_GSYNC_RJ45_IO_NVAPI_GSYNC_RJ45_OUTPUT: _NVAPI_GSYNC_RJ45_IO = 0; +pub const _NVAPI_GSYNC_RJ45_IO_NVAPI_GSYNC_RJ45_INPUT: _NVAPI_GSYNC_RJ45_IO = 1; +#[doc = "!< This field is used to notify that the framelock is not actually present."] +pub const _NVAPI_GSYNC_RJ45_IO_NVAPI_GSYNC_RJ45_UNUSED: _NVAPI_GSYNC_RJ45_IO = 2; +#[doc = "! Used in NV_GSYNC_STATUS_PARAMS."] +pub type _NVAPI_GSYNC_RJ45_IO = ::std::os::raw::c_int; +#[doc = "! Used in NV_GSYNC_STATUS_PARAMS."] +pub use self::_NVAPI_GSYNC_RJ45_IO as NVAPI_GSYNC_RJ45_IO; +#[doc = "! \\ingroup gsyncapi\n! Used in NvAPI_GSync_GetStatusParameters()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GSYNC_STATUS_PARAMS_V1 { + pub version: NvU32, + #[doc = "!< The refresh rate"] + pub refreshRate: NvU32, + #[doc = "!< Configured as input / output"] + pub RJ45_IO: [NVAPI_GSYNC_RJ45_IO; 2usize], + #[doc = "!< Connected to ethernet hub? [ERRONEOUSLY CONNECTED!]"] + pub RJ45_Ethernet: [NvU32; 2usize], + #[doc = "!< Incoming house sync frequency in Hz"] + pub houseSyncIncoming: NvU32, + #[doc = "!< Is house sync connected?"] + pub bHouseSync: NvU32, +} +#[doc = "! \\ingroup gsyncapi\n! Used in NvAPI_GSync_GetStatusParameters()."] +pub type NV_GSYNC_STATUS_PARAMS_V1 = _NV_GSYNC_STATUS_PARAMS_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GSYNC_STATUS_PARAMS_V2 { + pub version: NvU32, + #[doc = "!< The refresh rate"] + pub refreshRate: NvU32, + #[doc = "!< Configured as input / output"] + pub RJ45_IO: [NVAPI_GSYNC_RJ45_IO; 2usize], + #[doc = "!< Connected to ethernet hub? [ERRONEOUSLY CONNECTED!]"] + pub RJ45_Ethernet: [NvU32; 2usize], + #[doc = "!< Incoming house sync frequency in Hz"] + pub houseSyncIncoming: NvU32, + #[doc = "!< Is house sync connected?"] + pub bHouseSync: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl _NV_GSYNC_STATUS_PARAMS_V2 { + #[inline] + pub fn bInternalSlave(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bInternalSlave(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bInternalSlave_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bInternalSlave_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bInternalSlave: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bInternalSlave: u32 = unsafe { ::std::mem::transmute(bInternalSlave) }; + bInternalSlave as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_GSYNC_STATUS_PARAMS_V2 = _NV_GSYNC_STATUS_PARAMS_V2; +pub type NV_GSYNC_STATUS_PARAMS = NV_GSYNC_STATUS_PARAMS_V2; +pub const _NV_RESOLVE_MODE_NV_RESOLVE_MODE_SAMPLE_0: _NV_RESOLVE_MODE = 0; +#[doc = "! \\ingroup dx\n! Valid modes for NvAPI_D3D11_ResolveSubresourceRegion() and NvAPI_D3D12_ResolveSubresourceRegion"] +pub type _NV_RESOLVE_MODE = ::std::os::raw::c_int; +#[doc = "! \\ingroup dx\n! Valid modes for NvAPI_D3D11_ResolveSubresourceRegion() and NvAPI_D3D12_ResolveSubresourceRegion"] +pub use self::_NV_RESOLVE_MODE as NV_RESOLVE_MODE; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to query the support of Single Pass Stereo HW feature\n! \\ingroup dx"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1 { + pub version: NvU32, + pub bSinglePassStereoSupported: NvU32, +} +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to query the support of Single Pass Stereo HW feature\n! \\ingroup dx"] +pub type NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1 = + _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2 { + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2 { + #[inline] + pub fn bSinglePassStereoSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bSinglePassStereoSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bSinglePassStereoSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bSinglePassStereoSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bSinglePassStereoXYZWSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_bSinglePassStereoXYZWSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bSinglePassStereoXYZWSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bSinglePassStereoXYZWSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 30u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 30u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bSinglePassStereoSupported: NvU32, + bSinglePassStereoXYZWSupported: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bSinglePassStereoSupported: u32 = + unsafe { ::std::mem::transmute(bSinglePassStereoSupported) }; + bSinglePassStereoSupported as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let bSinglePassStereoXYZWSupported: u32 = + unsafe { ::std::mem::transmute(bSinglePassStereoXYZWSupported) }; + bSinglePassStereoXYZWSupported as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2 = + _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2; +pub type NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS = NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to query the support of MultiView HW feature\n! \\ingroup dx"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1 { + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl _NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1 { + #[inline] + pub fn bMultiViewSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bMultiViewSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bMultiViewSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bMultiViewSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bSinglePassStereoSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_bSinglePassStereoSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bSinglePassStereoSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bSinglePassStereoSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bSinglePassStereoXYZWSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_bSinglePassStereoXYZWSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bSinglePassStereoXYZWSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bSinglePassStereoXYZWSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 29u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 29u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 29u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 29u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bMultiViewSupported: NvU32, + bSinglePassStereoSupported: NvU32, + bSinglePassStereoXYZWSupported: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bMultiViewSupported: u32 = unsafe { ::std::mem::transmute(bMultiViewSupported) }; + bMultiViewSupported as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let bSinglePassStereoSupported: u32 = + unsafe { ::std::mem::transmute(bSinglePassStereoSupported) }; + bSinglePassStereoSupported as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let bSinglePassStereoXYZWSupported: u32 = + unsafe { ::std::mem::transmute(bSinglePassStereoXYZWSupported) }; + bSinglePassStereoXYZWSupported as u64 + }); + __bindgen_bitfield_unit.set(3usize, 29u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to query the support of MultiView HW feature\n! \\ingroup dx"] +pub type NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1 = _NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to query the support of MultiView HW feature\n! \\ingroup dx"] +pub type NV_QUERY_MULTIVIEW_SUPPORT_PARAMS = NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used for setting the Mode for MultiView HW Feature.\n! \\ingroup dx"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MULTIVIEW_PARAMS_V1 { + pub version: NvU32, + pub numViews: NvU32, + pub renderTargetIndexOffset: [NvU32; 4usize], + pub independentViewportMaskEnable: NvU8, +} +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used for setting the Mode for MultiView HW Feature.\n! \\ingroup dx"] +pub type NV_MULTIVIEW_PARAMS_V1 = _NV_MULTIVIEW_PARAMS_V1; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used for setting the Mode for MultiView HW Feature.\n! \\ingroup dx"] +pub type NV_MULTIVIEW_PARAMS = NV_MULTIVIEW_PARAMS_V1; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to query the support of Lens Matched Shading HW feature\n! \\ingroup dx"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_QUERY_MODIFIED_W_SUPPORT_PARAMS { + pub version: NvU32, + pub bModifiedWSupported: NvU32, +} +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to query the support of Lens Matched Shading HW feature\n! \\ingroup dx"] +pub type NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1 = _NV_QUERY_MODIFIED_W_SUPPORT_PARAMS; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to query the support of Lens Matched Shading HW feature\n! \\ingroup dx"] +pub type NV_QUERY_MODIFIED_W_SUPPORT_PARAMS = NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MODIFIED_W_COEFFICIENTS { + pub fA: f32, + pub fB: f32, + pub fAReserved: f32, + pub fBReserved: f32, + pub fReserved: [f32; 2usize], +} +pub type NV_MODIFIED_W_COEFFICIENTS = _NV_MODIFIED_W_COEFFICIENTS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_MODIFIED_W_PARAMS { + pub version: NvU32, + pub numEntries: NvU32, + pub modifiedWCoefficients: [NV_MODIFIED_W_COEFFICIENTS; 16usize], + pub id: NvU32, + pub reserved: [NvU32; 16usize], +} +pub type NV_MODIFIED_W_PARAMS_V1 = _NV_MODIFIED_W_PARAMS; +pub type NV_MODIFIED_W_PARAMS = NV_MODIFIED_W_PARAMS_V1; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to get sleep status\n! \\ingroup dx"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GET_SLEEP_STATUS_PARAMS { + #[doc = "!< (IN) Structure version"] + pub version: NvU32, + #[doc = "!< (OUT) Is low latency mode enabled?"] + pub bLowLatencyMode: NvBool, + #[doc = "!< (OUT) Is fullscreen VRR enabled?"] + pub bFsVrr: NvBool, + #[doc = "!< (OUT) Is Control Panel overriding VSYNC ON?"] + pub bCplVsyncOn: NvBool, + #[doc = "!< (OUT) Latest sleep interval in microseconds."] + pub sleepIntervalUs: NvU32, + #[doc = "!< (OUT) Is NvAPI_D3D_Sleep() being called?"] + pub bUseGameSleep: NvBool, + #[doc = "!< (OUT) Is in fullscreen/iFlip mode?"] + pub bFullscreenIFlip: NvBool, + #[doc = "!< (OUT) Latest Frame Generation multiplier used."] + pub fgMultiplier: NvU8, + #[doc = "!< (IN) Reserved. Must be set to 0s."] + pub rsvd: [NvU8; 119usize], +} +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to get sleep status\n! \\ingroup dx"] +pub type NV_GET_SLEEP_STATUS_PARAMS_V1 = _NV_GET_SLEEP_STATUS_PARAMS; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to get sleep status\n! \\ingroup dx"] +pub type NV_GET_SLEEP_STATUS_PARAMS = NV_GET_SLEEP_STATUS_PARAMS_V1; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to set sleep mode\n! \\ingroup dx"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_SET_SLEEP_MODE_PARAMS { + #[doc = "!< (IN) Structure version"] + pub version: NvU32, + #[doc = "!< (IN) Low latency mode enable/disable."] + pub bLowLatencyMode: NvBool, + #[doc = "!< (IN) Request maximum GPU clock frequency regardless of workload."] + pub bLowLatencyBoost: NvBool, + #[doc = "!< (IN) Minimum frame interval in microseconds. 0 = no frame rate limit."] + pub minimumIntervalUs: NvU32, + #[doc = "!< (IN) Allow latency markers to be used for runtime optimizations."] + pub bUseMarkersToOptimize: NvBool, + #[doc = "!< (IN) Consider all submission overlaps (both in between frames and within each frame)."] + pub bUseMinQueueTime: NvBool, + #[doc = "!< (IN) Reserved. Must be set to 0s."] + pub rsvd: [NvU8; 30usize], +} +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to set sleep mode\n! \\ingroup dx"] +pub type NV_SET_SLEEP_MODE_PARAMS_V1 = _NV_SET_SLEEP_MODE_PARAMS; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to set sleep mode\n! \\ingroup dx"] +pub type NV_SET_SLEEP_MODE_PARAMS = NV_SET_SLEEP_MODE_PARAMS_V1; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to send Reflex Sync data to UMD\n! \\ingroup dx"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_SET_REFLEX_SYNC_PARAMS { + #[doc = "!< (IN) Structure version"] + pub version: NvU32, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< (IN) Interval between VBLANKs in microseconds. (0 means N/A)"] + pub vblankIntervalUs: NvU32, + #[doc = "!< (IN) Amount of time in the completed frame queue. Can be negative. (0 means N/A)"] + pub timeInQueueUs: NvS32, + #[doc = "!< (IN) Target amount of time in the completed frame queue. (0 means N/A)"] + pub timeInQueueUsTarget: NvU32, + #[doc = "!< (IN) Specify the frame generation multipler to use. (0 means driver should auto-detect)"] + pub fgMultiplier: NvU8, + #[doc = "!< (IN) Reserved. Must be set to 0s."] + pub rsvd: [NvU8; 27usize], +} +impl _NV_SET_REFLEX_SYNC_PARAMS { + #[inline] + pub fn bEnable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bEnable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bEnable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bEnable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bDisable(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_bDisable(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bDisable_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bDisable_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn flagsRsvd(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_flagsRsvd(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub unsafe fn flagsRsvd_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 30u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_flagsRsvd_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 30u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bEnable: NvU32, + bDisable: NvU32, + flagsRsvd: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bEnable: u32 = unsafe { ::std::mem::transmute(bEnable) }; + bEnable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let bDisable: u32 = unsafe { ::std::mem::transmute(bDisable) }; + bDisable as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let flagsRsvd: u32 = unsafe { ::std::mem::transmute(flagsRsvd) }; + flagsRsvd as u64 + }); + __bindgen_bitfield_unit + } +} +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to send Reflex Sync data to UMD\n! \\ingroup dx"] +pub type NV_SET_REFLEX_SYNC_PARAMS_V1 = _NV_SET_REFLEX_SYNC_PARAMS; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to send Reflex Sync data to UMD\n! \\ingroup dx"] +pub type NV_SET_REFLEX_SYNC_PARAMS = NV_SET_REFLEX_SYNC_PARAMS_V1; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to get latency report.\n! \\ingroup dx"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LATENCY_RESULT_PARAMS { + #[doc = "!< (IN) Structure version"] + pub version: NvU32, + pub frameReport: [_NV_LATENCY_RESULT_PARAMS_FrameReport; 64usize], + pub rsvd: [NvU8; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LATENCY_RESULT_PARAMS_FrameReport { + #[doc = "!< (OUT)"] + pub frameID: NvU64, + #[doc = "!< (OUT)"] + pub inputSampleTime: NvU64, + #[doc = "!< (OUT)"] + pub simStartTime: NvU64, + #[doc = "!< (OUT)"] + pub simEndTime: NvU64, + #[doc = "!< (OUT)"] + pub renderSubmitStartTime: NvU64, + #[doc = "!< (OUT)"] + pub renderSubmitEndTime: NvU64, + #[doc = "!< (OUT)"] + pub presentStartTime: NvU64, + #[doc = "!< (OUT)"] + pub presentEndTime: NvU64, + #[doc = "!< (OUT)"] + pub driverStartTime: NvU64, + #[doc = "!< (OUT)"] + pub driverEndTime: NvU64, + #[doc = "!< (OUT)"] + pub osRenderQueueStartTime: NvU64, + #[doc = "!< (OUT)"] + pub osRenderQueueEndTime: NvU64, + #[doc = "!< (OUT)"] + pub gpuRenderStartTime: NvU64, + #[doc = "!< (OUT)"] + pub gpuRenderEndTime: NvU64, + #[doc = "!< (OUT) Difference between gpuRenderStartTime and gpuRenderEndTime, excluding the idles in between, in microseconds."] + pub gpuActiveRenderTimeUs: NvU32, + #[doc = "!< (OUT) Difference between previous and current frame's gpuRenderEndTime, in microseconds."] + pub gpuFrameTimeUs: NvU32, + #[doc = "!< (OUT)"] + pub cameraConstructedTime: NvU64, + #[doc = "!< (OUT) Cross adapter copy time in microseconds."] + pub crossAdapterCopyTimeUs: NvU32, + #[doc = "!< (OUT) Frame generation time in microseconds."] + pub aiFrameTimeUs: NvU32, + pub rsvd: [NvU8; 104usize], +} +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to get latency report.\n! \\ingroup dx"] +pub type NV_LATENCY_RESULT_PARAMS_V1 = _NV_LATENCY_RESULT_PARAMS; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used to get latency report.\n! \\ingroup dx"] +pub type NV_LATENCY_RESULT_PARAMS = NV_LATENCY_RESULT_PARAMS_V1; +pub const NV_LATENCY_MARKER_TYPE_SIMULATION_START: NV_LATENCY_MARKER_TYPE = 0; +pub const NV_LATENCY_MARKER_TYPE_SIMULATION_END: NV_LATENCY_MARKER_TYPE = 1; +pub const NV_LATENCY_MARKER_TYPE_RENDERSUBMIT_START: NV_LATENCY_MARKER_TYPE = 2; +pub const NV_LATENCY_MARKER_TYPE_RENDERSUBMIT_END: NV_LATENCY_MARKER_TYPE = 3; +pub const NV_LATENCY_MARKER_TYPE_PRESENT_START: NV_LATENCY_MARKER_TYPE = 4; +pub const NV_LATENCY_MARKER_TYPE_PRESENT_END: NV_LATENCY_MARKER_TYPE = 5; +pub const NV_LATENCY_MARKER_TYPE_INPUT_SAMPLE: NV_LATENCY_MARKER_TYPE = 6; +pub const NV_LATENCY_MARKER_TYPE_TRIGGER_FLASH: NV_LATENCY_MARKER_TYPE = 7; +pub const NV_LATENCY_MARKER_TYPE_PC_LATENCY_PING: NV_LATENCY_MARKER_TYPE = 8; +pub const NV_LATENCY_MARKER_TYPE_OUT_OF_BAND_RENDERSUBMIT_START: NV_LATENCY_MARKER_TYPE = 9; +pub const NV_LATENCY_MARKER_TYPE_OUT_OF_BAND_RENDERSUBMIT_END: NV_LATENCY_MARKER_TYPE = 10; +pub const NV_LATENCY_MARKER_TYPE_OUT_OF_BAND_PRESENT_START: NV_LATENCY_MARKER_TYPE = 11; +pub const NV_LATENCY_MARKER_TYPE_OUT_OF_BAND_PRESENT_END: NV_LATENCY_MARKER_TYPE = 12; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used define latency marker type\n! \\ingroup dx"] +pub type NV_LATENCY_MARKER_TYPE = ::std::os::raw::c_int; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used set latency markers\n! \\ingroup dx"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LATENCY_MARKER_PARAMS { + #[doc = "!< (IN) Structure version"] + pub version: NvU32, + pub frameID: NvU64, + pub markerType: NV_LATENCY_MARKER_TYPE, + pub rsvd0: NvU64, + pub rsvd: [NvU8; 56usize], +} +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used set latency markers\n! \\ingroup dx"] +pub type NV_LATENCY_MARKER_PARAMS_V1 = _NV_LATENCY_MARKER_PARAMS; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used set latency markers\n! \\ingroup dx"] +pub type NV_LATENCY_MARKER_PARAMS = NV_LATENCY_MARKER_PARAMS_V1; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used in NvAPI_D3D12_SetAsyncFrameMarker and NvAPI_D3D11_SetAsyncFrameMarker\n! \\ingroup dx"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_ASYNC_FRAME_MARKER_PARAMS_V1 { + #[doc = "!< (IN) Structure version"] + pub version: NvU32, + pub frameID: NvU64, + pub markerType: NV_LATENCY_MARKER_TYPE, + pub presentFrameID: NvU64, + pub vendorInternal: NvBool, + pub rsvd: [NvU8; 55usize], +} +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used in NvAPI_D3D12_SetAsyncFrameMarker and NvAPI_D3D11_SetAsyncFrameMarker\n! \\ingroup dx"] +pub type NV_ASYNC_FRAME_MARKER_PARAMS_V1 = _NV_ASYNC_FRAME_MARKER_PARAMS_V1; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used in NvAPI_D3D12_SetAsyncFrameMarker and NvAPI_D3D11_SetAsyncFrameMarker\n! \\ingroup dx"] +pub type NV_ASYNC_FRAME_MARKER_PARAMS = NV_ASYNC_FRAME_MARKER_PARAMS_V1; +pub const NV_OUT_OF_BAND_CQ_TYPE_OUT_OF_BAND_RENDER: NV_OUT_OF_BAND_CQ_TYPE = 0; +pub const NV_OUT_OF_BAND_CQ_TYPE_OUT_OF_BAND_PRESENT: NV_OUT_OF_BAND_CQ_TYPE = 1; +pub const NV_OUT_OF_BAND_CQ_TYPE_OUT_OF_BAND_IGNORE: NV_OUT_OF_BAND_CQ_TYPE = 2; +pub const NV_OUT_OF_BAND_CQ_TYPE_OUT_OF_BAND_RENDER_PRESENT: NV_OUT_OF_BAND_CQ_TYPE = 3; +#[doc = "! SUPPORTED OS: Windows 10 and higher\n!\n! Used in NvAPI_D3D12_NotifyOutOfBandCommandQueue\n! \\ingroup dx"] +pub type NV_OUT_OF_BAND_CQ_TYPE = ::std::os::raw::c_int; +pub const _NV_D3D12_WORKSTATION_FEATURE_TYPE_NV_D3D12_WORKSTATION_FEATURE_TYPE_PRESENT_BARRIER: + _NV_D3D12_WORKSTATION_FEATURE_TYPE = 1; +pub const _NV_D3D12_WORKSTATION_FEATURE_TYPE_NV_D3D12_WORKSTATION_FEATURE_TYPE_RDMA_BAR1_SUPPORT: + _NV_D3D12_WORKSTATION_FEATURE_TYPE = 2; +#[doc = "! \\ingroup DX"] +pub type _NV_D3D12_WORKSTATION_FEATURE_TYPE = ::std::os::raw::c_int; +#[doc = "! \\ingroup DX"] +pub use self::_NV_D3D12_WORKSTATION_FEATURE_TYPE as NV_D3D12_WORKSTATION_FEATURE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_D3D12_WORKSTATION_FEATURE_RDMA_PROPERTIES { + pub rdmaHeapSize: NvU64, +} +pub type NV_D3D12_WORKSTATION_FEATURE_RDMA_PROPERTIES = + _NV_D3D12_WORKSTATION_FEATURE_RDMA_PROPERTIES; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_INITIALIZED: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 1; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_ENABLED: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 2; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_DLL_EXISTS: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 4; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_DLL_LOADED: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 8; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_DLL_SELECTED: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 16; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_PRESET: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 32; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_PERF_MODE: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 64; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_SCALING_RATIO: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 128; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_OPTIMAL_SETTINGS: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 256; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_CREATED: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 512; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_EVALUATE: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 1024; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_FG_MODE: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 8192; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_SR_DLAA_MODE: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 16384; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_FG_MULTI_FRAME: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 32768; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_ERR_FAILED: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 65536; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_ERR_DENIED: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 131072; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_ERR_DRS: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 262144; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_ERR_NOT_FOUND: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 524288; +pub const NV_NGX_DLSS_OVERRIDE_BITFIELD_NV_NGX_DLSS_OVERRIDE_FLAG_ERR_DLL_LOAD: + NV_NGX_DLSS_OVERRIDE_BITFIELD = 1048576; +pub type NV_NGX_DLSS_OVERRIDE_BITFIELD = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_NGX_DLSS_OVERRIDE_GET_STATE_PARAMS_V1 { + #[doc = "!< [in] Structure version"] + pub version: NvU32, + #[doc = "!< [in] Process Identifier"] + pub processIdentifier: NvU32, + #[doc = "!< [out] Feedback bits for Super Resolution"] + pub feedbackMaskSR: NvU64, + #[doc = "!< [out] Feedback bits for Ray Reconstruction"] + pub feedbackMaskRR: NvU64, + #[doc = "!< [out] Feedback bits for Frame Generation"] + pub feedbackMaskFG: NvU64, + #[doc = "!< [out] Scaling Ratio"] + pub scalingRatio: NvF32, + #[doc = "!< [out] Performance Mode"] + pub performanceMode: NvU32, + #[doc = "!< [out] Render Preset for SR/RR"] + pub renderPreset: NvU32, + #[doc = "!< [out] FG Override Frame Count Target"] + pub frameGenerationCount: NvU32, + #[doc = "!< [out] Render Preset for FG"] + pub frameGenerationPreset: NvU32, + #[doc = "!< [out] Frame Generation Mode"] + pub frameGenerationMode: NvU32, + #[doc = "!< Reserved for future use. Must be zero."] + pub reserved: [NvU32; 2usize], +} +pub type NV_NGX_DLSS_OVERRIDE_GET_STATE_PARAMS_V1 = _NV_NGX_DLSS_OVERRIDE_GET_STATE_PARAMS_V1; +pub type NV_NGX_DLSS_OVERRIDE_GET_STATE_PARAMS = NV_NGX_DLSS_OVERRIDE_GET_STATE_PARAMS_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_NGX_DLSS_OVERRIDE_SET_STATE_PARAMS_V1 { + #[doc = "!< [in] Structure version"] + pub version: NvU32, + #[doc = "!< [in] Process identifier of caller"] + pub processIdentifier: NvU32, + #[doc = "!< [in] DLSS feature ID"] + pub feature: NvU32, + #[doc = "!< [in] Feedback bits for DLSS feature"] + pub feedbackMask: NvU64, + #[doc = "!< Reserved for future use. Must be zero."] + pub reserved: [NvU64; 4usize], +} +pub type NV_NGX_DLSS_OVERRIDE_SET_STATE_PARAMS_V1 = _NV_NGX_DLSS_OVERRIDE_SET_STATE_PARAMS_V1; +pub type NV_NGX_DLSS_OVERRIDE_SET_STATE_PARAMS = NV_NGX_DLSS_OVERRIDE_SET_STATE_PARAMS_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NVVIOTOPOLOGYTARGET { + #[doc = "!< Handle to Physical GPU (This could be NULL for GVI device if its not binded)"] + pub hPhysicalGpu: NvPhysicalGpuHandle, + #[doc = "!, +} +impl _NV_DISPLAY_DRIVER_INFO { + #[inline] + pub fn bIsDCHDriver(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsDCHDriver(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsDCHDriver_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsDCHDriver_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsNVIDIAStudioPackage(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsNVIDIAStudioPackage(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsNVIDIAStudioPackage_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsNVIDIAStudioPackage_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsNVIDIAGameReadyPackage(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsNVIDIAGameReadyPackage(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsNVIDIAGameReadyPackage_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsNVIDIAGameReadyPackage_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsNVIDIARTXProductionBranchPackage(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsNVIDIARTXProductionBranchPackage(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsNVIDIARTXProductionBranchPackage_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsNVIDIARTXProductionBranchPackage_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsNVIDIARTXNewFeatureBranchPackage(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsNVIDIARTXNewFeatureBranchPackage(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsNVIDIARTXNewFeatureBranchPackage_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsNVIDIARTXNewFeatureBranchPackage_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 27u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 27u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 27u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 27u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsDCHDriver: NvU32, + bIsNVIDIAStudioPackage: NvU32, + bIsNVIDIAGameReadyPackage: NvU32, + bIsNVIDIARTXProductionBranchPackage: NvU32, + bIsNVIDIARTXNewFeatureBranchPackage: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsDCHDriver: u32 = unsafe { ::std::mem::transmute(bIsDCHDriver) }; + bIsDCHDriver as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let bIsNVIDIAStudioPackage: u32 = + unsafe { ::std::mem::transmute(bIsNVIDIAStudioPackage) }; + bIsNVIDIAStudioPackage as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let bIsNVIDIAGameReadyPackage: u32 = + unsafe { ::std::mem::transmute(bIsNVIDIAGameReadyPackage) }; + bIsNVIDIAGameReadyPackage as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let bIsNVIDIARTXProductionBranchPackage: u32 = + unsafe { ::std::mem::transmute(bIsNVIDIARTXProductionBranchPackage) }; + bIsNVIDIARTXProductionBranchPackage as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let bIsNVIDIARTXNewFeatureBranchPackage: u32 = + unsafe { ::std::mem::transmute(bIsNVIDIARTXNewFeatureBranchPackage) }; + bIsNVIDIARTXNewFeatureBranchPackage as u64 + }); + __bindgen_bitfield_unit.set(5usize, 27u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_DISPLAY_DRIVER_INFO_V1 = _NV_DISPLAY_DRIVER_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_DISPLAY_DRIVER_INFO_V2 { + #[doc = "!< Structure Version."] + pub version: NvU32, + #[doc = "!< Contains the driver version after successful return."] + pub driverVersion: NvU32, + #[doc = "!< Contains the driver-branch string after successful return."] + pub szBuildBranch: NvAPI_ShortString, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< (OUT) Contains the driver base branch string after successful return."] + pub szBuildBaseBranch: NvAPI_ShortString, + #[doc = "!< Reserved for future use"] + pub reservedEx: NvU32, +} +impl _NV_DISPLAY_DRIVER_INFO_V2 { + #[inline] + pub fn bIsDCHDriver(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsDCHDriver(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsDCHDriver_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsDCHDriver_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsNVIDIAStudioPackage(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsNVIDIAStudioPackage(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsNVIDIAStudioPackage_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsNVIDIAStudioPackage_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsNVIDIAGameReadyPackage(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsNVIDIAGameReadyPackage(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsNVIDIAGameReadyPackage_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsNVIDIAGameReadyPackage_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsNVIDIARTXProductionBranchPackage(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsNVIDIARTXProductionBranchPackage(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsNVIDIARTXProductionBranchPackage_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsNVIDIARTXProductionBranchPackage_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn bIsNVIDIARTXNewFeatureBranchPackage(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_bIsNVIDIARTXNewFeatureBranchPackage(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bIsNVIDIARTXNewFeatureBranchPackage_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bIsNVIDIARTXNewFeatureBranchPackage_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 27u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 27u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 27u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 27u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bIsDCHDriver: NvU32, + bIsNVIDIAStudioPackage: NvU32, + bIsNVIDIAGameReadyPackage: NvU32, + bIsNVIDIARTXProductionBranchPackage: NvU32, + bIsNVIDIARTXNewFeatureBranchPackage: NvU32, + reserved: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bIsDCHDriver: u32 = unsafe { ::std::mem::transmute(bIsDCHDriver) }; + bIsDCHDriver as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let bIsNVIDIAStudioPackage: u32 = + unsafe { ::std::mem::transmute(bIsNVIDIAStudioPackage) }; + bIsNVIDIAStudioPackage as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let bIsNVIDIAGameReadyPackage: u32 = + unsafe { ::std::mem::transmute(bIsNVIDIAGameReadyPackage) }; + bIsNVIDIAGameReadyPackage as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let bIsNVIDIARTXProductionBranchPackage: u32 = + unsafe { ::std::mem::transmute(bIsNVIDIARTXProductionBranchPackage) }; + bIsNVIDIARTXProductionBranchPackage as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let bIsNVIDIARTXNewFeatureBranchPackage: u32 = + unsafe { ::std::mem::transmute(bIsNVIDIARTXNewFeatureBranchPackage) }; + bIsNVIDIARTXNewFeatureBranchPackage as u64 + }); + __bindgen_bitfield_unit.set(5usize, 27u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_DISPLAY_DRIVER_INFO_V2 = _NV_DISPLAY_DRIVER_INFO_V2; +pub type NV_DISPLAY_DRIVER_INFO = NV_DISPLAY_DRIVER_INFO_V2; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_PHYSICAL_GPU_HANDLE_DATA { + pub hPhysicalGpu: NvPhysicalGpuHandle, + pub adapterType: NV_ADAPTER_TYPE, + pub reserved2: [NvU32; 4usize], +} +pub type NV_PHYSICAL_GPU_HANDLE_DATA = _NV_PHYSICAL_GPU_HANDLE_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_PHYSICAL_GPUS { + pub version: NvU32, + pub gpuHandleData: [NV_PHYSICAL_GPU_HANDLE_DATA; 64usize], + pub gpuHandleCount: NvU32, + pub reserved: [NvU32; 4usize], +} +pub type NV_PHYSICAL_GPUS_V1 = _NV_PHYSICAL_GPUS; +pub type NV_PHYSICAL_GPUS = NV_PHYSICAL_GPUS_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LOGICAL_GPU_HANDLE_DATA { + pub hLogicalGpu: NvLogicalGpuHandle, + pub adapterType: NV_ADAPTER_TYPE, + pub reserved: [NvU32; 4usize], +} +pub type NV_LOGICAL_GPU_HANDLE_DATA = _NV_LOGICAL_GPU_HANDLE_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_LOGICAL_GPUS { + pub version: NvU32, + pub gpuHandleData: [NV_LOGICAL_GPU_HANDLE_DATA; 64usize], + pub gpuHandleCount: NvU32, + pub reserved: [NvU32; 4usize], +} +pub type NV_LOGICAL_GPUS_V1 = _NV_LOGICAL_GPUS; +pub type NV_LOGICAL_GPUS = NV_LOGICAL_GPUS_V1; +pub const _NV_NGX_DRIVER_FEATURE_ID_NV_NGX_DRIVER_FEATURE_ID_SET_FLIP_CONFIG_V2: + _NV_NGX_DRIVER_FEATURE_ID = 3423695; +pub type _NV_NGX_DRIVER_FEATURE_ID = ::std::os::raw::c_int; +pub use self::_NV_NGX_DRIVER_FEATURE_ID as NV_NGX_DRIVER_FEATURE_ID; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_NGX_DRIVER_FEATURE_SUPPORT_INFO { + #[doc = "!< [IN] Feature ID to query"] + pub featureId: NV_NGX_DRIVER_FEATURE_ID, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + #[doc = "!< Reserved for future use"] + pub reserved2: [NvU32; 2usize], +} +impl _NV_NGX_DRIVER_FEATURE_SUPPORT_INFO { + #[inline] + pub fn bSupported(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_bSupported(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn bSupported_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_bSupported_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn reserved1(&self) -> NvU32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved1(&mut self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved1_raw(this: *const Self) -> NvU32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 31u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_reserved1_raw(this: *mut Self, val: NvU32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 31u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + bSupported: NvU32, + reserved1: NvU32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let bSupported: u32 = unsafe { ::std::mem::transmute(bSupported) }; + bSupported as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved1: u32 = unsafe { ::std::mem::transmute(reserved1) }; + reserved1 as u64 + }); + __bindgen_bitfield_unit + } +} +pub type NV_NGX_DRIVER_FEATURE_SUPPORT_INFO = _NV_NGX_DRIVER_FEATURE_SUPPORT_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_NGX_GET_DRIVER_FEATURE_SUPPORT_PARAMS_V1 { + #[doc = "!< [IN] Structure version"] + pub version: NvU32, + #[doc = "!< [IN] Number of features to query (must be <= NVAPI_MAX_NGX_FEATURES_PER_QUERY)"] + pub featureCount: NvU32, + #[doc = "!< [INOUT] Feature query array"] + pub featureSupportInfo: [NV_NGX_DRIVER_FEATURE_SUPPORT_INFO; 16usize], + #[doc = "!< Reserved for future use"] + pub reserved: [NvU32; 6usize], +} +pub type NV_NGX_GET_DRIVER_FEATURE_SUPPORT_PARAMS_V1 = _NV_NGX_GET_DRIVER_FEATURE_SUPPORT_PARAMS_V1; +pub type NV_NGX_GET_DRIVER_FEATURE_SUPPORT_PARAMS = NV_NGX_GET_DRIVER_FEATURE_SUPPORT_PARAMS_V1; +#[doc = " Callback settings common to all client callbacks."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1 { + #[doc = " [in] Generic callback parameter which will be passed to the callback."] + pub pCallbackParam: *mut ::std::os::raw::c_void, + #[doc = " Reserved bytes for future expansion."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Callback settings common to all client callbacks."] +pub type NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1 = _NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1; +#[doc = " Callback settings common to all client callbacks."] +pub type NV_GPU_CLIENT_CALLBACK_SETTINGS_SUPER_V1 = NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1; +#[doc = " Callback settings common to all periodic client callbacks."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_PERIODIC_CALLBACK_SETTINGS_SUPER_V1 { + #[doc = " [in] Super class data."] + pub super_: NV_GPU_CLIENT_CALLBACK_SETTINGS_SUPER_V1, + #[doc = " [in] Minimum interval at which callback will be called.\n\n The callback may be invoked slower than this interval if underlying\n sampling rate does not align precisely to the provided period."] + pub callbackPeriodms: NvU32, + #[doc = " Reserved bytes for future expansion."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Callback settings common to all periodic client callbacks."] +pub type NV_GPU_CLIENT_PERIODIC_CALLBACK_SETTINGS_SUPER_V1 = + _NV_GPU_CLIENT_PERIODIC_CALLBACK_SETTINGS_SUPER_V1; +#[doc = " Callback data common to all client callbacks."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_CALLBACK_DATA_SUPER_V1 { + #[doc = " [out] Generic callback parameter which was passed in at registration time."] + pub pCallbackParam: *mut ::std::os::raw::c_void, + #[doc = " Reserved bytes for future expansion."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Callback data common to all client callbacks."] +pub type NV_GPU_CLIENT_CALLBACK_DATA_SUPER_V1 = _NV_GPU_CLIENT_CALLBACK_DATA_SUPER_V1; +pub const _NV_GPU_CLIENT_UTIL_DOMAIN_ID_NV_GPU_CLIENT_UTIL_DOMAIN_GRAPHICS: + _NV_GPU_CLIENT_UTIL_DOMAIN_ID = 0; +pub const _NV_GPU_CLIENT_UTIL_DOMAIN_ID_NV_GPU_CLIENT_UTIL_DOMAIN_FRAME_BUFFER: + _NV_GPU_CLIENT_UTIL_DOMAIN_ID = 1; +pub const _NV_GPU_CLIENT_UTIL_DOMAIN_ID_NV_GPU_CLIENT_UTIL_DOMAIN_VIDEO: + _NV_GPU_CLIENT_UTIL_DOMAIN_ID = 2; +#[doc = " Reserved for future use."] +pub const _NV_GPU_CLIENT_UTIL_DOMAIN_ID_NV_GPU_CLIENT_UTIL_DOMAIN_RSVD: + _NV_GPU_CLIENT_UTIL_DOMAIN_ID = 3; +#[doc = " Enumeration of different utilization domains"] +pub type _NV_GPU_CLIENT_UTIL_DOMAIN_ID = ::std::os::raw::c_int; +#[doc = " Enumeration of different utilization domains"] +pub use self::_NV_GPU_CLIENT_UTIL_DOMAIN_ID as NV_GPU_CLIENT_UTIL_DOMAIN_ID; +#[doc = " Data specific to a single utilization domain."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_UTILIZATION_DATA_V1 { + #[doc = " [out] Utilization domain identifier."] + pub utilId: NV_GPU_CLIENT_UTIL_DOMAIN_ID, + #[doc = " [out] Percentage of time where the domain is considered busy since the\n last sample. Units of percent*100; i.e. 5000 = 50%."] + pub utilizationPercent: NvU32, + #[doc = " Reserved bytes for future expansion."] + pub rsvd: [NvU8; 61usize], +} +#[doc = " Data specific to a single utilization domain."] +pub type NV_GPU_CLIENT_UTILIZATION_DATA_V1 = _NV_GPU_CLIENT_UTILIZATION_DATA_V1; +#[doc = " Data passed back to callback registered with\n @ref NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_CALLBACK_UTILIZATION_DATA_V1 { + #[doc = " [out] Super struct."] + pub super_: NV_GPU_CLIENT_CALLBACK_DATA_SUPER_V1, + #[doc = " [out] Number of valid entries in `utils` array."] + pub numUtils: NvU32, + #[doc = " [out] Time at which data was collected. Represented as elapsed\n microseconds since 00:00:00 UTC on January 1, 1970."] + pub timestamp: NvU64, + #[doc = " Reserved bytes for future expansion."] + pub rsvd: [NvU8; 64usize], + #[doc = " [out] Status data for each utilization domain."] + pub utils: [NV_GPU_CLIENT_UTILIZATION_DATA_V1; 4usize], +} +#[doc = " Data passed back to callback registered with\n @ref NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates."] +pub type NV_GPU_CLIENT_CALLBACK_UTILIZATION_DATA_V1 = _NV_GPU_CLIENT_CALLBACK_UTILIZATION_DATA_V1; +#[doc = " Function prototype for a periodic utilization data callback that will be registered with NvAPI."] +pub type NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_V1 = ::std::option::Option< + unsafe extern "C" fn( + hPhysicalGpu: NvPhysicalGpuHandle, + pData: *mut NV_GPU_CLIENT_CALLBACK_UTILIZATION_DATA_V1, + ), +>; +#[doc = " Data required to register a periodic callback for utilization data."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1 { + #[doc = " [in] Structure Version, must always be first."] + pub version: NvU32, + #[doc = " [in] Generic callback settings. Some data within will be passed to the\n callback when invoked."] + pub super_: NV_GPU_CLIENT_PERIODIC_CALLBACK_SETTINGS_SUPER_V1, + #[doc = " [in] Callback. Pass in NULL or nullptr to indicate request to unregister."] + pub callback: NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_V1, + #[doc = " Reserved bytes for future expansion."] + pub rsvd: [NvU8; 64usize], +} +#[doc = " Data required to register a periodic callback for utilization data."] +pub type NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1 = + _NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1; +#[doc = " Data required to register a periodic callback for utilization data."] +pub type NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS = + NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1; +pub const _NV_RISE_CONTENT_TYPE_NV_RISE_CONTENT_TYPE_INVALID: _NV_RISE_CONTENT_TYPE = 0; +pub const _NV_RISE_CONTENT_TYPE_NV_RISE_CONTENT_TYPE_TEXT: _NV_RISE_CONTENT_TYPE = 1; +pub const _NV_RISE_CONTENT_TYPE_NV_RISE_CONTENT_TYPE_GRAPH: _NV_RISE_CONTENT_TYPE = 2; +pub const _NV_RISE_CONTENT_TYPE_NV_RISE_CONTENT_TYPE_CUSTOM_BEHAVIOR: _NV_RISE_CONTENT_TYPE = 3; +pub const _NV_RISE_CONTENT_TYPE_NV_RISE_CONTENT_TYPE_CUSTOM_BEHAVIOR_RESULT: _NV_RISE_CONTENT_TYPE = + 4; +pub const _NV_RISE_CONTENT_TYPE_NV_RISE_CONTENT_TYPE_INSTALLING: _NV_RISE_CONTENT_TYPE = 5; +pub const _NV_RISE_CONTENT_TYPE_NV_RISE_CONTENT_TYPE_PROGRESS_UPDATE: _NV_RISE_CONTENT_TYPE = 6; +pub const _NV_RISE_CONTENT_TYPE_NV_RISE_CONTENT_TYPE_READY: _NV_RISE_CONTENT_TYPE = 7; +pub const _NV_RISE_CONTENT_TYPE_NV_RISE_CONTENT_TYPE_DOWNLOAD_REQUEST: _NV_RISE_CONTENT_TYPE = 8; +pub const _NV_RISE_CONTENT_TYPE_NV_RISE_CONTENT_TYPE_UPDATE_INFO: _NV_RISE_CONTENT_TYPE = 9; +#[doc = " Enumeration of different RISE content types."] +pub type _NV_RISE_CONTENT_TYPE = ::std::os::raw::c_int; +#[doc = " Enumeration of different RISE content types."] +pub use self::_NV_RISE_CONTENT_TYPE as NV_RISE_CONTENT_TYPE; +#[doc = " Data passed back to callback."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_RISE_CALLBACK_DATA_V1 { + #[doc = " Super struct."] + pub super_: NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1, + #[doc = " RISE type of content"] + pub contentType: NV_RISE_CONTENT_TYPE, + #[doc = " RISE content."] + pub content: NvAPI_String, + #[doc = " Is this the last in the batch?"] + pub completed: NvBool, +} +#[doc = " Data passed back to callback."] +pub type NV_RISE_CALLBACK_DATA_V1 = _NV_RISE_CALLBACK_DATA_V1; +#[doc = " Callback for RISE update callbacks."] +pub type NV_RISE_CALLBACK_V1 = + ::std::option::Option; +#[doc = " Data required to register an update callback from the RISE."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_RISE_CALLBACK_SETTINGS_V1 { + #[doc = " [in] Structure Version, must always be first."] + pub version: NvU32, + #[doc = " [in] Generic callback parameter which will be passed to the callback."] + pub super_: NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1, + #[doc = " [in] Callback. Pass in NULL or nullptr to indicate request to unregister."] + pub callback: NV_RISE_CALLBACK_V1, + #[doc = " Reserved, must be set to zero by client."] + pub reserved: [NvU8; 32usize], +} +#[doc = " Data required to register an update callback from the RISE."] +pub type NV_RISE_CALLBACK_SETTINGS_V1 = _NV_RISE_CALLBACK_SETTINGS_V1; +#[doc = " Data required to register an update callback from the RISE."] +pub type NV_RISE_CALLBACK_SETTINGS = NV_RISE_CALLBACK_SETTINGS_V1; +#[doc = " Request contents sent to RISE."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_REQUEST_RISE_SETTINGS_V1 { + #[doc = " [in] Structure Version, must always be first."] + pub version: NvU32, + #[doc = " RISE type of content"] + pub contentType: NV_RISE_CONTENT_TYPE, + #[doc = " RISE request content."] + pub content: NvAPI_String, + #[doc = " Is the request fully sent?"] + pub completed: NvBool, + #[doc = " Reserved, must be set to zero by client."] + pub reserved: [NvU8; 32usize], +} +#[doc = " Request contents sent to RISE."] +pub type NV_REQUEST_RISE_SETTINGS_V1 = _NV_REQUEST_RISE_SETTINGS_V1; +#[doc = " Request contents sent to RISE."] +pub type NV_REQUEST_RISE_SETTINGS = NV_REQUEST_RISE_SETTINGS_V1; +#[doc = " Request contents sent to RISE."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NV_UNINSTALL_RISE_SETTINGS_V1 { + #[doc = " [in] Structure Version, must always be first."] + pub version: NvU32, + #[doc = " Reserved, must be set to zero by client."] + pub reserved: [NvU8; 32usize], +} +#[doc = " Request contents sent to RISE."] +pub type NV_UNINSTALL_RISE_SETTINGS_V1 = _NV_UNINSTALL_RISE_SETTINGS_V1; +#[doc = " Request contents sent to RISE."] +pub type NV_UNINSTALL_RISE_SETTINGS = NV_UNINSTALL_RISE_SETTINGS_V1; diff --git a/nvapi_trace/Cargo.toml b/nvapi_trace/Cargo.toml new file mode 100644 index 000000000..ed86c5453 --- /dev/null +++ b/nvapi_trace/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "nvapi_trace" +version = "0.0.0" +authors = ["Andrzej Janik "] +edition = "2021" + +[lib] +name = "nvapi_trace" +crate-type = ["cdylib"] + +[dependencies] +format = { path = "../format" } +dark_api = { path = "../dark_api" } +cuda_macros = { path = "../cuda_macros" } +cuda_types = { path = "../cuda_types" } +zluda_trace_common = { path = "../zluda_trace_common" } +libloading = "0.8" +paste = "1.0" +unwrap_or = "1.0.1" +cglue = "0.3.5" +dynasm = "5.0" +dynasmrt = "5.0" +rustc-hash = "2.0.0" + +[package.metadata.zluda] +windows_only = true +windows_paths = ["trace/nvapi64.dll"] +windows32_paths = ["trace/nvapi.dll"] +32bit = true diff --git a/nvapi_trace/src/lib.rs b/nvapi_trace/src/lib.rs new file mode 100644 index 000000000..04840a8c4 --- /dev/null +++ b/nvapi_trace/src/lib.rs @@ -0,0 +1,704 @@ +use libloading::Library; +use rustc_hash::FxHashMap; +use std::{ + collections::hash_map, + ffi::c_void, + ptr, + sync::{LazyLock, Mutex}, +}; +use zluda_trace_common::ReprUsize; + +static GLOBAL_STATE: LazyLock)>> = + LazyLock::new(get_global_state); + +fn get_global_state() -> Option<(Library, Mutex)> { + let cuda_lib = std::env::var("ZLUDA_NVAPI_LIB").ok().unwrap_or_else(|| { + if cfg!(target_pointer_width = "64") { + r"C:\Windows\System32\nvapi64.dll".to_string() + } else { + r"C:\Windows\System32\nvapi.dll".to_string() + } + }); + let lib = zluda_trace_common::dlopen_local_noredirect(cuda_lib).ok()?; + Some((Library::from(lib), Mutex::new(GlobalState::new()))) +} + +struct GlobalState { + thunks: FxHashMap, +} + +impl GlobalState { + fn new() -> Self { + GlobalState { + thunks: FxHashMap::default(), + } + } + + fn get_thunk( + &mut self, + original: *mut c_void, + report_fn: unsafe extern "C" fn(i32, u32), + interface: u32, + ) -> *mut c_void { + match self.thunks.entry(interface) { + hash_map::Entry::Occupied(entry) => *entry.get() as *mut c_void, + hash_map::Entry::Vacant(entry) => { + let thunk = get_thunk(original, report_fn, interface); + entry.insert(thunk as usize); + thunk + } + } + } +} + +macro_rules! interface_to_name { + ($({ $name:literal, $id:literal }),* $(,)?) => { + fn interface_to_name(interface: u32) -> Option<&'static str> { + match interface { + $( + $id => Some($name), + )* + _ => None, + } + } + }; +} + +interface_to_name!( + { "NvAPI_Initialize", 0x0150e828 }, + { "NvAPI_Unload", 0xd22bdd7e }, + { "NvAPI_GetErrorMessage", 0x6c2d048c }, + { "NvAPI_GetInterfaceVersionString", 0x01053fa5 }, + { "NvAPI_GPU_GetEDID", 0x37d32e69 }, + { "NvAPI_SetView", 0x0957d7b6 }, + { "NvAPI_SetViewEx", 0x06b89e68 }, + { "NvAPI_GetDisplayDriverVersion", 0xf951a4d1 }, + { "NvAPI_SYS_GetDriverAndBranchVersion", 0x2926aaad }, + { "NvAPI_GPU_GetMemoryInfo", 0x07f9b368 }, + { "NvAPI_GPU_GetMemoryInfoEx", 0xc0599498 }, + { "NvAPI_OGL_ExpertModeSet", 0x3805ef7a }, + { "NvAPI_OGL_ExpertModeGet", 0x22ed9516 }, + { "NvAPI_OGL_ExpertModeDefaultsSet", 0xb47a657e }, + { "NvAPI_OGL_ExpertModeDefaultsGet", 0xae921f12 }, + { "NvAPI_EnumPhysicalGPUs", 0xe5ac921f }, + { "NvAPI_EnumTCCPhysicalGPUs", 0xd9930b07 }, + { "NvAPI_EnumLogicalGPUs", 0x48b3ea59 }, + { "NvAPI_GetPhysicalGPUsFromDisplay", 0x34ef9506 }, + { "NvAPI_GetPhysicalGPUFromUnAttachedDisplay", 0x5018ed61 }, + { "NvAPI_GetLogicalGPUFromDisplay", 0xee1370cf }, + { "NvAPI_GetLogicalGPUFromPhysicalGPU", 0xadd604d1 }, + { "NvAPI_GetPhysicalGPUsFromLogicalGPU", 0xaea3fa32 }, + { "NvAPI_GetPhysicalGPUFromGPUID", 0x5380ad1a }, + { "NvAPI_GetGPUIDfromPhysicalGPU", 0x6533ea3e }, + { "NvAPI_GPU_GetShaderSubPipeCount", 0x0be17923 }, + { "NvAPI_GPU_GetGpuCoreCount", 0xc7026a87 }, + { "NvAPI_GPU_GetAllOutputs", 0x7d554f8e }, + { "NvAPI_GPU_GetConnectedOutputs", 0x1730bfc9 }, + { "NvAPI_GPU_GetConnectedSLIOutputs", 0x0680de09 }, + { "NvAPI_GPU_GetConnectedDisplayIds", 0x0078dba2 }, + { "NvAPI_GPU_GetAllDisplayIds", 0x785210a2 }, + { "NvAPI_GPU_GetConnectedOutputsWithLidState", 0xcf8caf39 }, + { "NvAPI_GPU_GetConnectedSLIOutputsWithLidState", 0x96043cc7 }, + { "NvAPI_GPU_GetSystemType", 0xbaaabfcc }, + { "NvAPI_GPU_GetActiveOutputs", 0xe3e89b6f }, + { "NvAPI_GPU_SetEDID", 0xe83d6456 }, + { "NvAPI_GPU_GetOutputType", 0x40a505e4 }, + { "NvAPI_GPU_ValidateOutputCombination", 0x34c9c2d4 }, + { "NvAPI_GPU_GetFullName", 0xceee8e9f }, + { "NvAPI_GPU_GetPCIIdentifiers", 0x2ddfb66e }, + { "NvAPI_GPU_GetGPUType", 0xc33baeb1 }, + { "NvAPI_GPU_GetBusType", 0x1bb18724 }, + { "NvAPI_GPU_GetBusId", 0x1be0b8e5 }, + { "NvAPI_GPU_GetBusSlotId", 0x2a0a350f }, + { "NvAPI_GPU_GetIRQ", 0xe4715417 }, + { "NvAPI_GPU_GetVbiosRevision", 0xacc3da0a }, + { "NvAPI_GPU_GetVbiosOEMRevision", 0x2d43fb31 }, + { "NvAPI_GPU_GetVbiosVersionString", 0xa561fd7d }, + { "NvAPI_GPU_GetAGPAperture", 0x6e042794 }, + { "NvAPI_GPU_GetCurrentAGPRate", 0xc74925a0 }, + { "NvAPI_GPU_GetCurrentPCIEDownstreamWidth", 0xd048c3b1 }, + { "NvAPI_GPU_GetPhysicalFrameBufferSize", 0x46fbeb03 }, + { "NvAPI_GPU_GetVirtualFrameBufferSize", 0x5a04b644 }, + { "NvAPI_GPU_GetQuadroStatus", 0xe332fa47 }, + { "NvAPI_GPU_GetBoardInfo", 0x22d54523 }, + { "NvAPI_GPU_GetRamBusWidth", 0x7975c581 }, + { "NvAPI_GPU_GetArchInfo", 0xd8265d24 }, + { "NvAPI_I2CRead", 0x2fde12c5 }, + { "NvAPI_I2CWrite", 0xe812eb07 }, + { "NvAPI_GPU_WorkstationFeatureSetup", 0x6c1f3fe4 }, + { "NvAPI_GPU_WorkstationFeatureQuery", 0x004537df }, + { "NvAPI_GPU_GetHDCPSupportStatus", 0xf089eef5 }, + { "NvAPI_GPU_CudaEnumComputeCapableGpus", 0x5786cc6e }, + { "NvAPI_GPU_GetTachReading", 0x5f608315 }, + { "NvAPI_GPU_GetECCStatusInfo", 0xca1ddaf3 }, + { "NvAPI_GPU_GetECCErrorInfo", 0xc71f85a6 }, + { "NvAPI_GPU_ResetECCErrorInfo", 0xc02eec20 }, + { "NvAPI_GPU_GetECCConfigurationInfo", 0x77a796f3 }, + { "NvAPI_GPU_SetECCConfiguration", 0x1cf639d9 }, + { "NvAPI_GPU_QueryWorkstationFeatureSupport", 0x80b1abb9 }, + { "NvAPI_GPU_SetScanoutIntensity", 0xa57457a4 }, + { "NvAPI_GPU_GetScanoutIntensityState", 0xe81ce836 }, + { "NvAPI_GPU_SetScanoutWarping", 0xb34bab4f }, + { "NvAPI_GPU_GetScanoutWarpingState", 0x6f5435af }, + { "NvAPI_GPU_SetScanoutCompositionParameter", 0xf898247d }, + { "NvAPI_GPU_GetScanoutCompositionParameter", 0x58fe51e6 }, + { "NvAPI_GPU_GetScanoutConfiguration", 0x6a9f5b63 }, + { "NvAPI_GPU_GetScanoutConfigurationEx", 0xe2e1e6f0 }, + { "NvAPI_GPU_GetAdapterIdFromPhysicalGpu", 0x0ff07fde }, + { "NvAPI_GPU_GetVirtualizationInfo", 0x44e022a9 }, + { "NvAPI_GPU_GetLogicalGpuInfo", 0x842b066e }, + { "NvAPI_GPU_GetLicensableFeatures", 0x3fc596aa }, + { "NvAPI_GPU_GetEncoderStatistics", 0xf0a9aeeb }, + { "NvAPI_GPU_GetEncoderSessionsInfo", 0xd8a72ce5 }, + { "NvAPI_GPU_GetGPUInfo", 0xafd1b02c }, + { "NvAPI_GPU_GetVRReadyData", 0x81d629c5 }, + { "NvAPI_GPU_GetGspFeatures", 0x581c4391 }, + { "NvAPI_GPU_GetUUID", 0xdc95673d }, + { "NvAPI_GPU_NVLINK_GetCaps", 0xbef1119d }, + { "NvAPI_GPU_NVLINK_GetStatus", 0xc72a38e3 }, + { "NvAPI_GPU_GetPerfDecreaseInfo", 0x7f7f4600 }, + { "NvAPI_GPU_GetPstatesInfoEx", 0x843c0256 }, + { "NvAPI_GPU_GetPstates20", 0x6ff81213 }, + { "NvAPI_GPU_GetCurrentPstate", 0x927da4f6 }, + { "NvAPI_GPU_GetDynamicPstatesInfoEx", 0x60ded2ed }, + { "NvAPI_GPU_GetThermalSettings", 0xe3640a56 }, + { "NvAPI_GPU_GetAllClockFrequencies", 0xdcb616c3 }, + { "NvAPI_GPU_QueryIlluminationSupport", 0xa629da31 }, + { "NvAPI_GPU_GetIllumination", 0x9a1b9365 }, + { "NvAPI_GPU_SetIllumination", 0x0254a187 }, + { "NvAPI_GPU_ClientIllumDevicesGetInfo", 0xd4100e58 }, + { "NvAPI_GPU_ClientIllumDevicesGetControl", 0x73c01d58 }, + { "NvAPI_GPU_ClientIllumDevicesSetControl", 0x57024c62 }, + { "NvAPI_GPU_ClientIllumZonesGetInfo", 0x4b81241b }, + { "NvAPI_GPU_ClientIllumZonesGetControl", 0x3dbf5764 }, + { "NvAPI_GPU_ClientIllumZonesSetControl", 0x197d065e }, + { "NvAPI_Event_RegisterCallback", 0xe6dbea69 }, + { "NvAPI_Event_UnregisterCallback", 0xde1f9b45 }, + { "NvAPI_EnumNvidiaDisplayHandle", 0x9abdd40d }, + { "NvAPI_EnumNvidiaUnAttachedDisplayHandle", 0x20de9260 }, + { "NvAPI_CreateDisplayFromUnAttachedDisplay", 0x63f9799e }, + { "NvAPI_GetAssociatedNvidiaDisplayHandle", 0x35c29134 }, + { "NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle", 0xa70503b2 }, + { "NvAPI_GetAssociatedNvidiaDisplayName", 0x22a78b05 }, + { "NvAPI_GetUnAttachedAssociatedDisplayName", 0x4888d790 }, + { "NvAPI_EnableHWCursor", 0x2863148d }, + { "NvAPI_DisableHWCursor", 0xab163097 }, + { "NvAPI_GetVBlankCounter", 0x67b5db55 }, + { "NvAPI_SetRefreshRateOverride", 0x3092ac32 }, + { "NvAPI_GetAssociatedDisplayOutputId", 0xd995937e }, + { "NvAPI_GetDisplayPortInfo", 0xc64ff367 }, + { "NvAPI_SetDisplayPort", 0xfa13e65a }, + { "NvAPI_GetHDMISupportInfo", 0x6ae16ec3 }, + { "NvAPI_Disp_InfoFrameControl", 0x6067af3f }, + { "NvAPI_Disp_ColorControl", 0x92f9d80d }, + { "NvAPI_Disp_GetHdrCapabilities", 0x84f2a8df }, + { "NvAPI_Disp_HdrColorControl", 0x351da224 }, + { "NvAPI_Disp_SetSourceColorSpace", 0x473b6caf }, + { "NvAPI_Disp_GetSourceColorSpace", 0xceedc85b }, + { "NvAPI_Disp_SetSourceHdrMetadata", 0x905eb63b }, + { "NvAPI_Disp_GetSourceHdrMetadata", 0x0d3f52da }, + { "NvAPI_Disp_SetOutputMode", 0x98e7661a }, + { "NvAPI_Disp_GetOutputMode", 0x81fed88d }, + { "NvAPI_Disp_SetHdrToneMapping", 0xdd6da362 }, + { "NvAPI_Disp_GetHdrToneMapping", 0xfbd36e71 }, + { "NvAPI_Disp_GetColorimetry", 0x00b421ad }, + { "NvAPI_DISP_GetTiming", 0x175167e9 }, + { "NvAPI_DISP_GetMonitorCapabilities", 0x3b05c7e1 }, + { "NvAPI_DISP_GetMonitorColorCapabilities", 0x6ae4cfb5 }, + { "NvAPI_DISP_EnumCustomDisplay", 0xa2072d59 }, + { "NvAPI_DISP_TryCustomDisplay", 0x1f7db630 }, + { "NvAPI_DISP_DeleteCustomDisplay", 0x552e5b9b }, + { "NvAPI_DISP_SaveCustomDisplay", 0x49882876 }, + { "NvAPI_DISP_RevertCustomDisplayTrial", 0xcbbd40f0 }, + { "NvAPI_GetView", 0xd6b99d89 }, + { "NvAPI_GetViewEx", 0xdbbc0af4 }, + { "NvAPI_GetSupportedViews", 0x66fb7fc0 }, + { "NvAPI_DISP_GetDisplayIdByDisplayName", 0xae457190 }, + { "NvAPI_DISP_GetGDIPrimaryDisplayId", 0x1e9d8a31 }, + { "NvAPI_DISP_GetDisplayConfig", 0x11abccf8 }, + { "NvAPI_DISP_SetDisplayConfig", 0x5d8cf8de }, + { "NvAPI_DISP_GetEdidData", 0x436ced76 }, + { "NvAPI_DISP_GetAdaptiveSyncData", 0xb73d1ee9 }, + { "NvAPI_DISP_SetAdaptiveSyncData", 0x3eebba1d }, + { "NvAPI_DISP_GetVirtualRefreshRateData", 0x8c00429a }, + { "NvAPI_DISP_SetVirtualRefreshRateData", 0x5abbe6a3 }, + { "NvAPI_DISP_SetPreferredStereoDisplay", 0xc9d0e25f }, + { "NvAPI_DISP_GetPreferredStereoDisplay", 0x1f6b4666 }, + { "NvAPI_DISP_GetNvManagedDedicatedDisplays", 0xdbdf0cb2 }, + { "NvAPI_DISP_AcquireDedicatedDisplay", 0x47c917ba }, + { "NvAPI_DISP_ReleaseDedicatedDisplay", 0x1247825f }, + { "NvAPI_DISP_GetNvManagedDedicatedDisplayMetadata", 0xd645d80c }, + { "NvAPI_DISP_SetNvManagedDedicatedDisplayMetadata", 0x3d8b129a }, + { "NvAPI_Disp_GetDisplayIdInfo", 0xbae8aa5e }, + { "NvAPI_Disp_GetDisplayIdsFromTarget", 0xe7e5f89e }, + { "NvAPI_Disp_GetVRRInfo", 0xdf8fda57 }, + { "NvAPI_Mosaic_GetSupportedTopoInfo", 0xfdb63c81 }, + { "NvAPI_Mosaic_GetTopoGroup", 0xcb89381d }, + { "NvAPI_Mosaic_GetOverlapLimits", 0x989685f0 }, + { "NvAPI_Mosaic_SetCurrentTopo", 0x9b542831 }, + { "NvAPI_Mosaic_GetCurrentTopo", 0xec32944e }, + { "NvAPI_Mosaic_EnableCurrentTopo", 0x5f1aa66c }, + { "NvAPI_Mosaic_GetDisplayViewportsByResolution", 0xdc6dc8d3 }, + { "NvAPI_Mosaic_SetDisplayGrids", 0x4d959a89 }, + { "NvAPI_Mosaic_ValidateDisplayGrids", 0xcf43903d }, + { "NvAPI_Mosaic_EnumDisplayModes", 0x78db97d7 }, + { "NvAPI_Mosaic_EnumDisplayGrids", 0xdf2887af }, + { "NvAPI_GetSupportedMosaicTopologies", 0x410b5c25 }, + { "NvAPI_GetCurrentMosaicTopology", 0xf60852bd }, + { "NvAPI_SetCurrentMosaicTopology", 0xd54b8989 }, + { "NvAPI_EnableCurrentMosaicTopology", 0x74073cc9 }, + { "NvAPI_GSync_EnumSyncDevices", 0xd9639601 }, + { "NvAPI_GSync_QueryCapabilities", 0x44a3f1d1 }, + { "NvAPI_GSync_GetTopology", 0x4562bc38 }, + { "NvAPI_GSync_SetSyncStateSettings", 0x60acdfdd }, + { "NvAPI_GSync_GetControlParameters", 0x16de1c6a }, + { "NvAPI_GSync_SetControlParameters", 0x8bbff88b }, + { "NvAPI_GSync_AdjustSyncDelay", 0x2d11ff51 }, + { "NvAPI_GSync_GetSyncStatus", 0xf1f5b434 }, + { "NvAPI_GSync_GetStatusParameters", 0x70d404ec }, + { "NvAPI_D3D_GetCurrentSLIState", 0x4b708b54 }, + { "NvAPI_D3D9_RegisterResource", 0xa064bdfc }, + { "NvAPI_D3D9_UnregisterResource", 0xbb2b17aa }, + { "NvAPI_D3D9_AliasSurfaceAsTexture", 0xe5ceae41 }, + { "NvAPI_D3D9_StretchRectEx", 0x22de03aa }, + { "NvAPI_D3D9_ClearRT", 0x332d3942 }, + { "NvAPI_D3D_GetObjectHandleForResource", 0xfceac864 }, + { "NvAPI_D3D_SetResourceHint", 0x6c0ed98c }, + { "NvAPI_D3D_BeginResourceRendering", 0x91123d6a }, + { "NvAPI_D3D_EndResourceRendering", 0x37e7191c }, + { "NvAPI_D3D9_GetSurfaceHandle", 0x0f2dd3f2 }, + { "NvAPI_D3D9_VideoSetStereoInfo", 0xb852f4db }, + { "NvAPI_D3D10_SetDepthBoundsTest", 0x4eadf5d2 }, + { "NvAPI_D3D11_CreateDevice", 0x6a16d3a0 }, + { "NvAPI_D3D11_CreateDeviceAndSwapChain", 0xbb939ee5 }, + { "NvAPI_D3D11_SetDepthBoundsTest", 0x7aaf7a04 }, + { "NvAPI_D3D11_IsNvShaderExtnOpCodeSupported", 0x5f68da40 }, + { "NvAPI_D3D11_SetNvShaderExtnSlot", 0x8e90bb9f }, + { "NvAPI_D3D12_SetNvShaderExtnSlotSpace", 0xac2dfeb5 }, + { "NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread", 0x43d867c0 }, + { "NvAPI_D3D11_SetNvShaderExtnSlotLocalThread", 0x0e6482a0 }, + { "NvAPI_D3D11_BeginUAVOverlapEx", 0xba08208a }, + { "NvAPI_D3D11_BeginUAVOverlap", 0x65b93ca8 }, + { "NvAPI_D3D11_EndUAVOverlap", 0x2216a357 }, + { "NvAPI_D3D11_GetResourceHandle", 0x09d52986 }, + { "NvAPI_D3D_SetFPSIndicatorState", 0xa776e8db }, + { "NvAPI_D3D9_Present", 0x05650beb }, + { "NvAPI_D3D9_QueryFrameCount", 0x9083e53a }, + { "NvAPI_D3D9_ResetFrameCount", 0xfa6a0675 }, + { "NvAPI_D3D9_QueryMaxSwapGroup", 0x5995410d }, + { "NvAPI_D3D9_QuerySwapGroup", 0xeba4d232 }, + { "NvAPI_D3D9_JoinSwapGroup", 0x7d44bb54 }, + { "NvAPI_D3D9_BindSwapBarrier", 0x9c39c246 }, + { "NvAPI_D3D_SetVerticalSyncMode", 0x5526cfd1 }, + { "NvAPI_D3D1x_Present", 0x03b845a1 }, + { "NvAPI_D3D1x_QueryFrameCount", 0x9152e055 }, + { "NvAPI_D3D1x_ResetFrameCount", 0xfbbb031a }, + { "NvAPI_D3D1x_QueryMaxSwapGroup", 0x9bb9d68f }, + { "NvAPI_D3D1x_QuerySwapGroup", 0x407f67aa }, + { "NvAPI_D3D1x_JoinSwapGroup", 0x14610cd7 }, + { "NvAPI_D3D1x_BindSwapBarrier", 0x9de8c729 }, + { "NvAPI_D3D12_QueryPresentBarrierSupport", 0xa15faef7 }, + { "NvAPI_D3D12_CreatePresentBarrierClient", 0x4d815de9 }, + { "NvAPI_D3D12_RegisterPresentBarrierResources", 0xd53c9ef0 }, + { "NvAPI_DestroyPresentBarrierClient", 0x3c5c351b }, + { "NvAPI_JoinPresentBarrier", 0x17f6bf82 }, + { "NvAPI_LeavePresentBarrier", 0xc3ec5a7f }, + { "NvAPI_QueryPresentBarrierFrameStatistics", 0x61b844a1 }, + { "NvAPI_D3D12_CreateDDisplayPresentBarrierClient", 0xb5a21987 }, + { "NvAPI_D3D11_CreateRasterizerState", 0xdb8d28af }, + { "NvAPI_D3D_ConfigureAnsel", 0x341c6c7f }, + { "NvAPI_D3D11_CreateTiledTexture2DArray", 0x7886981a }, + { "NvAPI_D3D11_CheckFeatureSupport", 0x106a487e }, + { "NvAPI_D3D11_CreateImplicitMSAATexture2D", 0xb8f79632 }, + { "NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D", 0x24c6a07b }, + { "NvAPI_D3D11_ResolveSubresourceRegion", 0xe6bfedd6 }, + { "NvAPI_D3D12_ResolveSubresourceRegion", 0xc24a15bf }, + { "NvAPI_D3D11_TiledTexture2DArrayGetDesc", 0xf1a2b9d5 }, + { "NvAPI_D3D11_UpdateTileMappings", 0x9a06ea07 }, + { "NvAPI_D3D11_CopyTileMappings", 0xc09ee6bc }, + { "NvAPI_D3D11_TiledResourceBarrier", 0xd6839099 }, + { "NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA", 0xf1c54fc9 }, + { "NvAPI_D3D11_CreateGeometryShaderEx_2", 0x99ed5c1c }, + { "NvAPI_D3D11_CreateVertexShaderEx", 0x0beaa0b2 }, + { "NvAPI_D3D11_CreateHullShaderEx", 0xb53cab00 }, + { "NvAPI_D3D11_CreateDomainShaderEx", 0xa0d7180d }, + { "NvAPI_D3D11_CreatePixelShaderEx_2", 0x4162822b }, + { "NvAPI_D3D11_CreateFastGeometryShaderExplicit", 0x71ab7c9c }, + { "NvAPI_D3D11_CreateFastGeometryShader", 0x525d43be }, + { "NvAPI_D3D11_DecompressView", 0x3a94e822 }, + { "NvAPI_D3D12_CreateGraphicsPipelineState", 0x2fc28856 }, + { "NvAPI_D3D12_CreateComputePipelineState", 0x2762deac }, + { "NvAPI_D3D12_SetDepthBoundsTestValues", 0xb9333fe9 }, + { "NvAPI_D3D12_CreateReservedResource", 0x2c85f101 }, + { "NvAPI_D3D12_CreateHeap", 0x5cb397cf }, + { "NvAPI_D3D12_CreateHeap2", 0x924be9d6 }, + { "NvAPI_D3D12_QueryCpuVisibleVidmem", 0x26322bc3 }, + { "NvAPI_D3D12_ReservedResourceGetDesc", 0x9aa2aabb }, + { "NvAPI_D3D12_UpdateTileMappings", 0xc6017a7d }, + { "NvAPI_D3D12_CopyTileMappings", 0x47f78194 }, + { "NvAPI_D3D12_ResourceAliasingBarrier", 0xb942bab7 }, + { "NvAPI_D3D12_CaptureUAVInfo", 0x6e5ea9db }, + { "NvAPI_D3D11_GetResourceGPUVirtualAddressEx", 0xaf6d14da }, + { "NvAPI_D3D11_EnumerateMetaCommands", 0xc7453ba8 }, + { "NvAPI_D3D11_CreateMetaCommand", 0xf505fba0 }, + { "NvAPI_D3D11_InitializeMetaCommand", 0xaec629e9 }, + { "NvAPI_D3D11_ExecuteMetaCommand", 0x82236c47 }, + { "NvAPI_D3D12_EnumerateMetaCommands", 0xcd9141d8 }, + { "NvAPI_D3D12_CreateMetaCommand", 0xeb29634b }, + { "NvAPI_D3D12_InitializeMetaCommand", 0xa4125399 }, + { "NvAPI_D3D12_ExecuteMetaCommand", 0xde24fc3d }, + { "NvAPI_D3D12_CreateCommittedResource", 0x027e98ae }, + { "NvAPI_D3D12_GetCopyableFootprints", 0xf6305eb5 }, + { "NvAPI_D3D12_CopyTextureRegion", 0x82b91b25 }, + { "NvAPI_D3D12_IsNvShaderExtnOpCodeSupported", 0x3dfacec8 }, + { "NvAPI_D3D12_GetOptimalThreadCountForMesh", 0xb43995cb }, + { "NvAPI_D3D_IsGSyncCapable", 0x9c1eed78 }, + { "NvAPI_D3D_IsGSyncActive", 0xe942b0ff }, + { "NvAPI_D3D12_SetFlipConfig", 0xf3148c42 }, + { "NvAPI_D3D1x_DisableShaderDiskCache", 0xd0cbca7d }, + { "NvAPI_D3D11_MultiGPU_GetCaps", 0xd2d25687 }, + { "NvAPI_D3D11_MultiGPU_Init", 0x017be49e }, + { "NvAPI_D3D11_CreateMultiGPUDevice", 0xbdb20007 }, + { "NvAPI_D3D_QuerySinglePassStereoSupport", 0x6f5f0a6d }, + { "NvAPI_D3D_SetSinglePassStereoMode", 0xa39e6e6e }, + { "NvAPI_D3D12_QuerySinglePassStereoSupport", 0x3b03791b }, + { "NvAPI_D3D12_SetSinglePassStereoMode", 0x83556d87 }, + { "NvAPI_D3D_QueryMultiViewSupport", 0xb6e0a41c }, + { "NvAPI_D3D_SetMultiViewMode", 0x8285c8da }, + { "NvAPI_D3D_QueryModifiedWSupport", 0xcbf9f4f5 }, + { "NvAPI_D3D_SetModifiedWMode", 0x06ea4bf4 }, + { "NvAPI_D3D12_QueryModifiedWSupport", 0x51235248 }, + { "NvAPI_D3D12_SetModifiedWMode", 0xe1fdaba7 }, + { "NvAPI_D3D_CreateLateLatchObject", 0x2db27d09 }, + { "NvAPI_D3D_QueryLateLatchSupport", 0x8ceca0ec }, + { "NvAPI_D3D_RegisterDevice", 0x8c02c4d0 }, + { "NvAPI_D3D11_MultiDrawInstancedIndirect", 0xd4e26bbf }, + { "NvAPI_D3D11_MultiDrawIndexedInstancedIndirect", 0x59e890f9 }, + { "NvAPI_D3D_ImplicitSLIControl", 0x2aede111 }, + { "NvAPI_D3D12_GetNeedsAppFPBlendClamping", 0x6ef4d2d1 }, + { "NvAPI_D3D12_UseDriverHeapPriorities", 0xf0d978a8 }, + { "NvAPI_D3D12_Mosaic_GetCompanionAllocations", 0xa46022c7 }, + { "NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions", 0xb092b818 }, + { "NvAPI_D3D1x_GetGraphicsCapabilities", 0x52b1499a }, + { "NvAPI_D3D12_GetGraphicsCapabilities", 0x01e87354 }, + { "NvAPI_D3D11_RSSetExclusiveScissorRects", 0xae4d73ef }, + { "NvAPI_D3D11_RSSetViewportsPixelShadingRates", 0x34f7938f }, + { "NvAPI_D3D11_CreateShadingRateResourceView", 0x99ca2dff }, + { "NvAPI_D3D11_RSSetShadingRateResourceView", 0x1b0c2f83 }, + { "NvAPI_D3D11_RSGetPixelShadingRateSampleOrder", 0x092442a1 }, + { "NvAPI_D3D11_RSSetPixelShadingRateSampleOrder", 0xa942373a }, + { "NvAPI_D3D_InitializeVRSHelper", 0x4780d70b }, + { "NvAPI_D3D_InitializeNvGazeHandler", 0x5b3b7479 }, + { "NvAPI_D3D_InitializeSMPAssist", 0x42763d0c }, + { "NvAPI_D3D_QuerySMPAssistSupport", 0xc57921de }, + { "NvAPI_D3D_GetSleepStatus", 0xaef96ca1 }, + { "NvAPI_D3D_SetSleepMode", 0xac1ca9e0 }, + { "NvAPI_D3D_Sleep", 0x852cd1d2 }, + { "NvAPI_D3D_SetReflexSync", 0xb9f6faff }, + { "NvAPI_D3D_GetLatency", 0x1a587f9c }, + { "NvAPI_D3D_SetLatencyMarker", 0xd9984c05 }, + { "NvAPI_D3D12_SetAsyncFrameMarker", 0x13c98f73 }, + { "NvAPI_D3D11_SetAsyncFrameMarker", 0x59c2c510 }, + { "NvAPI_D3D12_NotifyOutOfBandCommandQueue", 0x03d6e8cb }, + { "NvAPI_D3D12_SetCreateCommandQueueLowLatencyHint", 0x548c224f }, + { "NvAPI_D3D12_CreateCubinComputeShaderExV2", 0x299f5fdc }, + { "NvAPI_D3D12_CreateCubinComputeShader", 0x2a2c79e8 }, + { "NvAPI_D3D12_CreateCubinComputeShaderEx", 0x3151211b }, + { "NvAPI_D3D12_CreateCubinComputeShaderWithName", 0x1dc7261f }, + { "NvAPI_D3D12_LaunchCubinShader", 0x5c52bb86 }, + { "NvAPI_D3D12_DestroyCubinComputeShader", 0x7fb785ba }, + { "NvAPI_D3D12_GetCudaMergedTextureSamplerObject", 0x329fe6e0 }, + { "NvAPI_D3D12_GetCudaIndependentDescriptorObject", 0x0ddac234 }, + { "NvAPI_D3D12_GetCudaTextureObject", 0x80403fc9 }, + { "NvAPI_D3D12_GetCudaSurfaceObject", 0x48f5b2ee }, + { "NvAPI_D3D12_IsFatbinPTXSupported", 0x70c07832 }, + { "NvAPI_D3D12_CreateCuModule", 0xad1a677d }, + { "NvAPI_D3D12_EnumFunctionsInModule", 0x7ab88d88 }, + { "NvAPI_D3D12_CreateCuFunction", 0xe2436e22 }, + { "NvAPI_D3D12_LaunchCuKernelChain", 0x24973538 }, + { "NvAPI_D3D12_LaunchCuKernelChainEx", 0x846a9bf0 }, + { "NvAPI_D3D12_DestroyCuModule", 0x41c65285 }, + { "NvAPI_D3D12_DestroyCuFunction", 0xdf295ea6 }, + { "NvAPI_D3D11_CreateCubinComputeShaderExV2", 0xf2c71d48 }, + { "NvAPI_D3D11_CreateCubinComputeShader", 0x0ed98181 }, + { "NvAPI_D3D11_CreateCubinComputeShaderEx", 0x32c2a0f6 }, + { "NvAPI_D3D11_CreateCubinComputeShaderWithName", 0xb672be19 }, + { "NvAPI_D3D11_LaunchCubinShader", 0x427e236d }, + { "NvAPI_D3D11_DestroyCubinComputeShader", 0x01682c86 }, + { "NvAPI_D3D11_IsFatbinPTXSupported", 0x6086bd93 }, + { "NvAPI_D3D11_GetCudaIndependentViewObject", 0x34d2afa8 }, + { "NvAPI_D3D11_GetCudaMergedTextureSamplerObject", 0x5d637d8f }, + { "NvAPI_D3D11_CreateUnorderedAccessView", 0x74a497a1 }, + { "NvAPI_D3D11_CreateShaderResourceView", 0x65cb431e }, + { "NvAPI_D3D11_CreateSamplerState", 0x89eca416 }, + { "NvAPI_D3D11_GetCudaTextureObject", 0x9006fa68 }, + { "NvAPI_D3D11_GetResourceGPUVirtualAddress", 0x1819b423 }, + { "NvAPI_D3D12_GetRaytracingCaps", 0x85a6c2a0 }, + { "NvAPI_D3D12_EnableRaytracingValidation", 0x1de5991b }, + { "NvAPI_D3D12_RegisterRaytracingValidationMessageCallback", 0x8554eb38 }, + { "NvAPI_D3D12_UnregisterRaytracingValidationMessageCallback", 0x26975da6 }, + { "NvAPI_D3D12_FlushRaytracingValidationMessages", 0xb8fb1fcb }, + { "NvAPI_D3D12_GetRaytracingDisplacementMicromapArrayPrebuildInfo", 0xfa99b6de }, + { "NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo", 0x4726d180 }, + { "NvAPI_D3D12_SetCreatePipelineStateOptions", 0x5c607a27 }, + { "NvAPI_D3D12_CheckDriverMatchingIdentifierEx", 0xafb237d4 }, + { "NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx", 0x8d025b77 }, + { "NvAPI_D3D12_BuildRaytracingOpacityMicromapArray", 0x814f8d11 }, + { "NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray", 0x0425c538 }, + { "NvAPI_D3D12_BuildRaytracingDisplacementMicromapArray", 0x066f569d }, + { "NvAPI_D3D12_RelocateRaytracingDisplacementMicromapArray", 0x1c142308 }, + { "NvAPI_D3D12_EmitRaytracingDisplacementMicromapArrayPostbuildInfo", 0x68b9a790 }, + { "NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo", 0x1d9a39b6 }, + { "NvAPI_D3D12_BuildRaytracingAccelerationStructureEx", 0xe24ead45 }, + { "NvAPI_D3D12_QueryWorkstationFeatureProperties", 0xa92ea23a }, + { "NvAPI_D3D12_CreateCommittedRDMABuffer", 0xe78dcb44 }, + { "NvAPI_D3D12_ConvertCooperativeVectorMatrix", 0x0f252cb3 }, + { "NvAPI_D3D12_ConvertCooperativeVectorMatrixMultiple", 0x96ba5235 }, + { "NvAPI_D3D12_GetPhysicalDeviceCooperativeVectorProperties", 0x8f182aec }, + { "NvAPI_D3D12_GetRaytracingMultiIndirectClusterOperationRequirementsInfo", 0x5c9163f4 }, + { "NvAPI_D3D12_RaytracingExecuteMultiIndirectClusterOperation", 0x67c798af }, + { "NvAPI_D3D12_GetRaytracingPartitionedTlasIndirectPrebuildInfo", 0xcdfdc5f2 }, + { "NvAPI_D3D12_BuildRaytracingPartitionedTlasIndirect", 0x7cfc6fc3 }, + { "NvAPI_NGX_GetNGXOverrideState", 0x3fd96fba }, + { "NvAPI_NGX_SetNGXOverrideState", 0xb60fcb4e }, + { "NvAPI_DirectD3D12GraphicsCommandList_Create", 0x74a4e712 }, + { "NvAPI_DirectD3D12GraphicsCommandList_Release", 0x99da3dde }, + { "NvAPI_DirectD3D12GraphicsCommandList_Reset", 0x999c26d8 }, + { "NvAPI_VIO_GetCapabilities", 0x1dc91303 }, + { "NvAPI_VIO_Open", 0x44ee4841 }, + { "NvAPI_VIO_Close", 0xd01bd237 }, + { "NvAPI_VIO_Status", 0x0e6ce4f1 }, + { "NvAPI_VIO_SyncFormatDetect", 0x118d48a3 }, + { "NvAPI_VIO_GetConfig", 0xd34a789b }, + { "NvAPI_VIO_SetConfig", 0x0e4eec07 }, + { "NvAPI_VIO_SetCSC", 0xa1ec8d74 }, + { "NvAPI_VIO_GetCSC", 0x7b0d72a3 }, + { "NvAPI_VIO_SetGamma", 0x964bf452 }, + { "NvAPI_VIO_GetGamma", 0x51d53d06 }, + { "NvAPI_VIO_SetSyncDelay", 0x2697a8d1 }, + { "NvAPI_VIO_GetSyncDelay", 0x462214a9 }, + { "NvAPI_VIO_GetPCIInfo", 0xb981d935 }, + { "NvAPI_VIO_IsRunning", 0x96bd040e }, + { "NvAPI_VIO_Start", 0xcde8e1a3 }, + { "NvAPI_VIO_Stop", 0x6ba2a5d6 }, + { "NvAPI_VIO_IsFrameLockModeCompatible", 0x7bf0a94d }, + { "NvAPI_VIO_EnumDevices", 0xfd7c5557 }, + { "NvAPI_VIO_QueryTopology", 0x869534e2 }, + { "NvAPI_VIO_EnumSignalFormats", 0xead72fe4 }, + { "NvAPI_VIO_EnumDataFormats", 0x221fa8e8 }, + { "NvAPI_Stereo_CreateConfigurationProfileRegistryKey", 0xbe7692ec }, + { "NvAPI_Stereo_DeleteConfigurationProfileRegistryKey", 0xf117b834 }, + { "NvAPI_Stereo_SetConfigurationProfileValue", 0x24409f48 }, + { "NvAPI_Stereo_DeleteConfigurationProfileValue", 0x49bceecf }, + { "NvAPI_Stereo_Enable", 0x239c4545 }, + { "NvAPI_Stereo_Disable", 0x2ec50c2b }, + { "NvAPI_Stereo_IsEnabled", 0x348ff8e1 }, + { "NvAPI_Stereo_GetStereoSupport", 0x296c434d }, + { "NvAPI_Stereo_CreateHandleFromIUnknown", 0xac7e37f4 }, + { "NvAPI_Stereo_DestroyHandle", 0x3a153134 }, + { "NvAPI_Stereo_Activate", 0xf6a1ad68 }, + { "NvAPI_Stereo_Deactivate", 0x2d68de96 }, + { "NvAPI_Stereo_IsActivated", 0x1fb0bc30 }, + { "NvAPI_Stereo_GetSeparation", 0x451f2134 }, + { "NvAPI_Stereo_SetSeparation", 0x5c069fa3 }, + { "NvAPI_Stereo_DecreaseSeparation", 0xda044458 }, + { "NvAPI_Stereo_IncreaseSeparation", 0xc9a8ecec }, + { "NvAPI_Stereo_GetConvergence", 0x4ab00934 }, + { "NvAPI_Stereo_SetConvergence", 0x3dd6b54b }, + { "NvAPI_Stereo_DecreaseConvergence", 0x4c87e317 }, + { "NvAPI_Stereo_IncreaseConvergence", 0xa17daabe }, + { "NvAPI_Stereo_GetFrustumAdjustMode", 0xe6839b43 }, + { "NvAPI_Stereo_SetFrustumAdjustMode", 0x7be27fa2 }, + { "NvAPI_Stereo_CaptureJpegImage", 0x932cb140 }, + { "NvAPI_Stereo_InitActivation", 0xc7177702 }, + { "NvAPI_Stereo_Trigger_Activation", 0x0d6c6cd2 }, + { "NvAPI_Stereo_CapturePngImage", 0x8b7e99b5 }, + { "NvAPI_Stereo_ReverseStereoBlitControl", 0x3cd58f89 }, + { "NvAPI_Stereo_SetNotificationMessage", 0x6b9b409e }, + { "NvAPI_Stereo_SetActiveEye", 0x96eea9f8 }, + { "NvAPI_Stereo_SetDriverMode", 0x5e8f0bec }, + { "NvAPI_Stereo_GetEyeSeparation", 0xce653127 }, + { "NvAPI_Stereo_IsWindowedModeSupported", 0x40c8ed5e }, + { "NvAPI_Stereo_SetSurfaceCreationMode", 0xf5dcfcba }, + { "NvAPI_Stereo_GetSurfaceCreationMode", 0x36f1c736 }, + { "NvAPI_Stereo_Debug_WasLastDrawStereoized", 0xed4416c5 }, + { "NvAPI_Stereo_SetDefaultProfile", 0x44f0ecd1 }, + { "NvAPI_Stereo_GetDefaultProfile", 0x624e21c2 }, + { "NvAPI_D3D1x_CreateSwapChain", 0x1bc21b66 }, + { "NvAPI_D3D9_CreateSwapChain", 0x1a131e09 }, + { "NvAPI_Vulkan_InitLowLatencyDevice", 0x5c1696b6 }, + { "NvAPI_Vulkan_DestroyLowLatencyDevice", 0x11a5932b }, + { "NvAPI_Vulkan_GetSleepStatus", 0xadf966af }, + { "NvAPI_Vulkan_SetSleepMode", 0x2acfd162 }, + { "NvAPI_Vulkan_Sleep", 0x36732b1e }, + { "NvAPI_Vulkan_GetLatency", 0x3233d44a }, + { "NvAPI_Vulkan_SetLatencyMarker", 0xa17d13d6 }, + { "NvAPI_Vulkan_NotifyOutOfBandVkQueue", 0x5d6d3840 }, + { "NvAPI_DRS_CreateSession", 0x0694d52e }, + { "NvAPI_DRS_DestroySession", 0xdad9cff8 }, + { "NvAPI_DRS_LoadSettings", 0x375dbd6b }, + { "NvAPI_DRS_SaveSettings", 0xfcbc7e14 }, + { "NvAPI_DRS_LoadSettingsFromFile", 0xd3ede889 }, + { "NvAPI_DRS_SaveSettingsToFile", 0x2be25df8 }, + { "NvAPI_DRS_CreateProfile", 0xcc176068 }, + { "NvAPI_DRS_DeleteProfile", 0x17093206 }, + { "NvAPI_DRS_SetCurrentGlobalProfile", 0x1c89c5df }, + { "NvAPI_DRS_GetCurrentGlobalProfile", 0x617bff9f }, + { "NvAPI_DRS_GetProfileInfo", 0x61cd6fd6 }, + { "NvAPI_DRS_SetProfileInfo", 0x16abd3a9 }, + { "NvAPI_DRS_FindProfileByName", 0x7e4a9a0b }, + { "NvAPI_DRS_EnumProfiles", 0xbc371ee0 }, + { "NvAPI_DRS_GetNumProfiles", 0x1dae4fbc }, + { "NvAPI_DRS_CreateApplication", 0x4347a9de }, + { "NvAPI_DRS_DeleteApplicationEx", 0xc5ea85a1 }, + { "NvAPI_DRS_DeleteApplication", 0x2c694bc6 }, + { "NvAPI_DRS_GetApplicationInfo", 0xed1f8c69 }, + { "NvAPI_DRS_EnumApplications", 0x7fa2173a }, + { "NvAPI_DRS_FindApplicationByName", 0xeee566b2 }, + { "NvAPI_DRS_SetSetting", 0x577dd202 }, + { "NvAPI_DRS_GetSetting", 0x73bf8338 }, + { "NvAPI_DRS_EnumSettings", 0xae3039da }, + { "NvAPI_DRS_EnumAvailableSettingIds", 0xf020614a }, + { "NvAPI_DRS_EnumAvailableSettingValues", 0x2ec39f90 }, + { "NvAPI_DRS_GetSettingIdFromName", 0xcb7309cd }, + { "NvAPI_DRS_GetSettingNameFromId", 0xd61cbe6e }, + { "NvAPI_DRS_DeleteProfileSetting", 0xe4a26362 }, + { "NvAPI_DRS_RestoreAllDefaults", 0x5927b094 }, + { "NvAPI_DRS_RestoreProfileDefault", 0xfa5f6134 }, + { "NvAPI_DRS_RestoreProfileDefaultSetting", 0x53f0381e }, + { "NvAPI_DRS_GetBaseProfile", 0xda8466a0 }, + { "NvAPI_SYS_GetChipSetInfo", 0x53dabbca }, + { "NvAPI_SYS_GetLidAndDockInfo", 0xcda14d8a }, + { "NvAPI_SYS_GetDisplayIdFromGpuAndOutputId", 0x08f2bab4 }, + { "NvAPI_SYS_GetGpuAndOutputIdFromDisplayId", 0x112ba1a5 }, + { "NvAPI_SYS_GetPhysicalGpuFromDisplayId", 0x9ea74659 }, + { "NvAPI_SYS_GetDisplayDriverInfo", 0x721faceb }, + { "NvAPI_SYS_GetPhysicalGPUs", 0xd3b24d2d }, + { "NvAPI_SYS_GetLogicalGPUs", 0xccfffc10 }, + { "NvAPI_NGX_GetDriverFeatureSupport", 0x6194b19d }, + { "NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates", 0xadeeaf67 }, + { "NvAPI_RegisterRiseCallback", 0x9cfe8f94 }, + { "NvAPI_RequestRise", 0x5047de98 }, + { "NvAPI_UninstallRise", 0xab8d09f6 }, +); + +#[no_mangle] +pub unsafe extern "C" fn nvapi_QueryInterface(interface: u32) -> *mut c_void { + let maybe_fn_ptr_global = (&*GLOBAL_STATE).as_ref().and_then(|(lib, state)| { + let fn_ptr = lib + .get:: *mut c_void>(b"nvapi_QueryInterface\0") + .ok()?; + Some((fn_ptr, state)) + }); + let (fn_ptr, global_state) = + unwrap_or::unwrap_some_or!(maybe_fn_ptr_global, return ptr::null_mut()); + let export_table = unwrap_or::unwrap_some_or!( + ::zluda_trace_common::get_export_table(), + return ptr::null_mut() + ); + let format_args = dark_api::FnFfiWrapper(|| { + use std::io::Write; + let mut writer = Vec::new(); + let name = interface_to_name(interface); + match name { + Some(name) => write!(&mut writer, "(interface: {})", name).ok(), + None => write!(&mut writer, "(interface: {:#010x})", interface).ok(), + }; + dark_api::ByteVecFfi::new(writer) + }); + let underlying_fn = dark_api::FnFfiWrapper(|| { + let result = fn_ptr(interface); + result as usize + }); + let original: *mut c_void = ReprUsize::from_usize(export_table.logged_call( + cglue::slice::CSliceRef::from_str("nvapi_QueryInterface"), + 0, + cglue::trait_obj!(&format_args as dark_api::FnFfi), + cglue::trait_obj!(&underlying_fn as dark_api::FnFfi), + ptr::null_mut::() as usize, + <*mut c_void as ReprUsize>::format_status, + )); + if cfg!(target_pointer_width = "32") && !original.is_null() { + global_state + .lock() + .ok() + .map(|mut state| state.get_thunk(original, report_fn, interface)) + .unwrap_or_else(|| get_thunk(original, report_fn, interface)) + } else { + original + } +} + +unsafe extern "C" fn report_fn(result: i32, interface: u32) { + let export_table = unwrap_or::unwrap_some_or!(::zluda_trace_common::get_export_table(), return); + let format_args = + dark_api::FnFfiWrapper(|| dark_api::ByteVecFfi::new("(...)".as_bytes().to_vec())); + let underlying_fn = dark_api::FnFfiWrapper(|| ReprUsize::to_usize(result)); + let (fn_name, interface) = match interface_to_name(interface) { + Some(name) => (name, 0), + None => ("", interface), + }; + export_table.logged_call( + cglue::slice::CSliceRef::from_str(fn_name), + interface, + cglue::trait_obj!(&format_args as dark_api::FnFfi), + cglue::trait_obj!(&underlying_fn as dark_api::FnFfi), + ::INTERNAL_ERROR, + ::format_status, + ); +} + +#[cfg(target_arch = "x86")] +pub fn get_thunk( + original_fn: *mut c_void, + report_fn: unsafe extern "C" fn(i32, u32), + interface: u32, +) -> *mut c_void { + use dynasmrt::{dynasm, DynasmApi}; + let mut ops = dynasmrt::x86::Assembler::new().unwrap(); + let start = ops.offset(); + dynasm!(ops + ; .arch x86 + ; push ebp + ; mov ebp, esp + ; push DWORD [ebp+68] + ; push DWORD [ebp+64] + ; push DWORD [ebp+60] + ; push DWORD [ebp+56] + ; push DWORD [ebp+52] + ; push DWORD [ebp+48] + ; push DWORD [ebp+44] + ; push DWORD [ebp+40] + ; push DWORD [ebp+36] + ; push DWORD [ebp+32] + ; push DWORD [ebp+28] + ; push DWORD [ebp+24] + ; push DWORD [ebp+20] + ; push DWORD [ebp+16] + ; push DWORD [ebp+12] + ; push DWORD [ebp+8] + ; mov eax, original_fn as i32 + ; call eax + ; push interface as i32 + ; push eax + ; mov eax, report_fn as i32 + ; call eax + ; pop eax + ; leave + ; ret + ; int 3 + ); + let exe_buf = ops.finalize().unwrap(); + let result_fn = exe_buf.ptr(start); + std::mem::forget(exe_buf); + result_fn as *mut _ +} + +#[cfg(target_arch = "x86_64")] +pub fn get_thunk( + _original_fn: *mut c_void, + _report_fn: unsafe extern "C" fn(i32, u32), + _interface: u32, +) -> *mut c_void { + todo!() +} diff --git a/ptx/lib/zluda_ptx_impl.cpp b/ptx/lib/zluda_ptx_impl.cpp index 65d5545bd..2676ed294 100644 --- a/ptx/lib/zluda_ptx_impl.cpp +++ b/ptx/lib/zluda_ptx_impl.cpp @@ -1132,7 +1132,7 @@ extern "C" v4##RETURN_TYPE FUNC(texobj_3d_v4_##RETURN_TYPE##_##COORD_TYPE)(uint64_t texobj, v4##COORD_TYPE coord) \ { \ auto [i, s] = get_image_and_sampler(texobj); \ - auto result = sample_3D(i, s, v4f32{float(coord.x), float(coord.y), float(coord.z), float(coord.w)}); \ + auto result = sample_3D(i, s, v4f32{float(coord.x), float(coord.y), float(coord.z), float(coord.w)}); \ return v4##RETURN_TYPE{std::bit_cast(result.x), std::bit_cast(result.y), std::bit_cast(result.z), std::bit_cast(result.w)}; \ } \ v4##RETURN_TYPE FUNC(texref_3d_v4_##RETURN_TYPE##_##COORD_TYPE)(struct textureReference GLOBAL_SPACE * texref, v4##COORD_TYPE coord) \ diff --git a/ptx/src/pass/convert_32bit_to_64bit.rs b/ptx/src/pass/convert_32bit_to_64bit.rs index 9760b0da8..6ebc7f582 100644 --- a/ptx/src/pass/convert_32bit_to_64bit.rs +++ b/ptx/src/pass/convert_32bit_to_64bit.rs @@ -31,18 +31,24 @@ pub(super) fn run<'input>( TranslateError, > { let (global_ids, globals) = collect_globals(resolver, &directives)?; - let mut explicit_arg_count = Vec::new(); + let mut explicit_args_size_align = Vec::new(); let directives = directives .into_iter() .filter_map(|directive| { - run_directive(resolver, directive, &global_ids, &mut explicit_arg_count).transpose() + run_directive( + resolver, + directive, + &global_ids, + &mut explicit_args_size_align, + ) + .transpose() }) .collect::, _>>()?; Ok(( directives, ModuleMetadata32Bit { globals, - explicit_arg_count, + explicit_args_size_align, }, )) } @@ -136,7 +142,7 @@ fn run_directive<'input>( resolver: &mut GlobalStringIdentResolver2<'input>, directive: Directive2, SpirvWord>, globals_ids: &[SpirvWord], - explicit_arg_count: &mut Vec<(String, u32)>, + explicit_args_size_align: &mut Vec<(String, Vec<(u32, u32)>)>, ) -> Result, SpirvWord>>, TranslateError> { Ok(match directive { Directive2::Variable(linking, varinfo) if pass_through_variable(&varinfo) => { @@ -146,7 +152,7 @@ fn run_directive<'input>( resolver, method, globals_ids, - explicit_arg_count, + explicit_args_size_align, )?)), _ => None, }) @@ -156,7 +162,7 @@ fn run_method<'input>( resolver: &mut GlobalStringIdentResolver2<'input>, mut method: Function, SpirvWord>, globals_ids: &[SpirvWord], - explicit_arg_count: &mut Vec<(String, u32)>, + explicit_args_size_align: &mut Vec<(String, Vec<(u32, u32)>)>, ) -> Result, SpirvWord>, TranslateError> { let is_kernel = method.is_kernel(); if let Some(ref mut body) = method.body { @@ -181,7 +187,17 @@ fn run_method<'input>( }) .ok_or_else(error_unreachable)? .to_string(); - explicit_arg_count.push((text_name, method.input_arguments.len() as u32)); + let argument_sizes = method + .input_arguments + .iter() + .map(|arg| { + let layout = arg.info.v_type.layout().unwrap(); + let size = layout.size() as u32; + let align = layout.align() as u32; + (size, align) + }) + .collect(); + explicit_args_size_align.push((text_name, argument_sizes)); let implicit_memory_ptr = add_hidden_argument( resolver, ast::ScalarType::B64, diff --git a/ptx/src/pass/llvm/emit.rs b/ptx/src/pass/llvm/emit.rs index de5e29e5a..68b82c319 100644 --- a/ptx/src/pass/llvm/emit.rs +++ b/ptx/src/pass/llvm/emit.rs @@ -1723,6 +1723,17 @@ impl<'a> MethodEmitContext<'a> { (data.state_space, ast::StateSpace::Generic) } }; + if self.base_32bit_memory.is_some() + && matches!( + data.state_space, + ast::StateSpace::Global | ast::StateSpace::Generic | ast::StateSpace::Const + ) + { + return self.emit_mov(ast::MovArgs { + dst: arguments.dst, + src: arguments.src, + }); + } let from_type = get_pointer_type(self.context, from_space)?; let dest_type = get_pointer_type(self.context, to_space)?; let src = self.resolver.value(arguments.src)?; diff --git a/ptx/src/pass/replace_instructions_with_functions.rs b/ptx/src/pass/replace_instructions_with_functions.rs index 413fcec66..d5005c8d4 100644 --- a/ptx/src/pass/replace_instructions_with_functions.rs +++ b/ptx/src/pass/replace_instructions_with_functions.rs @@ -301,6 +301,11 @@ fn run_instruction<'input>( }, .. } => { + let dtype = match dtype { + // For 32 bit + ast::ScalarType::U32 => ast::ScalarType::S32, + t => t, + }; let prefix = match type_ { ast::TexType::Texref => "texref", ast::TexType::Texobj => "texobj", diff --git a/ptx/src/test/spirv_run/mod.rs b/ptx/src/test/spirv_run/mod.rs index 36f3da393..a6d23d92b 100644 --- a/ptx/src/test/spirv_run/mod.rs +++ b/ptx/src/test/spirv_run/mod.rs @@ -1617,9 +1617,12 @@ fn run_zluda32 + Copy + Debug, Output: From + Copy + Debug + ) .unwrap(); let zluda32 = kernel_metadata::ModuleMetadata32Bit::read_object(&elf_module).unwrap(); - assert_eq!(zluda32.explicit_arg_count.len(), 1); - assert_eq!(zluda32.explicit_arg_count[0].0, name.to_str().unwrap()); - assert_eq!(zluda32.explicit_arg_count[0].1, 2); + assert_eq!(zluda32.explicit_args_size_align.len(), 1); + assert_eq!( + zluda32.explicit_args_size_align[0].0, + name.to_str().unwrap() + ); + assert_eq!(zluda32.explicit_args_size_align[0].1.len(), 2); let mut module = unsafe { mem::zeroed() }; unsafe { hipModuleLoadData(&mut module, elf_module.as_ptr() as _) }.unwrap(); let mut kernel = unsafe { mem::zeroed() }; diff --git a/ptx_parser/Cargo.toml b/ptx_parser/Cargo.toml index 6f67e933f..be7a106ab 100644 --- a/ptx_parser/Cargo.toml +++ b/ptx_parser/Cargo.toml @@ -12,7 +12,7 @@ derive_more = { version = "1", features = ["display"] } logos = "0.14" ptx_parser_macros = { path = "../ptx_parser_macros" } rustc-hash = "2.0.0" -strum = { version = "0.27.1", features = ["derive"] } +strum = { version = "0.28", features = ["derive"] } thiserror = "1.0" winnow = { version = "0.6.18" } # winnow = { version = "0.6.18", features = ["debug"] } diff --git a/ptx_parser/src/lib.rs b/ptx_parser/src/lib.rs index f2a0c5d26..df3e7397d 100644 --- a/ptx_parser/src/lib.rs +++ b/ptx_parser/src/lib.rs @@ -4416,7 +4416,7 @@ derive_parser!( } } - .dtype: ScalarType = { .s32, .f32 }; + .dtype: ScalarType = { .u32, .s32, .f32 }; .ctype: ScalarType = { .s32, .f32 }; // https://docs.nvidia.com/cuda/parallel-thread-execution/ diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 5e4763bdc..c362655d2 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -37,11 +37,14 @@ struct Cargo { release: Option, #[bpaf(long)] profile: Option, + #[bpaf(long)] + target: Option, #[bpaf(any("", Some), many)] _unused: Vec, } struct Project { + is_32bit: bool, #[cfg_attr(unix, allow(unused))] manifest_path: PathBuf, name: String, @@ -51,7 +54,7 @@ struct Project { } impl Project { - fn try_new(p: Package) -> Option { + fn try_new(p: Package, is_32bit: bool) -> Option { let name = p.name; let manifest_path = p.manifest_path.into(); serde_json::from_value::>(p.metadata) @@ -76,13 +79,14 @@ impl Project { target_name, target_kind, meta: m.zluda, + is_32bit, } }) } #[cfg(windows)] fn zip_compiler_output(&self) -> bool { - self.meta.windows_paths.is_empty() + self.meta.windows_paths(self.is_32bit).is_empty() } #[cfg(unix)] @@ -146,7 +150,7 @@ impl Project { target_dir, profile, libname, - self.meta.windows_paths.as_slice(), + self.meta.windows_paths(self.is_32bit).as_slice(), ) .map(move |(.., full_path, target)| { let copy_output = full_path.clone(); @@ -239,6 +243,10 @@ struct ZludaMetadata { linux_only: bool, #[serde(default)] windows_only: bool, + #[serde(default = "always_true", rename = "64bit")] + is_64bit: bool, + #[serde(default, rename = "32bit")] + is_32bit: bool, #[serde(default)] debug_only: bool, #[cfg_attr(not(unix), allow(unused))] @@ -249,9 +257,26 @@ struct ZludaMetadata { windows_paths: Vec, #[serde(default)] #[cfg_attr(unix, allow(unused))] + windows32_paths: Vec, + #[serde(default)] + #[cfg_attr(unix, allow(unused))] windows_extra_files: HashMap, } +impl ZludaMetadata { + fn windows_paths(&self, is_32bit: bool) -> &Vec { + if is_32bit && !self.windows32_paths.is_empty() { + &self.windows32_paths + } else { + &self.windows_paths + } + } +} + +fn always_true() -> bool { + true +} + fn main() { let options = match options().run_inner(Args::current_args()) { Ok(b) => b, @@ -272,21 +297,33 @@ fn main() { } fn compile(b: Build) -> (PathBuf, String, Vec) { - let profile = sniff_out_profile_name(&b.cargo_arguments); + let cargo_flags = sniff_out_cargo_flags(&b.cargo_arguments); let meta = MetadataCommand::new().no_deps().exec().unwrap(); - let target_directory = meta.target_directory.into_std_path_buf(); + let mut target_directory = meta.target_directory.into_std_path_buf(); + if let Some(target) = &cargo_flags.target { + target_directory.push(target); + } let projects = meta .packages .into_iter() - .filter_map(Project::try_new) + .filter_map(|pkg| Project::try_new(pkg, cargo_flags.is_32bit)) .filter(|project| { + if cargo_flags.is_32bit { + if !project.meta.is_32bit { + return false; + } + } else { + if !project.meta.is_64bit { + return false; + } + } if project.meta.linux_only && cfg!(windows) { return false; } if project.meta.windows_only && cfg!(not(windows)) { return false; } - if project.meta.debug_only && profile != "debug" { + if project.meta.debug_only && cargo_flags.profile != "debug" { return false; } true @@ -302,13 +339,21 @@ fn compile(b: Build) -> (PathBuf, String, Vec) { } command.args(b.cargo_arguments); assert!(command.status().unwrap().success()); - os::make_symlinks(&target_directory, &*projects, &*profile); - (target_directory, profile, projects) + os::make_symlinks(&target_directory, &*projects, &*cargo_flags.profile); + (target_directory, cargo_flags.profile, projects) } -fn sniff_out_profile_name(b: &[OsString]) -> String { +fn sniff_out_cargo_flags(b: &[OsString]) -> CargoFlags { let parsed_cargo_arguments = cargo().to_options().run_inner(b); - match parsed_cargo_arguments { + let (target, is_32bit) = match parsed_cargo_arguments.as_ref() { + Ok(Cargo { + target: Some(target), + .. + }) => (Some(target.clone()), target.starts_with("i686")), + Ok(Cargo { target: None, .. }) => (None, cfg!(target_pointer_width = "32")), + _ => (None, false), + }; + let profile = match parsed_cargo_arguments { Ok(Cargo { release: Some(true), .. @@ -318,9 +363,20 @@ fn sniff_out_profile_name(b: &[OsString]) -> String { .. }) => profile, _ => "debug".to_string(), + }; + CargoFlags { + profile, + target, + is_32bit, } } +struct CargoFlags { + profile: String, + target: Option, + is_32bit: bool, +} + fn zip(zip: Build) { let (target_dir, profile, projects) = compile(zip); os::zip(target_dir, profile, projects) diff --git a/zluda/src/impl/driver.rs b/zluda/src/impl/driver.rs index 1a8987cb5..8c04186ea 100644 --- a/zluda/src/impl/driver.rs +++ b/zluda/src/impl/driver.rs @@ -1,5 +1,6 @@ use crate::r#impl::{self, context, device, function, module}; use cuda_types::cuda::*; +use dark_api::FunctionArgInfo; use hip_runtime_sys::*; use libloading::Library; use std::{ @@ -242,21 +243,21 @@ impl ::dark_api::cuda::CudaDarkApi for DarkApi { value: *mut c_void, dtor_cb: Option, ) -> CUresult { - let _ctx = if cu_ctx.0 != ptr::null_mut() { + let ctx = if cu_ctx.0 != ptr::null_mut() { cu_ctx } else { let mut current_ctx: CUcontext = CUcontext(ptr::null_mut()); context::get_current(&mut current_ctx)?; current_ctx }; - let ctx_obj: &context::Context = FromCuda::<_, CUerror>::from_cuda(&_ctx)?; + let ctx_obj: &context::Context = FromCuda::<_, CUerror>::from_cuda(&ctx)?; ctx_obj.with_state_mut(|state: &mut context::ContextState| { state.storage.insert( key as usize, context::StorageData { value: value as usize, reset_cb: dtor_cb, - handle: _ctx, + handle: ctx, }, ); Ok(()) @@ -268,7 +269,14 @@ impl ::dark_api::cuda::CudaDarkApi for DarkApi { cu_ctx: CUcontext, key: *mut c_void, ) -> CUresult { - let ctx_obj: &context::Context = FromCuda::<_, CUerror>::from_cuda(&cu_ctx)?; + let ctx = if cu_ctx.0 != ptr::null_mut() { + cu_ctx + } else { + let mut current_ctx: CUcontext = CUcontext(ptr::null_mut()); + context::get_current(&mut current_ctx)?; + current_ctx + }; + let ctx_obj: &context::Context = FromCuda::<_, CUerror>::from_cuda(&ctx)?; ctx_obj.with_state_mut(|state: &mut context::ContextState| { state.storage.remove(&(key as usize)); Ok(()) @@ -469,6 +477,91 @@ fn get_device_hash_info() -> Result, CUerror> { static EXPORT_TABLE: ::dark_api::cuda::CudaDarkApiGlobalTable = ::dark_api::cuda::CudaDarkApiGlobalTable::new::(); +struct Zluda32DarkApi {} + +impl ::dark_api::zluda32::CudaDarkApi for Zluda32DarkApi { + unsafe extern "system" fn get_module_globals( + names: *mut *mut u8, + initializers: *mut *const u8, + sizes: *mut u32, + alignments: *mut u32, + count: *mut u32, + module: cuda_types::cuda::CUmodule, + ) -> cuda_types::cuda::CUresult { + let module: &module::Module = FromCuda::<_, CUerror>::from_cuda(&module)?; + let zluda32 = module.bit32.as_ref().ok_or(CUerror::NOT_FOUND)?; + if let Some(c) = count.as_mut() { + *c = zluda32.globals.len() as u32; + } + let mut names = if names.is_null() { + None + } else { + Some(slice::from_raw_parts_mut(names, zluda32.globals.len())) + }; + let mut initializers = if initializers.is_null() { + None + } else { + Some(slice::from_raw_parts_mut( + initializers, + zluda32.globals.len(), + )) + }; + let mut sizes = if sizes.is_null() { + None + } else { + Some(slice::from_raw_parts_mut(sizes, zluda32.globals.len())) + }; + let mut alignments = if alignments.is_null() { + None + } else { + Some(slice::from_raw_parts_mut(alignments, zluda32.globals.len())) + }; + if names.is_some() || initializers.is_some() || sizes.is_some() || alignments.is_some() { + for (i, global) in zluda32.globals.iter().enumerate() { + if let Some(names) = &mut names { + names[i] = global.name.as_ptr() as *mut u8; + } + if let Some(initializers) = &mut initializers { + initializers[i] = global.initializer.as_ptr(); + } + if let Some(sizes) = &mut sizes { + sizes[i] = global.initializer.len() as u32; + } + if let Some(alignments) = &mut alignments { + alignments[i] = global.align as u32; + } + } + } + Ok(()) + } + + unsafe extern "system" fn get_function_info( + explicit_sizes_out: *mut FunctionArgInfo, + explicit_count_out: *mut u32, + func: cuda_types::cuda::CUfunction, + ) -> cuda_types::cuda::CUresult { + let func: &function::Function = FromCuda::<_, CUerror>::from_cuda(&func)?; + let explicit_args_size_align = match &func.explicit_args_size_align { + Some(sizes) => sizes, + None => return CUresult::ERROR_NOT_FOUND, + }; + if !explicit_sizes_out.is_null() { + std::ptr::copy_nonoverlapping( + explicit_args_size_align.as_ptr(), + explicit_sizes_out, + explicit_args_size_align.len(), + ); + } + if let Some(explicit_count_out) = explicit_count_out.as_mut() { + *explicit_count_out = explicit_args_size_align.len() as u32; + } + Ok(()) + } +} + +static ZLUDA32_EXPORT_TABLE: ::dark_api::zluda32::CudaDarkApiGlobalTable = + ::dark_api::zluda32::CudaDarkApiGlobalTable::new::(); + pub(crate) fn get_export_table( pp_export_table: &mut *const ::core::ffi::c_void, p_export_table_id: &CUuuid, @@ -476,6 +569,9 @@ pub(crate) fn get_export_table( if let Some(table) = EXPORT_TABLE.get(p_export_table_id) { *pp_export_table = table.start(); cuda_types::cuda::CUresult::SUCCESS + } else if let Some(table) = ZLUDA32_EXPORT_TABLE.get(p_export_table_id) { + *pp_export_table = table.start(); + cuda_types::cuda::CUresult::SUCCESS } else { cuda_types::cuda::CUresult::ERROR_INVALID_VALUE } diff --git a/zluda/src/impl/function.rs b/zluda/src/impl/function.rs index 6dd6f3144..aea11d554 100644 --- a/zluda/src/impl/function.rs +++ b/zluda/src/impl/function.rs @@ -1,10 +1,12 @@ use cuda_types::cuda::{CUfunction, CUfunction_attribute, CUkernel}; +use dark_api::FunctionArgInfo; use hip_runtime_sys::*; use std::mem; pub(crate) struct Function { pub(crate) base: hipFunction_t, pub(crate) sm_version: u32, + pub(crate) explicit_args_size_align: Option>, } impl<'a, E: zluda_common::CudaErrorType> zluda_common::FromCuda<'a, CUfunction, E> diff --git a/zluda/src/impl/hipfix.rs b/zluda/src/impl/hipfix.rs index f8de70767..3326da8cd 100644 --- a/zluda/src/impl/hipfix.rs +++ b/zluda/src/impl/hipfix.rs @@ -18,6 +18,9 @@ const HIP_TRSA_OVERRIDE_FORMAT: u32 = 1; pub(crate) unsafe fn refresh_texref(raw_texref: *mut textureReference) -> hipError_t { let texref = raw_texref.as_ref().ok_or(hipErrorCode_t::InvalidValue)?; let mut res_desc = std::mem::zeroed(); + if texref.textureObject.is_null() { + return Ok(()); + } hipTexObjectGetResourceDesc(&mut res_desc, texref.textureObject)?; match res_desc.resType { HIPresourcetype::HIP_RESOURCE_TYPE_ARRAY => hipTexRefSetArray( diff --git a/zluda/src/impl/library.rs b/zluda/src/impl/library.rs index 9869d8eca..98be33e67 100644 --- a/zluda/src/impl/library.rs +++ b/zluda/src/impl/library.rs @@ -21,8 +21,8 @@ impl Library { let module_lock = self.modules.get(device).ok_or(CUerror::INVALID_DEVICE)?; *module_lock.get_or_init(|| match self.data { LibraryData::Lazy(lib) => { - let (module, sm_version) = module::load_hip_module(lib)?; - Ok(Module::new(module, sm_version).wrap()) + let (module, sm_version, meta32) = module::load_hip_module(lib)?; + Ok(Module::new(module, sm_version, meta32).wrap()) } LibraryData::Eager(()) => Err(CUerror::NOT_SUPPORTED), }) diff --git a/zluda/src/impl/module.rs b/zluda/src/impl/module.rs index c49051ddd..f49c72478 100644 --- a/zluda/src/impl/module.rs +++ b/zluda/src/impl/module.rs @@ -2,6 +2,7 @@ use super::driver; use crate::r#impl::function; use crate::r#impl::{driver::GlobalState, function::Function}; use cuda_types::{cuda::*, dark_api::FatbinFileHeader}; +use dark_api::FunctionArgInfo; use hip_runtime_sys::*; use rustc_hash::FxHashMap; use std::collections::hash_map; @@ -17,6 +18,7 @@ use zluda_common::{CodeLibraryRef, CodeModuleRef, ZludaObject}; pub(crate) struct Module { pub(crate) base: hipModule_t, pub(crate) sm_version: u32, + pub(crate) bit32: Option, mutable: Mutex, } @@ -30,6 +32,7 @@ impl ModuleMutable { module: hipModule_t, sm_version: u32, name: CString, + explicit_args_size_align: Option>, ) -> Result<&Function, CUerror> { Ok(match self.functions.entry(name) { hash_map::Entry::Occupied(entry) => &*entry.into_mut(), @@ -39,6 +42,7 @@ impl ModuleMutable { let func = Box::new(Function { base: func_handle, sm_version, + explicit_args_size_align, }); &*entry.insert(func) } @@ -58,21 +62,102 @@ impl ZludaObject for Module { } } +pub(crate) struct Metadata32Bit { + pub globals: Vec, + pub explicit_args_size_align: FxHashMap>, +} + +impl Metadata32Bit { + fn new(meta: &kernel_metadata::ModuleMetadata32Bit) -> Self { + let globals = meta + .globals + .iter() + .map(|g| Global32Bit { + name: CString::new(&*g.name).unwrap(), + initializer: g.initializer.to_vec(), + align: g.align, + }) + .collect(); + let explicit_args_size_align = meta + .explicit_args_size_align + .iter() + .map(|(key, value)| { + let key = key.to_string(); + let value = value + .iter() + .map(|(size, align)| FunctionArgInfo { + size: *size, + align: *align, + }) + .collect(); + (key, value) + }) + .collect(); + Self { + globals, + explicit_args_size_align, + } + } + + fn from_archived(archived: &kernel_metadata::ArchivedModuleMetadata32Bit) -> Self { + let globals = archived + .globals + .iter() + .map(|g| Global32Bit { + name: CString::new(g.name.as_str()).unwrap(), + initializer: g.initializer.to_vec(), + align: g.align.to_native(), + }) + .collect(); + let explicit_args_size_align = archived + .explicit_args_size_align + .iter() + .map(|kv| { + ( + kv.0.to_string(), + kv.1.iter() + .map(|x| FunctionArgInfo { + size: x.0.to_native(), + align: x.1.to_native(), + }) + .collect(), + ) + }) + .collect(); + Self { + globals, + explicit_args_size_align, + } + } +} + +pub(crate) struct Global32Bit { + pub name: CString, + pub initializer: Vec, + pub align: u32, +} + impl Module { - pub(crate) fn new(base: hipModule_t, sm_version: u32) -> Self { + pub(crate) fn new(base: hipModule_t, sm_version: u32, bit32: Option) -> Self { Self { base, sm_version, mutable: Mutex::new(ModuleMutable { functions: FxHashMap::default(), }), + bit32, } } pub(crate) fn get_function<'a>(&'a self, name: &CStr) -> Result<&'static Function, CUerror> { let mut mutable = self.mutable.lock().map_err(|_| CUerror::UNKNOWN)?; + let explicit_args = self.bit32.as_ref().and_then(|meta| { + meta.explicit_args_size_align + .get(name.to_str().ok()?) + .map(Vec::clone) + }); mutable - .get_function(self.base, self.sm_version, name.to_owned()) + .get_function(self.base, self.sm_version, name.to_owned(), explicit_args) .map(|f| unsafe { (f as *const Function).as_ref().unwrap() }) } } @@ -80,7 +165,7 @@ impl Module { fn get_best_ptx_and_compile( global_state: &GlobalState, image: CodeLibraryRef<'_>, -) -> Result<(hipModule_t, u32), CUerror> { +) -> Result<(hipModule_t, u32, Option), CUerror> { let mut ptx_modules = Vec::new(); unsafe { CodeLibraryRef::iterate_modules(image, |_, module| match module { @@ -91,7 +176,7 @@ fn get_best_ptx_and_compile( if file.header.kind != FatbinFileHeader::HEADER_KIND_PTX { return; } - if let Ok(text) = file.get_or_decompress_content() { + if let Ok(text) = file.get_or_decompress_content(true) { if let Some(text) = cow_bytes_to_str(text) { ptx_modules.push(text); } @@ -168,12 +253,12 @@ fn get_best_ptx_and_compile( _ => None, }; let cached_binary = load_cached_binary(&mut cache_with_key); - let (elf_module, sm_version) = cached_binary + let (elf_module, sm_version, zluda32) = cached_binary .ok_or(CUerror::UNKNOWN) .or_else(|_| compile_and_cache(gcn_arch, attributes, module, &mut cache_with_key))?; let mut hip_module = unsafe { mem::zeroed() }; unsafe { hipModuleLoadData(&mut hip_module, elf_module.as_ptr().cast()) }?; - Ok((hip_module, sm_version)) + Ok((hip_module, sm_version, zluda32)) } fn cow_bytes_to_str<'a>(data: Cow<'a, [u8]>) -> Option> { @@ -183,7 +268,9 @@ fn cow_bytes_to_str<'a>(data: Cow<'a, [u8]>) -> Option> { } } -pub(crate) fn load_hip_module(library: CodeLibraryRef) -> Result<(hipModule_t, u32), CUerror> { +pub(crate) fn load_hip_module( + library: CodeLibraryRef, +) -> Result<(hipModule_t, u32, Option), CUerror> { let global_state = driver::global_state()?; get_best_ptx_and_compile(global_state, library) } @@ -229,14 +316,16 @@ fn get_cache_key<'a, 'b>( fn load_cached_binary( cache_with_key: &mut Option<(zluda_cache::ModuleCache, zluda_cache::ModuleKey)>, -) -> Option<(Vec, u32)> { +) -> Option<(Vec, u32, Option)> { let binary = cache_with_key .as_mut() .and_then(|(c, key)| c.get_module_binary(key))?; let sm_version = kernel_metadata::ModuleMetadataV1::read_object(&binary)? .sm_version .to_native(); - Some((binary, sm_version)) + let zluda32 = kernel_metadata::ModuleMetadata32Bit::read_object(&binary) + .map(Metadata32Bit::from_archived); + Some((binary, sm_version, zluda32)) } fn compile_and_cache( @@ -244,7 +333,7 @@ fn compile_and_cache( attributes: ExtraCacheAttributes, ast: ptx_parser::Module, cache_with_key: &mut Option<(zluda_cache::ModuleCache, zluda_cache::ModuleKey)>, -) -> Result<(Vec, u32), CUerror> { +) -> Result<(Vec, u32, Option), CUerror> { let llvm_module = ptx::to_llvm_module( ast, ptx::Attributes { @@ -255,6 +344,7 @@ fn compile_and_cache( .map_err(|_| CUerror::UNKNOWN)?; let ptx_impl = llvm_module.linked_bitcode(); let sm_version = llvm_module.metadata.sm_version; + let metadata32 = llvm_module.metadata32.as_ref().map(Metadata32Bit::new); let elf_module = llvm_zluda::compile( &llvm_module.context, gcn_arch, @@ -270,7 +360,7 @@ fn compile_and_cache( key.last_access = zluda_cache::ModuleCache::time_now(); cache.insert_module(key, &elf_module); } - Ok((elf_module, sm_version)) + Ok((elf_module, sm_version, metadata32)) } pub(crate) fn load(module: &mut CUmodule, fname: &CStr) -> CUresult { @@ -280,16 +370,16 @@ pub(crate) fn load(module: &mut CUmodule, fname: &CStr) -> CUresult { image.push(0); let library = unsafe { CodeLibraryRef::try_load(image.as_ptr() as *const std::ffi::c_void) } .map_err(|_| CUerror::NO_BINARY_FOR_GPU)?; - let (hip_module, sm_version) = load_hip_module(library)?; - *module = Module::new(hip_module, sm_version).wrap(); + let (hip_module, sm_version, meta32) = load_hip_module(library)?; + *module = Module::new(hip_module, sm_version, meta32).wrap(); Ok(()) } pub(crate) fn load_data(module: &mut CUmodule, image: &std::ffi::c_void) -> CUresult { let library = unsafe { CodeLibraryRef::try_load(image) }.map_err(|_| CUerror::NO_BINARY_FOR_GPU)?; - let (hip_module, sm_version) = load_hip_module(library)?; - *module = Module::new(hip_module, sm_version).wrap(); + let (hip_module, sm_version, meta32) = load_hip_module(library)?; + *module = Module::new(hip_module, sm_version, meta32).wrap(); Ok(()) } diff --git a/zluda/src/impl/tex.rs b/zluda/src/impl/tex.rs index 225e10a2a..347469a65 100644 --- a/zluda/src/impl/tex.rs +++ b/zluda/src/impl/tex.rs @@ -101,6 +101,9 @@ pub(crate) unsafe fn ref_set_address_v2( dev_ptr: hipDeviceptr_t, bytes: usize, ) -> hipError_t { + if dev_ptr.0.is_null() { + return hipUnbindTexture(texref); + } hipTexRefSetAddress(byte_offset, texref, dev_ptr, bytes) } diff --git a/zluda32/Cargo.toml b/zluda32/Cargo.toml new file mode 100644 index 000000000..52bbd1aca --- /dev/null +++ b/zluda32/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "zluda32" +version = "0.0.0" +authors = ["Andrzej Janik "] +edition = "2021" + +[lib] +name = "nvcuda" +crate-type = ["cdylib"] + +[dependencies] +cuda_types = { path = "../cuda_types" } +zluda_common = { path = "../zluda_common" } +cuda_macros = { path = "../cuda_macros" } +zluda_windows = { path = "../zluda_windows" } +zluda_server_common = { path = "../zluda_server_common" } +dark_api = { path = "../dark_api" } +paste = "1.0" +windows = { version = "0.62.2", features = [ + "Win32_Foundation", + "Win32_Storage_FileSystem", + "Win32_System_IO", + "Win32_System_Pipes", + "Win32_Security", +] } +rand = "0.9" +rkyv = "0.8" +unwrap_or = "1.0.1" +rustc-hash = "2.0.0" +libc = "0.2" + +[package.metadata.zluda] +windows_only = true +64bit = false +32bit = true diff --git a/zluda32/src/ipc.rs b/zluda32/src/ipc.rs new file mode 100644 index 000000000..833bf5807 --- /dev/null +++ b/zluda32/src/ipc.rs @@ -0,0 +1,179 @@ +use cuda_types::cuda::CUerror; +use rand::distr::{Alphanumeric, SampleString}; +use rkyv::api::high::HighSerializer; +use rkyv::de::Pool; +use rkyv::rancor::{Failure, Strategy}; +use rkyv::ser::allocator::ArenaHandle; +use rkyv::util::AlignedVec; +use rkyv::{Archive, Deserialize, Portable, Serialize}; +use std::io::{Read, Write}; +use std::num::NonZeroU32; +use std::os::windows::io::{AsHandle, AsRawHandle, FromRawHandle}; +use std::path::PathBuf; +use std::process::{Child, Command, Stdio}; +use std::{env, mem}; +use windows::core::{Error, PCSTR}; +use windows::Win32::Foundation::*; +use windows::Win32::System::Pipes::*; +use zluda_server_common::Opcode; + +pub(crate) struct Server { + pipe: std::fs::File, + _child: Child, + buffer: AlignedVec, +} + +impl Server { + fn new(pipe: std::fs::File, child: Child) -> Self { + Self { + pipe, + _child: child, + buffer: AlignedVec::new(), + } + } + + pub unsafe fn start() -> Result { + let name = Alphanumeric.sample_string(&mut rand::rng(), 32); + let pipe_path = format!("\\\\.\\pipe\\zluda-{name}\0"); + let pipe = std::fs::File::from_raw_handle( + CreateNamedPipeA( + PCSTR(pipe_path.as_ptr()), + windows::Win32::Storage::FileSystem::PIPE_ACCESS_DUPLEX, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT | PIPE_REJECT_REMOTE_CLIENTS, + 1, + 4 * 1024, + 4 * 1024, + 0, + None, + )? + .0, + ); + let mut primary_path = zluda_common::os::self_path().ok_or(Error::new( + E_FAIL, + "Could not get path to the executing module", + ))?; + primary_path.pop(); + if cfg!(debug_assertions) { + primary_path.push("../../debug/zluda64_server.exe"); + } else { + primary_path.push("../zluda64_server.exe"); + }; + let fallback_path = env::var("ZLUDA64_PATH").ok().map(PathBuf::from); + let spawn_server = |path: &PathBuf| { + Command::new(path) + .arg(&pipe_path[..pipe_path.len() - 1]) + .stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .current_dir(path.parent().unwrap()) + .spawn() + }; + let child = match (spawn_server(&primary_path), fallback_path) { + (Ok(c), _) => c, + (Err(_), Some(fallback_path)) => spawn_server(&fallback_path)?, + (Err(e), None) => return Err(e.into()), + }; + zluda_windows::kill_child_on_process_exit(child.as_handle().as_raw_handle())?; + match ConnectNamedPipe(HANDLE(pipe.as_raw_handle()), None) { + Ok(_) => Ok(Server::new(pipe, child)), + Err(e) if e.code() == ERROR_PIPE_CONNECTED.into() => Ok(Server::new(pipe, child)), + Err(e) => Err(e), + } + } + + pub(crate) fn remote_call_zero_copy( + &mut self, + opcode: Opcode, + data: impl for<'a, 'b> Serialize< + HighSerializer<&'a mut AlignedVec, ArenaHandle<'b>, rkyv::rancor::Failure>, + >, + ) -> Result { + self.buffer.clear(); + self.pipe + .write_all(&(opcode as u32).to_le_bytes()[..]) + .map_err(|_| CUerror::UNKNOWN)?; + let slice = + rkyv::api::high::to_bytes_in::<_, rkyv::rancor::Failure>(&data, &mut self.buffer) + .map_err(|_| CUerror::UNKNOWN)?; + self.pipe.write_all(&slice).map_err(|_| CUerror::UNKNOWN)?; + read_return_code(self)?; + self.buffer.resize(mem::size_of::(), 0); + self.pipe + .read_exact(&mut self.buffer) + .map_err(|_| CUerror::UNKNOWN)?; + let output = unsafe { rkyv::access_unchecked::(&self.buffer) }; + Ok(output.clone()) + } + + pub(crate) fn remote_call_framed_in( + &mut self, + opcode: Opcode, + data: impl for<'a, 'b> Serialize< + HighSerializer<&'a mut AlignedVec, ArenaHandle<'b>, rkyv::rancor::Failure>, + >, + ) -> Result { + self.buffer.clear(); + self.pipe + .write_all(&(opcode as u32).to_le_bytes()[..]) + .map_err(|_| CUerror::UNKNOWN)?; + let slice = + rkyv::api::high::to_bytes_in::<_, rkyv::rancor::Failure>(&data, &mut self.buffer) + .map_err(|_| CUerror::UNKNOWN)?; + self.pipe + .write_all(&(slice.len() as u32).to_le_bytes()[..]) + .map_err(|_| CUerror::UNKNOWN)?; + self.pipe.write_all(&slice).map_err(|_| CUerror::UNKNOWN)?; + read_return_code(self)?; + self.buffer.resize(mem::size_of::(), 0); + self.pipe + .read_exact(&mut self.buffer) + .map_err(|_| CUerror::UNKNOWN)?; + let output = unsafe { rkyv::access_unchecked::(&self.buffer) }; + Ok(output.clone()) + } + + pub(crate) fn remote_call_framed_out( + &mut self, + opcode: Opcode, + data: impl for<'a, 'b> Serialize< + HighSerializer<&'a mut AlignedVec, ArenaHandle<'b>, rkyv::rancor::Failure>, + >, + ) -> Result + where + ::Archived: Deserialize>, + { + self.buffer.clear(); + self.pipe + .write_all(&(opcode as u32).to_le_bytes()[..]) + .map_err(|_| CUerror::UNKNOWN)?; + let slice = + rkyv::api::high::to_bytes_in::<_, rkyv::rancor::Failure>(&data, &mut self.buffer) + .map_err(|_| CUerror::UNKNOWN)?; + self.pipe.write_all(&slice).map_err(|_| CUerror::UNKNOWN)?; + read_return_code(self)?; + let out_size = read_u32(self)?; + self.buffer.resize(out_size as usize, 0); + self.pipe + .read_exact(&mut self.buffer) + .map_err(|_| CUerror::UNKNOWN)?; + unsafe { rkyv::from_bytes_unchecked::(&self.buffer) } + .map_err(|_| CUerror::UNKNOWN) + } +} + +fn read_return_code(this: &mut Server) -> Result<(), CUerror> { + let code = read_u32(this)?; + match NonZeroU32::new(code) { + None => Ok(()), + Some(code) => Err(CUerror(code)), + } +} + +fn read_u32(this: &mut Server) -> Result { + let mut code_buffer = [0u8; 4]; + this.pipe + .read_exact(&mut code_buffer) + .map_err(|_| CUerror::UNKNOWN)?; + let code = u32::from_le_bytes(code_buffer); + Ok(code) +} diff --git a/zluda32/src/lib.rs b/zluda32/src/lib.rs new file mode 100644 index 000000000..f7537583f --- /dev/null +++ b/zluda32/src/lib.rs @@ -0,0 +1,1226 @@ +use cuda_macros::cuda_function_declarations; +use cuda_types::cuda::*; +use dark_api::cuda::CudaDarkApi; +use dark_api::FunctionArgInfo; +use paste::paste; +use rkyv::api::high::HighSerializer; +use rkyv::de::Pool; +use rkyv::rancor::{Failure, Strategy}; +use rkyv::rend::u32_le; +use rkyv::ser::allocator::ArenaHandle; +use rkyv::util::AlignedVec; +use rkyv::{Archive, Deserialize, Portable, Serialize}; +use rustc_hash::FxHashMap; +use std::alloc::Layout; +use std::sync::atomic::AtomicBool; +use std::sync::{Mutex, OnceLock}; +use std::{cell::RefCell, ffi::c_void, ptr}; +use zluda_common::{CodeLibraryRef, CodeModuleRef}; +use zluda_server_common::*; + +mod ipc; + +macro_rules! not_implemented { + ($($abi:literal fn $fn_name:ident( $($arg_id:ident : $arg_type:ty),* ) -> $ret_type:ty;)*) => { + $( + #[cfg_attr(not(test), no_mangle)] + #[allow(improper_ctypes)] + #[allow(improper_ctypes_definitions)] + #[allow(unused_variables)] + pub unsafe extern $abi fn $fn_name ( $( $arg_id : $arg_type),* ) -> $ret_type { + if !crate::initialized() { + return Err(CUerror::DEINITIALIZED); + } + Err(cuda_types::cuda::CUerror::NOT_SUPPORTED) + } + )* + }; +} + +macro_rules! implemented { + ($($abi:literal fn $fn_name:ident( $($arg_id:ident : $arg_type:ty),* ) -> $ret_type:ty;)*) => { + $( + #[cfg_attr(not(test), no_mangle)] + #[allow(improper_ctypes)] + #[allow(improper_ctypes_definitions)] + pub unsafe extern $abi fn $fn_name ( $( $arg_id : $arg_type),* ) -> $ret_type { + if !crate::initialized() { + return Err(CUerror::DEINITIALIZED); + } + paste!{ [< $fn_name:snake >] ( $( $arg_id ),* ) } + } + )* + + }; +} + +cuda_function_declarations! { + not_implemented, + implemented <= [ + cuCtxCreate_v2, + cuCtxCreate, + cuCtxDetach, + cuCtxGetApiVersion, + cuCtxGetCurrent, + cuCtxGetDevice, + cuCtxSetCacheConfig, + cuCtxSynchronize, + cuDeviceComputeCapability, + cuDeviceGet, + cuDeviceGetAttribute, + cuDeviceGetCount, + cuDeviceGetName, + cuDeviceGetProperties, + cuDeviceTotalMem_v2, + cuDriverGetVersion, + cuEventCreate, + cuEventDestroy_v2, + cuEventQuery, + cuEventRecord, + cuGetExportTable, + cuInit, + cuLaunchKernel, + cuMemAlloc_v2, + cuMemcpyDtoD_v2, + cuMemcpyDtoDAsync_v2, + cuMemcpyDtoHAsync_v2, + cuMemcpyHtoDAsync_v2, + cuMemFree_v2, + cuMemFreeHost, + cuMemGetAddressRange_v2, + cuMemHostAlloc, + cuMemsetD8_v2, + cuModuleGetFunction, + cuModuleGetGlobal_v2, + cuModuleGetTexRef, + cuStreamCreate, + cuStreamDestroy_v2, + cuTexRefSetAddress_v2, + cuTexRefSetAddressMode, + cuTexRefSetFilterMode, + cuTexRefSetFlags, + cuTexRefSetFormat, + cuTexRefSetMaxAnisotropy, + cuTexRefSetMipmapFilterMode, + cuTexRefSetMipmapLevelBias, + cuTexRefSetMipmapLevelClamp, + ] +} + +thread_local! { + pub(crate) static CONTEXT_STACK: ContextStack = ContextStack::new(); +} + +struct ContextStack(RefCell>); + +impl ContextStack { + fn new() -> Self { + ContextStack(RefCell::new(Vec::new())) + } + + fn push(&self, ctx: CUcontext, dev: CUdevice) { + self.0.borrow_mut().push((ctx, dev)); + } + + fn unwrap(&self, ctx: CUcontext) -> Result { + if ctx.0.is_null() { + let stack = self.0.borrow(); + stack + .last() + .map(|(ctx, _)| *ctx) + .ok_or(CUerror::INVALID_VALUE) + } else { + Ok(ctx) + } + } + + fn current(&self) -> (CUcontext, CUdevice) { + self.0 + .borrow() + .last() + .copied() + .unwrap_or((CUcontext(ptr::null_mut()), 0)) + } +} + +struct GlobalState { + server: ipc::Server, + function_args: FxHashMap>, + next_context: u32, + context_state: FxHashMap< + cuda_types::cuda::CUcontext, + FxHashMap< + usize, + ( + usize, + Option< + extern "system" fn( + cuda_types::cuda::CUcontext, + *mut std::ffi::c_void, + *mut std::ffi::c_void, + ), + >, + ), + >, + >, +} + +impl GlobalState { + fn get() -> Result<&'static Mutex, CUerror> { + static LOCK: OnceLock, windows::core::Error>> = OnceLock::new(); + LOCK.get_or_init(|| { + Ok(Mutex::new(GlobalState { + function_args: FxHashMap::default(), + server: unsafe { ipc::Server::start() }?, + next_context: 1024 * 1024, + context_state: FxHashMap::default(), + })) + }) + .as_ref() + .map_err(|_| CUerror::UNKNOWN) + } + + pub(crate) fn remote_call_zero_copy( + opcode: Opcode, + data: impl for<'a, 'b> Serialize< + HighSerializer<&'a mut AlignedVec, ArenaHandle<'b>, rkyv::rancor::Failure>, + >, + ) -> Result { + Self::get()? + .lock() + .map_err(|_| CUerror::UNKNOWN)? + .server + .remote_call_zero_copy(opcode, data) + } + + pub(crate) fn remote_call_framed_in( + opcode: Opcode, + data: impl for<'a, 'b> Serialize< + HighSerializer<&'a mut AlignedVec, ArenaHandle<'b>, rkyv::rancor::Failure>, + >, + ) -> Result { + Self::get()? + .lock() + .map_err(|_| CUerror::UNKNOWN)? + .server + .remote_call_framed_in(opcode, data) + } + + pub(crate) fn remote_call_framed_out( + opcode: Opcode, + data: impl for<'a, 'b> Serialize< + HighSerializer<&'a mut AlignedVec, ArenaHandle<'b>, rkyv::rancor::Failure>, + >, + ) -> Result + where + ::Archived: Deserialize>, + { + Self::get()? + .lock() + .map_err(|_| CUerror::UNKNOWN)? + .server + .remote_call_framed_out(opcode, data) + } +} + +pub(crate) fn cu_init(flags: u32) -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::(Opcode::cuInit, cuInitIn { Flags: flags })?; + Ok(()) +} + +pub(crate) fn cu_ctx_create( + pctx: *mut CUcontext, + flags: ::core::ffi::c_uint, + dev: CUdevice, +) -> Result<(), CUerror> { + return cu_ctx_create_v2(pctx, flags, dev); +} + +pub(crate) fn cu_ctx_create_v2( + pctx: *mut CUcontext, + _flags: ::core::ffi::c_uint, + dev: CUdevice, +) -> Result<(), CUerror> { + let ctx_ref = unsafe { pctx.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + let cu_ctx: CUcontext; + { + let mut state = GlobalState::get()?.lock().map_err(|_| CUerror::UNKNOWN)?; + state.next_context = state.next_context.wrapping_add(1); + let new_ctx = CUcontext(state.next_context as *mut _); + state.context_state.insert(new_ctx, FxHashMap::default()); + cu_ctx = new_ctx; + } + CONTEXT_STACK.with(|stack| { + stack.push(cu_ctx, dev); + }); + *ctx_ref = cu_ctx; + Ok(()) +} + +pub(crate) fn cu_ctx_detach(ctx: CUcontext) -> Result<(), CUerror> { + let ctx_storage = { + let mut state = GlobalState::get()?.lock().map_err(|_| CUerror::UNKNOWN)?; + state.context_state.remove(&ctx).ok_or(CUerror::UNKNOWN)? + }; + for (key, (value, dtor_cb)) in ctx_storage { + if let Some(dtor_cb) = dtor_cb { + dtor_cb(ctx, key as _, value as _); + } + } + Ok(()) +} + +pub(crate) fn cu_ctx_get_api_version( + ctx: CUcontext, + version: *mut ::core::ffi::c_uint, +) -> Result<(), CUerror> { + let version = unsafe { version.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + let ctx = CONTEXT_STACK.with(|s| s.unwrap(ctx))?; + *version = CudaEncode::decode( + GlobalState::remote_call_zero_copy::( + Opcode::cuCtxGetApiVersion, + cuCtxGetApiVersionIn { + ctx: CudaEncode::encode(ctx), + }, + )? + .version, + ); + Ok(()) +} + +pub(crate) fn cu_ctx_get_current(pctx: *mut CUcontext) -> Result<(), CUerror> { + let pctx = unsafe { pctx.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + *pctx = CONTEXT_STACK.with(|s| s.current()).0; + Ok(()) +} + +pub(crate) fn cu_ctx_get_device(device: *mut CUdevice) -> Result<(), CUerror> { + let device = unsafe { device.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + let (_, dev) = CONTEXT_STACK.with(|s| s.current()); + *device = dev; + Ok(()) +} + +pub(crate) fn cu_ctx_synchronize() -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::( + Opcode::cuCtxSynchronize, + cuCtxSynchronizeIn {}, + )?; + Ok(()) +} + +pub(crate) fn cu_device_compute_capability( + major: *mut ::core::ffi::c_int, + minor: *mut ::core::ffi::c_int, + dev: CUdevice, +) -> Result<(), CUerror> { + let major = unsafe { major.as_mut() }; + let minor = unsafe { minor.as_mut() }; + let capability = GlobalState::remote_call_zero_copy::( + Opcode::cuDeviceComputeCapability, + cuDeviceComputeCapabilityIn { dev }, + )?; + if let Some(major) = major { + *major = capability.major; + } + if let Some(minor) = minor { + *minor = capability.minor; + } + Ok(()) +} + +pub(crate) fn cu_device_get( + device: *mut CUdevice, + ordinal: ::core::ffi::c_int, +) -> Result<(), CUerror> { + let device = unsafe { device.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + *device = GlobalState::remote_call_zero_copy::( + Opcode::cuDeviceGet, + cuDeviceGetIn { ordinal }, + )? + .device; + Ok(()) +} + +pub(crate) fn cu_device_get_attribute( + pi: *mut ::core::ffi::c_int, + attrib: CUdevice_attribute, + dev: CUdevice, +) -> Result<(), CUerror> { + let pi = unsafe { pi.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + if attrib.0 == 537396226 { + *pi = 256; + return Ok(()); + } + *pi = GlobalState::remote_call_zero_copy::( + Opcode::cuDeviceGetAttribute, + cuDeviceGetAttributeIn { + attrib: CudaEncode::encode(attrib), + dev, + }, + )? + .pi; + Ok(()) +} + +pub(crate) fn cu_device_get_count(count: *mut ::core::ffi::c_int) -> Result<(), CUerror> { + let count = unsafe { count.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + *count = GlobalState::remote_call_zero_copy::( + Opcode::cuDeviceGetCount, + cuDeviceGetCountIn {}, + )? + .count; + Ok(()) +} + +pub(crate) fn cu_device_get_name( + name: *mut ::core::ffi::c_char, + len: ::core::ffi::c_int, + dev: CUdevice, +) -> Result<(), CUerror> { + if name.is_null() { + return Err(CUerror::INVALID_VALUE); + } + let name_out = GlobalState::remote_call_framed_out::( + Opcode::cuDeviceGetName, + cuDeviceGetNameIn { len, dev }, + )?; + unsafe { + std::ptr::copy_nonoverlapping( + name_out.name.as_ptr() as *const i8, + name, + (len as usize).min(name_out.name.len()), + ) + }; + Ok(()) +} + +pub(crate) fn cu_device_get_properties( + result: *mut CUdevprop, + dev: CUdevice, +) -> Result<(), CUerror> { + let result = unsafe { result.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + let prop = GlobalState::remote_call_zero_copy::( + Opcode::cuDeviceGetProperties, + cuDeviceGetPropertiesIn { dev }, + )? + .prop; + *result = prop.into(); + Ok(()) +} + +pub(crate) fn cu_device_total_mem_v2(bytes: *mut usize, dev: CUdevice) -> Result<(), CUerror> { + let bytes = unsafe { bytes.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + *bytes = GlobalState::remote_call_zero_copy::( + Opcode::cuDeviceTotalMem_v2, + cuDeviceTotalMem_v2In { dev }, + )? + .bytes + .to_native() + .min(u32::MAX as u64) as usize; + Ok(()) +} + +pub(crate) fn cu_driver_get_version( + driver_version: *mut ::core::ffi::c_int, +) -> Result<(), CUerror> { + let driver_version = unsafe { driver_version.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + *driver_version = GlobalState::remote_call_zero_copy::( + Opcode::cuDriverGetVersion, + cuDriverGetVersionIn {}, + )? + .driverVersion; + Ok(()) +} + +pub(crate) fn cu_event_create( + result: *mut CUevent, + flags: ::core::ffi::c_uint, +) -> Result<(), CUerror> { + let result = unsafe { result.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + *result = CudaEncode::decode( + GlobalState::remote_call_zero_copy::( + Opcode::cuEventCreate, + cuEventCreateIn { Flags: flags }, + )? + .phEvent, + ); + Ok(()) +} + +pub(crate) fn cu_event_destroy_v2(event: CUevent) -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::( + Opcode::cuEventDestroy_v2, + cuEventDestroy_v2In { + hEvent: CudaEncode::encode(event), + }, + )?; + Ok(()) +} + +static EXPORT_TABLE: ::dark_api::cuda::CudaDarkApiGlobalTable = + ::dark_api::cuda::CudaDarkApiGlobalTable::new::(); + +pub(crate) fn cu_get_export_table( + pp_export_table: *mut *const ::core::ffi::c_void, + p_export_table_id: *const CUuuid, +) -> Result<(), CUerror> { + if let (Some(result), Some(guid)) = + unsafe { (pp_export_table.as_mut(), p_export_table_id.as_ref()) } + { + if let Some(table) = EXPORT_TABLE.get(guid) { + *result = table.start(); + cuda_types::cuda::CUresult::SUCCESS + } else { + cuda_types::cuda::CUresult::ERROR_NOT_SUPPORTED + } + } else { + cuda_types::cuda::CUresult::ERROR_INVALID_VALUE + } +} + +pub(crate) fn cu_launch_kernel( + f: CUfunction, + grid_dim_x: ::core::ffi::c_uint, + grid_dim_y: ::core::ffi::c_uint, + grid_dim_z: ::core::ffi::c_uint, + block_dim_x: ::core::ffi::c_uint, + block_dim_y: ::core::ffi::c_uint, + block_dim_z: ::core::ffi::c_uint, + shared_mem_bytes: ::core::ffi::c_uint, + stream: CUstream, + kernel_params: *mut *mut ::core::ffi::c_void, + extra: *mut *mut ::core::ffi::c_void, +) -> Result<(), CUerror> { + if !kernel_params.is_null() || extra.is_null() { + return Err(CUerror::NOT_SUPPORTED); + } + let mut state = GlobalState::get()?.lock().map_err(|_| CUerror::UNKNOWN)?; + let args = state.function_args.get(&f).ok_or(CUerror::INVALID_VALUE)?; + let extra_slice = unsafe { std::slice::from_raw_parts(extra, 5) }; + if extra_slice[0] != CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT as _ { + return Err(CUerror::INVALID_VALUE); + } + if extra_slice[2] != CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT as _ { + return Err(CUerror::INVALID_VALUE); + } + if extra_slice[4] != CU_LAUNCH_PARAM_END_AS_INT as _ { + return Err(CUerror::INVALID_VALUE); + } + let arg_ptr = extra_slice[1]; + let arg_size = unsafe { *extra_slice[3].cast::() }; + let mut total_size = 0; + let kernel_params = args + .iter() + .scan( + unsafe { Layout::from_size_align_unchecked(0, 1) }, + |layout, arg_info| { + let (new_layout, offset) = layout.extend(arg_info.to_layout().unwrap()).unwrap(); + total_size = offset + arg_info.size as usize; + *layout = new_layout; + let start = arg_ptr.wrapping_byte_add(offset as usize).cast::(); + Some(Ok(unsafe { + std::slice::from_raw_parts(start, arg_info.size as usize) + } + .to_vec())) + }, + ) + .collect::, CUerror>>()?; + if total_size as usize != arg_size { + return Err(CUerror::INVALID_VALUE); + } + state.server.remote_call_framed_in::( + Opcode::cuLaunchKernel, + cuLaunchKernelIn { + f: CudaEncode::encode(f), + grid_dim_x: u32_le::from_native(grid_dim_x), + grid_dim_y: u32_le::from_native(grid_dim_y), + grid_dim_z: u32_le::from_native(grid_dim_z), + block_dim_x: u32_le::from_native(block_dim_x), + block_dim_y: u32_le::from_native(block_dim_y), + block_dim_z: u32_le::from_native(block_dim_z), + shared_mem_bytes: u32_le::from_native(shared_mem_bytes), + stream: CudaEncode::encode(stream), + kernel_params, + }, + )?; + Ok(()) +} + +pub(crate) fn cu_mem_alloc_v2(dptr: *mut CUdeviceptr, bytesize: usize) -> Result<(), CUerror> { + let dptr = unsafe { dptr.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + *dptr = CudaEncode::decode( + GlobalState::remote_call_zero_copy::( + Opcode::cuMemAlloc_v2, + cuMemAlloc_v2In { + bytesize: u32_le::from_native(bytesize as u32), + }, + )? + .dptr, + ); + Ok(()) +} + +pub(crate) fn cu_mem_free_v2(dptr: CUdeviceptr) -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::( + Opcode::cuMemFree_v2, + cuMemFree_v2In { + dptr: CudaEncode::encode(dptr), + }, + )?; + Ok(()) +} + +pub(crate) fn cu_mem_get_address_range_v2( + pbase: *mut CUdeviceptr, + psize: *mut usize, + dptr: CUdeviceptr, +) -> Result<(), CUerror> { + let pbase = unsafe { pbase.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + let psize = unsafe { psize.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + let result = GlobalState::remote_call_zero_copy::( + Opcode::cuMemGetAddressRange_v2, + cuMemGetAddressRange_v2In { + dptr: CudaEncode::encode(dptr), + }, + )?; + *pbase = CudaEncode::decode(result.pbase); + *psize = result.psize.to_native() as usize; + Ok(()) +} + +pub(crate) fn cu_mem_host_alloc( + result: *mut *mut ::core::ffi::c_void, + bytesize: usize, + _flags: ::core::ffi::c_uint, +) -> Result<(), CUerror> { + let result = unsafe { result.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + *result = unsafe { libc::calloc(1, bytesize) }; + Ok(()) +} + +pub(crate) fn cu_mem_free_host(p: *mut ::core::ffi::c_void) -> Result<(), CUerror> { + if p.is_null() { + return Ok(()); + } + unsafe { libc::free(p) }; + Ok(()) +} + +pub(crate) fn cu_memcpy_dto_d_v2( + dst_device: CUdeviceptr, + src_device: CUdeviceptr, + byte_count: usize, +) -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::( + Opcode::cuMemcpyDtoD_v2, + cuMemcpyDtoD_v2In { + dstDevice: CudaEncode::encode(dst_device), + srcDevice: CudaEncode::encode(src_device), + ByteCount: u32_le::from_native(byte_count as u32), + }, + )?; + Ok(()) +} + +pub(crate) fn cu_memcpy_dto_d_async_v2( + dst_device: CUdeviceptr, + src_device: CUdeviceptr, + byte_count: usize, + stream: CUstream, +) -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::( + Opcode::cuMemcpyDtoDAsync_v2, + cuMemcpyDtoDAsync_v2In { + dstDevice: CudaEncode::encode(dst_device), + srcDevice: CudaEncode::encode(src_device), + ByteCount: u32_le::from_native(byte_count as u32), + hStream: CudaEncode::encode(stream), + }, + )?; + Ok(()) +} + +pub(crate) fn cu_memcpy_dto_h_async_v2( + dst_host: *mut ::core::ffi::c_void, + src_device: CUdeviceptr, + byte_count: usize, + stream: CUstream, +) -> Result<(), CUerror> { + if dst_host.is_null() || src_device.0.is_null() { + return Err(CUerror::INVALID_VALUE); + } + let dst_slice = unsafe { std::slice::from_raw_parts_mut(dst_host.cast::(), byte_count) }; + let result = GlobalState::remote_call_framed_out::( + Opcode::cuMemcpyDtoHAsync_v2, + cuMemcpyDtoHAsync_v2In { + src_device: CudaEncode::encode(src_device), + stream: CudaEncode::encode(stream), + byte_count: u32_le::from_native(byte_count as u32), + }, + )?; + dst_slice.copy_from_slice(&result.dst_host); + Ok(()) +} + +pub(crate) fn cu_memcpy_hto_d_async_v2( + dst_device: CUdeviceptr, + src_host: *const ::core::ffi::c_void, + byte_count: usize, + h_stream: CUstream, +) -> Result<(), CUerror> { + if src_host.is_null() || dst_device.0.is_null() { + return Err(CUerror::INVALID_VALUE); + } + let slice = unsafe { std::slice::from_raw_parts(src_host.cast::(), byte_count) }; + GlobalState::remote_call_framed_in::( + Opcode::cuMemcpyHtoDAsync_v2, + cuMemcpyHtoDAsync_v2In { + dst_device: CudaEncode::encode(dst_device), + src_host: slice.to_vec(), + stream: CudaEncode::encode(h_stream), + }, + )?; + Ok(()) +} + +pub(crate) fn cu_memset_d8_v2( + dst_device: CUdeviceptr, + uc: ::core::ffi::c_uchar, + n: usize, +) -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::( + Opcode::cuMemsetD8_v2, + cuMemsetD8_v2In { + dstDevice: CudaEncode::encode(dst_device), + uc, + N: u32_le::from_native(n as u32), + }, + )?; + Ok(()) +} + +pub(crate) fn cu_module_get_function( + hfunc: *mut CUfunction, + hmod: CUmodule, + name: *const ::core::ffi::c_char, +) -> Result<(), CUerror> { + let hfunc = unsafe { hfunc.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + let mut state = GlobalState::get()?.lock().map_err(|_| CUerror::UNKNOWN)?; + *hfunc = CUfunction( + state + .server + .remote_call_framed_in::( + Opcode::cuModuleGetFunction, + cuModuleGetFunctionIn { + hmod: CudaEncode::encode(hmod), + name: unsafe { std::ffi::CStr::from_ptr(name) } + .to_bytes_with_nul() + .to_vec(), + }, + )? + .hfunc + .to_native() as _, + ); + let arg_sizes_out = state + .server + .remote_call_framed_out::( + Opcode::zludaGetFunctionArgs, + zludaGetFunctionArgsIn { + f: CudaEncode::encode(*hfunc), + }, + )?; + state.function_args.insert(*hfunc, arg_sizes_out.args); + Ok(()) +} + +pub(crate) fn cu_module_get_global_v2( + dptr: *mut CUdeviceptr, + bytes: *mut usize, + hmod: CUmodule, + name: *const ::core::ffi::c_char, +) -> Result<(), CUerror> { + let mut bytes_fallback = 0usize; + let dptr = unsafe { dptr.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + let bytes = unsafe { bytes.as_mut() }.unwrap_or(&mut bytes_fallback); + let result = GlobalState::remote_call_framed_in::( + Opcode::cuModuleGetGlobal_v2, + cuModuleGetGlobal_v2In { + hmod: CudaEncode::encode(hmod), + name: unsafe { std::ffi::CStr::from_ptr(name) } + .to_bytes() + .to_vec(), + }, + )?; + *dptr = CudaEncode::decode(result.dptr); + *bytes = result.bytes.to_native() as usize; + Ok(()) +} + +pub(crate) fn cu_module_get_tex_ref( + texref: *mut CUtexref, + hmod: CUmodule, + name: *const ::core::ffi::c_char, +) -> Result<(), CUerror> { + let texref = unsafe { texref.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + let result = GlobalState::remote_call_framed_in::( + Opcode::cuModuleGetTexRef, + cuModuleGetTexRefIn { + hmod: CudaEncode::encode(hmod), + name: unsafe { std::ffi::CStr::from_ptr(name) } + .to_bytes_with_nul() + .to_vec(), + }, + )?; + *texref = CudaEncode::decode(result.texref); + Ok(()) +} + +pub(crate) fn cu_stream_create( + result: *mut CUstream, + flags: ::core::ffi::c_uint, +) -> Result<(), CUerror> { + let result = unsafe { result.as_mut() }.ok_or(CUerror::INVALID_VALUE)?; + *result = CudaEncode::decode( + GlobalState::remote_call_zero_copy::( + Opcode::cuStreamCreate, + cuStreamCreateIn { Flags: flags }, + )? + .phStream, + ); + Ok(()) +} + +pub(crate) fn cu_stream_destroy_v2(stream: CUstream) -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::( + Opcode::cuStreamDestroy_v2, + cuStreamDestroy_v2In { + hStream: CudaEncode::encode(stream), + }, + )?; + Ok(()) +} + +pub(crate) fn cu_tex_ref_set_address_mode( + _tex_ref: CUtexref, + _dim: ::core::ffi::c_int, + _am: CUaddress_mode, +) -> Result<(), CUerror> { + // TODO + Ok(()) +} + +pub(crate) fn cu_tex_ref_set_address_v2( + byte_offset: *mut usize, + tex_ref: CUtexref, + dptr: CUdeviceptr, + bytes: usize, +) -> Result<(), CUerror> { + let mut bytes_fallback = 0usize; + let byte_offset = unsafe { byte_offset.as_mut() }.unwrap_or(&mut bytes_fallback); + let result = GlobalState::remote_call_zero_copy::( + Opcode::cuTexRefSetAddress_v2, + cuTexRefSetAddress_v2In { + hTexRef: CudaEncode::encode(tex_ref), + dptr: CudaEncode::encode(dptr), + bytes: u32_le::from_native(bytes as u32), + }, + )?; + *byte_offset = CudaEncode::decode(result.ByteOffset); + Ok(()) +} + +pub(crate) fn cu_tex_ref_set_filter_mode( + _tex_ref: CUtexref, + _fm: CUfilter_mode, +) -> Result<(), CUerror> { + // TODO + Ok(()) +} + +pub(crate) fn cu_tex_ref_set_flags( + tex_ref: CUtexref, + flags: ::core::ffi::c_uint, +) -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::( + Opcode::cuTexRefSetFlags, + cuTexRefSetFlagsIn { + hTexRef: CudaEncode::encode(tex_ref), + Flags: flags, + }, + )?; + Ok(()) +} + +pub(crate) fn cu_tex_ref_set_format( + tex_ref: CUtexref, + fmt: CUarray_format, + num_packed_components: ::core::ffi::c_int, +) -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::( + Opcode::cuTexRefSetFormat, + cuTexRefSetFormatIn { + hTexRef: CudaEncode::encode(tex_ref), + fmt: fmt.0.into(), + NumPackedComponents: num_packed_components, + }, + )?; + Ok(()) +} + +pub(crate) fn cu_tex_ref_set_max_anisotropy( + _tex_ref: CUtexref, + _max_aniso: ::core::ffi::c_uint, +) -> Result<(), CUerror> { + // TODO + Ok(()) +} + +pub(crate) fn cu_tex_ref_set_mipmap_filter_mode( + _tex_ref: CUtexref, + _fm: CUfilter_mode, +) -> Result<(), CUerror> { + // TODO + Ok(()) +} + +pub(crate) fn cu_tex_ref_set_mipmap_level_bias( + _tex_ref: CUtexref, + _bias: f32, +) -> Result<(), CUerror> { + // TODO + Ok(()) +} + +pub(crate) fn cu_tex_ref_set_mipmap_level_clamp( + _tex_ref: CUtexref, + _min_mipmap_level_clamp: f32, + _max_mipmap_level_clamp: f32, +) -> Result<(), CUerror> { + // TODO + Ok(()) +} + +pub(crate) fn cu_event_query(event: cuda_types::cuda::CUevent) -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::( + Opcode::cuEventQuery, + cuEventQueryIn { + hEvent: CudaEncode::encode(event), + }, + )?; + Ok(()) +} + +pub(crate) fn cu_event_record( + event: cuda_types::cuda::CUevent, + stream: cuda_types::cuda::CUstream, +) -> Result<(), CUerror> { + GlobalState::remote_call_zero_copy::( + Opcode::cuEventRecord, + cuEventRecordIn { + hEvent: CudaEncode::encode(event), + hStream: CudaEncode::encode(stream), + }, + )?; + Ok(()) +} + +pub(crate) fn cu_ctx_set_cache_config( + _config: cuda_types::cuda::CUfunc_cache, +) -> Result<(), CUerror> { + Ok(()) +} + +struct UnknownBuffer { + buffer: std::cell::UnsafeCell<[u32; S]>, +} + +impl UnknownBuffer { + const fn new() -> Self { + UnknownBuffer { + buffer: std::cell::UnsafeCell::new([0; S]), + } + } + const fn len(&self) -> usize { + S + } +} + +unsafe impl Sync for UnknownBuffer {} + +static UNKNOWN_BUFFER1: UnknownBuffer<1024> = UnknownBuffer::new(); +static UNKNOWN_BUFFER2: UnknownBuffer<14> = UnknownBuffer::new(); + +struct DarkApi32; + +#[repr(C)] +struct AllocRecord { + x: usize, + y: usize, +} + +impl CudaDarkApi for DarkApi32 { + unsafe extern "system" fn get_module_from_cubin( + result: *mut cuda_types::cuda::CUmodule, + fatbinc_wrapper: *const cuda_types::dark_api::FatbincWrapper, + ) -> cuda_types::cuda::CUresult { + let result = match result.as_mut() { + Some(p) => p, + None => return CUresult::ERROR_INVALID_VALUE, + }; + let code_lib = CodeLibraryRef::try_load(fatbinc_wrapper.cast()) + .map_err(|_| CUerror::NO_BINARY_FOR_GPU)?; + let mut modules = Vec::with_capacity(1); + code_lib.iterate_modules(|_, module| match module { + Ok(CodeModuleRef::Text(ptx)) => { + modules.push(std::borrow::Cow::Borrowed(ptx.as_bytes())); + } + Ok(CodeModuleRef::File(file)) => { + if file.kind() == "ptx" { + if let Ok(text) = file.get_or_decompress_content(false) { + modules.push(text); + } + } + } + _ => {} + }); + let mut last_module = + unwrap_or::unwrap_some_or!(modules.pop(), return Err(CUerror::NO_BINARY_FOR_GPU)); + if last_module.last() != Some(&0) { + last_module.to_mut().push(0); + } + *result = CUmodule( + GlobalState::remote_call_framed_in::( + Opcode::cuModuleLoadData, + cuModuleLoadDataIn { + image: last_module.into_owned(), + }, + )? + .module + .to_native() as _, + ); + Ok(()) + } + + unsafe extern "system" fn cudart_interface_fn2( + pctx: *mut cuda_types::cuda::CUcontext, + _dev: cuda_types::cuda::CUdevice, + ) -> cuda_types::cuda::CUresult { + let ctx = unsafe { pctx.as_mut() }.ok_or(cuda_types::cuda::CUerror::INVALID_VALUE)?; + *ctx = CUcontext(0xDEADBEEFu32 as _); + cuda_types::cuda::CUresult::SUCCESS + } + + unsafe extern "system" fn get_module_from_cubin_ext1( + _result: *mut cuda_types::cuda::CUmodule, + _fatbinc_wrapper: *const cuda_types::dark_api::FatbincWrapper, + _arg3: *mut std::ffi::c_void, + _arg4: *mut std::ffi::c_void, + _arg5: u32, + ) -> cuda_types::cuda::CUresult { + Err(CUerror::NOT_SUPPORTED) + } + + unsafe extern "system" fn cudart_interface_fn7(_arg1: usize) -> () { + () + } + + unsafe extern "system" fn get_module_from_cubin_ext2( + _fatbin_header: *const cuda_types::dark_api::FatbinHeader, + _result: *mut cuda_types::cuda::CUmodule, + _arg3: *mut std::ffi::c_void, + _arg4: *mut std::ffi::c_void, + _arg5: u32, + ) -> cuda_types::cuda::CUresult { + Err(CUerror::NOT_SUPPORTED) + } + + unsafe extern "system" fn load_compilers() -> cuda_types::cuda::CUresult { + Err(CUerror::NOT_SUPPORTED) + } + + unsafe extern "system" fn get_unknown_buffer1( + ptr: *mut *mut std::ffi::c_void, + size: *mut usize, + ) -> () { + *ptr = UNKNOWN_BUFFER1.buffer.get() as *mut std::ffi::c_void; + *size = UNKNOWN_BUFFER1.len(); + } + + unsafe extern "system" fn get_unknown_buffer2( + ptr: *mut *mut std::ffi::c_void, + size: *mut usize, + ) -> () { + *ptr = UNKNOWN_BUFFER2.buffer.get() as *mut std::ffi::c_void; + *size = UNKNOWN_BUFFER2.len(); + } + + unsafe extern "system" fn context_local_storage_put( + cu_ctx: cuda_types::cuda::CUcontext, + key: *mut std::ffi::c_void, + value: *mut std::ffi::c_void, + _dtor_cb: Option< + extern "system" fn( + cuda_types::cuda::CUcontext, + *mut std::ffi::c_void, + *mut std::ffi::c_void, + ), + >, + ) -> cuda_types::cuda::CUresult { + if !initialized() { + return Err(CUerror::DEINITIALIZED); + } + let cu_ctx = CONTEXT_STACK.with(|s| s.unwrap(cu_ctx))?; + let mut state = GlobalState::get()?.lock().map_err(|_| CUerror::UNKNOWN)?; + let ctx_storage = state + .context_state + .get_mut(&cu_ctx) + .ok_or(CUerror::INVALID_VALUE)?; + ctx_storage.insert(key as _, (value as _, _dtor_cb)); + Ok(()) + } + + unsafe extern "system" fn context_local_storage_delete( + cu_ctx: cuda_types::cuda::CUcontext, + key: *mut std::ffi::c_void, + ) -> cuda_types::cuda::CUresult { + if !initialized() { + return Err(CUerror::DEINITIALIZED); + } + let cu_ctx = CONTEXT_STACK.with(|s| s.unwrap(cu_ctx))?; + let mut state = GlobalState::get()?.lock().map_err(|_| CUerror::UNKNOWN)?; + let ctx_storage = state + .context_state + .get_mut(&cu_ctx) + .ok_or(CUerror::INVALID_VALUE)?; + let key = key as usize; + ctx_storage.remove(&key); + Ok(()) + } + + unsafe extern "system" fn context_local_storage_get( + value: *mut *mut std::ffi::c_void, + cu_ctx: cuda_types::cuda::CUcontext, + key: *mut std::ffi::c_void, + ) -> cuda_types::cuda::CUresult { + if !initialized() { + return Err(CUerror::DEINITIALIZED); + } + let value = unsafe { value.as_mut() }.ok_or(cuda_types::cuda::CUerror::INVALID_VALUE)?; + let stored_value = { + let cu_ctx = CONTEXT_STACK.with(|s| s.unwrap(cu_ctx))?; + let mut state = GlobalState::get()?.lock().map_err(|_| CUerror::UNKNOWN)?; + let ctx_storage = state + .context_state + .get_mut(&cu_ctx) + .ok_or(CUerror::INVALID_VALUE)?; + let key = key as usize; + ctx_storage.get(&key).ok_or(CUerror::INVALID_VALUE)?.0 + }; + *value = stored_value as _; + Ok(()) + } + + unsafe extern "system" fn ctx_create_v2_bypass( + pctx: *mut cuda_types::cuda::CUcontext, + flags: ::std::os::raw::c_uint, + dev: cuda_types::cuda::CUdevice, + ) -> cuda_types::cuda::CUresult { + cu_ctx_create_v2(pctx, flags, dev) + } + + unsafe extern "system" fn heap_alloc( + heap_alloc_record_ptr: *mut *const std::ffi::c_void, + arg2: usize, + arg3: usize, + ) -> cuda_types::cuda::CUresult { + let heap_alloc_record_ptr = heap_alloc_record_ptr as *mut *mut AllocRecord; + let alloc_record = Box::into_raw(Box::new(AllocRecord { x: arg2, y: arg3 })); + *heap_alloc_record_ptr = alloc_record; + Ok(()) + } + + unsafe extern "system" fn heap_free( + heap_alloc_record_ptr: *const std::ffi::c_void, + arg2: *mut usize, + ) -> cuda_types::cuda::CUresult { + if !initialized() { + return Err(CUerror::DEINITIALIZED); + } + let heap_alloc_record_ptr = heap_alloc_record_ptr as *mut AllocRecord; + let record = Box::from_raw(heap_alloc_record_ptr); + if !arg2.is_null() { + *arg2 = record.y; + } + Ok(()) + } + + unsafe extern "system" fn device_get_attribute_ext( + _dev: cuda_types::cuda::CUdevice, + _attribute: std::ffi::c_uint, + _unknown: std::ffi::c_int, + _result: *mut [usize; 2], + ) -> cuda_types::cuda::CUresult { + Err(CUerror::NOT_SUPPORTED) + } + + unsafe extern "system" fn device_get_something( + _result: *mut std::ffi::c_uchar, + _dev: cuda_types::cuda::CUdevice, + ) -> cuda_types::cuda::CUresult { + Err(CUerror::NOT_SUPPORTED) + } + + unsafe extern "system" fn integrity_check( + _version: u32, + _unix_seconds: u64, + _result: *mut [u64; 2], + ) -> cuda_types::cuda::CUresult { + Err(CUerror::NOT_SUPPORTED) + } + + unsafe extern "system" fn context_check( + _ctx_in: cuda_types::cuda::CUcontext, + _result1: *mut u32, + _result2: *mut *const std::ffi::c_void, + ) -> cuda_types::cuda::CUresult { + Err(CUerror::NOT_SUPPORTED) + } + + unsafe extern "system" fn check_fn3() -> u32 { + 0 + } + + unsafe extern "system" fn hybrid_runtime_load_get_proc_address( + _name: *const std::ffi::c_char, + _fn_ptr: *mut *const std::ffi::c_void, + _token: *mut usize, + ) -> cuda_types::cuda::CUresult { + Err(CUerror::NOT_SUPPORTED) + } + + unsafe extern "system" fn hybrid_runtime_free(_token: usize) -> cuda_types::cuda::CUresult { + Err(CUerror::NOT_SUPPORTED) + } +} + +const DLL_PROCESS_DETACH: u32 = 0; + +#[allow(non_snake_case, unused_variables)] +#[no_mangle] +extern "system" fn DllMain(_dll_module: *const c_void, call_reason: u32, _: *const c_void) -> bool { + if call_reason == DLL_PROCESS_DETACH { + deinitialize(); + } + true +} + +static INITIALIZED: AtomicBool = AtomicBool::new(true); + +fn initialized() -> bool { + INITIALIZED.load(std::sync::atomic::Ordering::SeqCst) +} + +fn deinitialize() { + INITIALIZED.store(false, std::sync::atomic::Ordering::SeqCst); +} diff --git a/zluda64_server/Cargo.toml b/zluda64_server/Cargo.toml new file mode 100644 index 000000000..193c9bfb1 --- /dev/null +++ b/zluda64_server/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "zluda64_server" +version = "0.0.0" +authors = ["Andrzej Janik "] +edition = "2021" + +[[bin]] +name = "zluda64_server" +path = "src/main.rs" + +[dependencies] +cuda_types = { path = "../cuda_types" } +cuda_macros = { path = "../cuda_macros" } +zluda_server_common = { path = "../zluda_server_common" } +dark_api = { path = "../dark_api" } +windows-sys = { version = "0.61.2", features = ["Win32_Foundation"] } +compio = { version = "0.18", features = ["macros", "fs"] } +slab = "0.4.12" +rkyv = "0.8" +rustc-hash = "2.0.0" +range-alloc = "0.1.5" + +[package.metadata.zluda] +windows_only = true diff --git a/zluda64_server/src/main.rs b/zluda64_server/src/main.rs new file mode 100644 index 000000000..0078c71a6 --- /dev/null +++ b/zluda64_server/src/main.rs @@ -0,0 +1,1309 @@ +// Prevent the console window from appearing when running the server on Windows +#![windows_subsystem = "windows"] + +use compio::{ + buf::{buf_try, IoBuf, IoBufMut, ReserveError, ReserveExactError, SetLen}, + fs::named_pipe::{ClientOptions, NamedPipeClient}, + io::{AsyncReadExt, AsyncWriteExt}, + BufResult, +}; +use cuda_macros::cuda_function_declarations; +use cuda_types::cuda::*; +use dark_api::FunctionArgInfo; +use rkyv::{ + api::high::HighSerializer, + rend::{u32_le, u64_le}, + ser::allocator::ArenaHandle, + util::AlignedVec, + Archive, Portable, Serialize, +}; +use rustc_hash::FxHashMap; +use slab::Slab; +use std::{ + collections::BTreeMap, + ffi::{c_void, CStr}, + mem, + ops::Range, + ptr, + rc::Rc, +}; +use zluda_server_common::*; + +struct State { + ctx: CUcontext, + device: i32, + handles: HandlePool, + devmemory: Allocator, + modules: ModuleLaunchData, +} + +struct HandlePool { + handles: Slab, +} + +impl HandlePool { + const OFFSET: u32 = 512 * 1024 * 1024; + + fn new() -> Self { + Self { + handles: Slab::new(), + } + } + + fn insert(&mut self, handle: *mut T) -> u32 { + (self.handles.insert(handle as usize) as u32) + Self::OFFSET + } + + fn get(&self, id: u32) -> Result<*mut T, CUerror> { + if id == 0 { + return Ok(ptr::null_mut()); + } + let idx = id.checked_sub(Self::OFFSET).ok_or(CUerror::INVALID_VALUE)? as usize; + self.handles + .get(idx) + .map(|&handle| handle as *mut T) + .ok_or(CUerror::INVALID_VALUE) + } + + fn remove(&mut self, id: u32) -> Result<*mut T, CUerror> { + if id == 0 { + return Err(CUerror::INVALID_VALUE); + } + let idx = id.checked_sub(Self::OFFSET).ok_or(CUerror::INVALID_VALUE)? as usize; + self.handles + .try_remove(idx) + .map(|handle| handle as *mut T) + .ok_or(CUerror::INVALID_VALUE) + } +} + +struct ModuleLaunchData { + dark_api: dark_api::zluda32::Zluda32Internal, + modules: FxHashMap, + functions: FxHashMap, +} + +impl ModuleLaunchData { + fn new() -> Result { + let mut zluda32_ptr = unsafe { mem::zeroed() }; + unsafe { cuGetExportTable(&mut zluda32_ptr, &dark_api::zluda32::Zluda32Internal::GUID) }?; + let zluda32 = unsafe { dark_api::zluda32::Zluda32Internal::new(zluda32_ptr) }; + Ok(Self { + dark_api: zluda32, + modules: FxHashMap::default(), + functions: FxHashMap::default(), + }) + } + + unsafe fn new_module( + &mut self, + devmemory: &mut Allocator, + module: CUmodule, + ) -> Result<(), CUerror> { + let mut count = 0; + self.dark_api.get_module_globals( + ptr::null_mut(), + ptr::null_mut(), + ptr::null_mut(), + ptr::null_mut(), + &mut count, + module, + )?; + let mut names = vec![mem::zeroed(); count as usize]; + let mut initializers = vec![mem::zeroed(); count as usize]; + let mut sizes = vec![mem::zeroed(); count as usize]; + let mut alignments = vec![mem::zeroed(); count as usize]; + self.dark_api.get_module_globals( + names.as_mut_ptr(), + initializers.as_mut_ptr(), + sizes.as_mut_ptr(), + alignments.as_mut_ptr(), + &mut count, + module, + )?; + let globals = (0..count as usize) + .map(|i| { + if alignments[i] > Allocator::ALLOCATION_UNIT { + return Err(CUerror::OUT_OF_MEMORY); + } + let initializer = std::slice::from_raw_parts(initializers[i], sizes[i] as usize); + let allocation = devmemory.alloc_range(sizes[i])?; + let devptr = devmemory.translate_range(allocation.clone())?; + unsafe { + cuMemcpyHtoD_v2( + CUdeviceptr_v2(devptr), + initializer.as_ptr().cast(), + initializer.len(), + ) + }?; + Ok::<_, CUerror>(Global { + name: unsafe { CStr::from_ptr(names[i].cast()) } + .to_string_lossy() + .into_owned(), + allocation, + size: sizes[i], + }) + }) + .collect::, _>>()?; + let module_data = Module { + globals: Rc::new(globals), + texrefs: FxHashMap::default(), + }; + self.modules.insert(module, module_data); + Ok(()) + } +} + +struct Module { + globals: Rc>, + texrefs: FxHashMap, u32>, +} + +struct Global { + name: String, + allocation: Range, + size: u32, +} + +impl Global { + fn address(&self) -> u32 { + self.allocation.start * Allocator::ALLOCATION_UNIT + } +} + +struct Function { + globals: Rc>, +} + +struct Allocator { + start: Option<*mut c_void>, + allocator: range_alloc::RangeAllocator, + allocation_ends: BTreeMap, +} + +impl Allocator { + // This should be at least a multiple of texture pitch + // otherwise fluidmark fails in myserious ways + // I could query at runtime, but it's hard to imagine a GPU + // with larger pitch + const ALLOCATION_UNIT: u32 = 256; + const ALLOCATOR_SIZE: u32 = 512 * 1024 * 1024; // 512 MiB + + fn new() -> Self { + Self { + start: None, + allocator: range_alloc::RangeAllocator::new( + // starting from 1 to avoid handing out null pointers + 1..Self::ALLOCATOR_SIZE / Self::ALLOCATION_UNIT, + ), + allocation_ends: BTreeMap::new(), + } + } + + fn get_or_allocate_device_ptr(&mut self) -> Result<*mut c_void, CUerror> { + match self.start { + Some(ptr) => Ok(ptr), + None => { + let mut dev_ptr = CUdeviceptr_v2(ptr::null_mut()); + unsafe { cuMemAlloc_v2(&mut dev_ptr, Self::ALLOCATOR_SIZE as usize) }?; + self.start = Some(dev_ptr.0); + Ok(dev_ptr.0) + } + } + } + + fn get_device_ptr(&self) -> Result<*mut c_void, CUerror> { + self.start.ok_or(CUerror::INVALID_VALUE) + } + + fn alloc_range(&mut self, size: u32) -> Result, CUerror> { + self.get_or_allocate_device_ptr()?; + let units = size.next_multiple_of(Self::ALLOCATION_UNIT) / Self::ALLOCATION_UNIT; + self.allocator + .allocate_range(units) + .map_err(|_| CUerror::OUT_OF_MEMORY) + } + + fn alloc(&mut self, size: u32) -> Result { + let offset = self.alloc_range(size)?; + self.allocation_ends.insert(offset.start, offset.end); + Ok(offset.start * Self::ALLOCATION_UNIT) + } + + fn free(&mut self, start: u32) -> Result<(), CUerror> { + let start_in_units = start / Allocator::ALLOCATION_UNIT; + let end = self + .allocation_ends + .remove(&start_in_units) + .ok_or(CUerror::INVALID_VALUE)?; + self.allocator.free_range(start_in_units..end); + Ok(()) + } + + fn translate(&self, offset: u32) -> Result<*mut c_void, CUerror> { + if offset == 0 { + return Ok(ptr::null_mut()); + } + let base_ptr = self.get_device_ptr()?; + Ok(base_ptr.wrapping_byte_add(offset as usize)) + } + + fn translate_range(&self, range: Range) -> Result<*mut c_void, CUerror> { + let base_ptr = self.get_device_ptr()?; + Ok(base_ptr.wrapping_byte_add(range.start as usize * Self::ALLOCATION_UNIT as usize)) + } + + fn get_range(&self, mut offset: u32) -> Option> { + offset /= Self::ALLOCATION_UNIT; + // Find last pair where `start <= ptr` + let (start, alloc) = self.allocation_ends.range(..=offset).rev().next()?; + let range = *start..*alloc; + // Check if allocation contains the pointer + if range.contains(&offset) { + Some(range) + } else { + None + } + } +} + +impl State { + fn new() -> Result { + unsafe { cuInit(0) }?; + let mut ctx = unsafe { mem::zeroed() }; + let device = 0; + unsafe { cuDevicePrimaryCtxRetain(&mut ctx, device) }?; + unsafe { cuCtxSetCurrent(ctx) }?; + Ok(Self { + ctx, + device, + handles: HandlePool::new(), + devmemory: Allocator::new(), + modules: ModuleLaunchData::new()?, + }) + } +} + +#[compio::main] +async fn main() -> std::io::Result<()> { + let pipe_name = std::env::args_os().nth(1).ok_or(std::io::Error::new( + std::io::ErrorKind::InvalidInput, + "Pipe name not provided", + ))?; + let mut client = ClientOptions::new() + .pipe_mode(compio::fs::named_pipe::PipeMode::Byte) + .read(true) + .write(true) + .open(pipe_name) + .await?; + let mut buffer = AlignedVecBuffer(AlignedVec::new()); + let mut state = State::new().map_err(|_| { + std::io::Error::new( + std::io::ErrorKind::Other, + "Failed to initialize CUDA context", + ) + })?; + loop { + let opcode = client.read_u32_le().await?; // Read the length prefix + buffer.clear(); + match Opcode::from_repr(opcode) { + Some(Opcode::cuInit) => { + buffer = handle_cuda_function::(&mut client, buffer, cu_init) + .await?; + } + Some(Opcode::cuDeviceGetCount) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + cu_device_get_count, + ) + .await?; + } + Some(Opcode::cuDeviceGetAttribute) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_device_get_attribute(&mut state, input), + ) + .await?; + } + Some(Opcode::cuDeviceGet) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_device_get(&mut state, input), + ) + .await?; + } + Some(Opcode::cuDriverGetVersion) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + cu_driver_get_version, + ) + .await?; + } + Some(Opcode::cuDeviceGetName) => { + buffer = handle_cuda_function_framed_out::( + &mut client, + buffer, + |input| cu_device_get_name(&mut state, input), + ) + .await?; + } + Some(Opcode::cuDeviceTotalMem_v2) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_device_total_mem_v2(&mut state, input), + ) + .await?; + } + Some(Opcode::cuCtxGetApiVersion) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_ctx_get_api_version(&mut state, input), + ) + .await?; + } + Some(Opcode::cuModuleLoadData) => { + buffer = handle_cuda_function_framed_in::( + &mut client, + buffer, + |input| cu_module_load_data(&mut state, input), + ) + .await?; + } + Some(Opcode::cuModuleGetFunction) => { + buffer = handle_cuda_function_framed_in::< + cuModuleGetFunctionIn, + cuModuleGetFunctionOut, + >(&mut client, buffer, |input| { + cu_module_get_function(&mut state, input) + }) + .await?; + } + Some(Opcode::cuModuleGetGlobal_v2) => { + buffer = handle_cuda_function_framed_in::< + cuModuleGetGlobal_v2In, + cuModuleGetGlobal_v2Out, + >(&mut client, buffer, |input| { + cu_module_get_global_v2(&mut state, input) + }) + .await?; + } + Some(Opcode::cuMemAlloc_v2) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_mem_alloc_v2(&mut state, input), + ) + .await?; + } + Some(Opcode::cuMemcpyHtoDAsync_v2) => { + buffer = handle_cuda_function_framed_in::< + cuMemcpyHtoDAsync_v2In, + cuMemcpyHtoDAsync_v2Out, + >(&mut client, buffer, |input| { + cu_memcpy_hto_d_async_v2(&mut state, input) + }) + .await?; + } + Some(Opcode::cuModuleGetTexRef) => { + buffer = + handle_cuda_function_framed_in::( + &mut client, + buffer, + |input| cu_module_get_tex_ref(&mut state, input), + ) + .await?; + } + Some(Opcode::zludaGetFunctionArgs) => { + buffer = handle_cuda_function_framed_out::< + zludaGetFunctionArgsIn, + zludaGetFunctionArgsOut, + >(&mut client, buffer, |input| { + zluda_get_function_args(&mut state, input) + }) + .await?; + } + Some(Opcode::cuLaunchKernel) => { + buffer = handle_cuda_function_framed_in::( + &mut client, + buffer, + |input| cu_launch_kernel(&mut state, input), + ) + .await?; + } + Some(Opcode::cuCtxSynchronize) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + cu_ctx_synchronize, + ) + .await?; + } + Some(Opcode::cuMemcpyDtoHAsync_v2) => { + buffer = handle_cuda_function_framed_out::< + cuMemcpyDtoHAsync_v2In, + cuMemcpyDtoHAsync_v2Out, + >(&mut client, buffer, |input| { + cu_memcpy_dtoh_async_v2(&mut state, input) + }) + .await?; + } + Some(Opcode::cuMemGetAddressRange_v2) => { + buffer = handle_cuda_function::< + cuMemGetAddressRange_v2In, + cuMemGetAddressRange_v2Out, + >(&mut client, buffer, |input| { + cu_mem_get_address_range_v2(&mut state, input) + }) + .await?; + } + Some(Opcode::cuTexRefSetAddress_v2) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_tex_ref_set_address_v2(&mut state, input), + ) + .await?; + } + Some(Opcode::cuTexRefSetFlags) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_tex_ref_set_flags(&mut state, input), + ) + .await?; + } + Some(Opcode::cuTexRefSetFormat) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_tex_ref_set_format(&mut state, input), + ) + .await?; + } + Some(Opcode::cuMemFree_v2) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_mem_free_v2(&mut state, input), + ) + .await?; + } + Some(Opcode::cuDeviceComputeCapability) => { + buffer = handle_cuda_function::< + cuDeviceComputeCapabilityIn, + cuDeviceComputeCapabilityOut, + >(&mut client, buffer, cu_device_compute_capability) + .await?; + } + Some(Opcode::cuDeviceGetProperties) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + cu_device_get_properties, + ) + .await?; + } + Some(Opcode::cuStreamCreate) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_stream_create(&mut state, input), + ) + .await?; + } + Some(Opcode::cuStreamDestroy_v2) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_stream_destroy_v2(&mut state, input), + ) + .await?; + } + Some(Opcode::cuEventCreate) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_event_create(&mut state, input), + ) + .await?; + } + Some(Opcode::cuEventDestroy_v2) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_event_destroy_v2(&mut state, input), + ) + .await?; + } + Some(Opcode::cuMemsetD8_v2) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_memset_d8_v2(&mut state, input), + ) + .await?; + } + Some(Opcode::cuMemcpyDtoDAsync_v2) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_memcpy_dto_d_async_v2(&mut state, input), + ) + .await?; + } + Some(Opcode::cuMemcpyDtoD_v2) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_memcpy_dto_d_v2(&mut state, input), + ) + .await?; + } + Some(Opcode::cuEventQuery) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_event_query(&mut state, input), + ) + .await?; + } + Some(Opcode::cuEventRecord) => { + buffer = handle_cuda_function::( + &mut client, + buffer, + |input| cu_event_record(&mut state, input), + ) + .await?; + } + _ => { + client.write_u32_le(CUerror::NOT_SUPPORTED.0.get()).await?; + return Err(std::io::Error::new( + std::io::ErrorKind::Other, + "Unsupported operation", + )); + } + } + } +} + +fn cu_event_query( + state: &mut State, + input: &ArchivedcuEventQueryIn, +) -> Result { + let event = input.hEvent.to_native(); + let cu_event = state.handles.get(event)?; + unsafe { cuEventQuery(cu_event) }?; + Ok(cuEventQueryOut {}) +} + +fn cu_event_record( + state: &mut State, + input: &ArchivedcuEventRecordIn, +) -> Result { + let event = input.hEvent.to_native(); + let cu_event = state.handles.get(event)?; + let stream = input.hStream.to_native(); + let cu_stream = CUstream(state.handles.get(stream)?); + unsafe { cuEventRecord(cu_event, cu_stream) }?; + Ok(cuEventRecordOut {}) +} + +fn cu_memcpy_dto_d_v2( + state: &mut State, + input: &ArchivedcuMemcpyDtoD_v2In, +) -> Result { + let dst_device = CUdeviceptr_v2(state.devmemory.translate(input.dstDevice.to_native())?); + let src_device = CUdeviceptr_v2(state.devmemory.translate(input.srcDevice.to_native())?); + let byte_count = input.ByteCount.to_native(); + unsafe { cuMemcpyDtoD_v2(dst_device, src_device, byte_count as usize) }?; + Ok(cuMemcpyDtoD_v2Out {}) +} + +fn cu_memcpy_dto_d_async_v2( + state: &mut State, + input: &ArchivedcuMemcpyDtoDAsync_v2In, +) -> Result { + let dst_device = CUdeviceptr_v2(state.devmemory.translate(input.dstDevice.to_native())?); + let src_device = CUdeviceptr_v2(state.devmemory.translate(input.srcDevice.to_native())?); + let byte_count = input.ByteCount.to_native(); + let cu_stream = CUstream(state.handles.get(input.hStream.to_native())?); + unsafe { cuMemcpyDtoDAsync_v2(dst_device, src_device, byte_count as usize, cu_stream) }?; + Ok(cuMemcpyDtoDAsync_v2Out {}) +} + +fn cu_memset_d8_v2( + state: &mut State, + input: &ArchivedcuMemsetD8_v2In, +) -> Result { + let dptr = CUdeviceptr_v2(state.devmemory.translate(input.dstDevice.to_native())?); + let uc = input.uc; + let n = input.N.to_native(); + unsafe { cuMemsetD8_v2(dptr, uc, n as usize) }?; + Ok(cuMemsetD8_v2Out {}) +} + +fn cu_event_create( + state: &mut State, + input: &ArchivedcuEventCreateIn, +) -> Result { + let mut event = ptr::null_mut(); + unsafe { cuEventCreate(&mut event, input.Flags.to_native()) }?; + let handle = state.handles.insert(event); + Ok(cuEventCreateOut { + phEvent: u32_le::from_native(handle), + }) +} + +fn cu_event_destroy_v2( + state: &mut State, + input: &ArchivedcuEventDestroy_v2In, +) -> Result { + let event = input.hEvent.to_native(); + let cu_event = state.handles.remove(event)?; + unsafe { cuEventDestroy_v2(cu_event) }?; + Ok(cuEventDestroy_v2Out {}) +} + +fn cu_stream_destroy_v2( + state: &mut State, + input: &ArchivedcuStreamDestroy_v2In, +) -> Result { + let stream = input.hStream.to_native(); + let cu_stream = CUstream(state.handles.remove(stream)?); + unsafe { cuStreamDestroy_v2(cu_stream) }?; + Ok(cuStreamDestroy_v2Out {}) +} + +fn cu_stream_create( + state: &mut State, + input: &ArchivedcuStreamCreateIn, +) -> Result { + let mut stream = CUstream(ptr::null_mut()); + unsafe { cuStreamCreate(&mut stream, input.Flags.to_native()) }?; + let handle = state.handles.insert(stream.0); + Ok(cuStreamCreateOut { + phStream: u32_le::from_native(handle), + }) +} + +fn cu_device_get_properties( + input: &ArchivedcuDeviceGetPropertiesIn, +) -> Result { + let mut props = unsafe { mem::zeroed() }; + unsafe { cuDeviceGetProperties(&mut props, input.dev.to_native()) }?; + Ok(cuDeviceGetPropertiesOut { prop: props.into() }) +} + +fn cu_device_compute_capability( + input: &ArchivedcuDeviceComputeCapabilityIn, +) -> Result { + let mut major = 0; + let mut minor = 0; + unsafe { cuDeviceComputeCapability(&mut major, &mut minor, input.dev.to_native()) }?; + Ok(cuDeviceComputeCapabilityOut { major, minor }) +} + +fn cu_mem_free_v2( + state: &mut State, + input: &ArchivedcuMemFree_v2In, +) -> Result { + let dptr = input.dptr.to_native(); + state.devmemory.free(dptr)?; + Ok(cuMemFree_v2Out {}) +} + +fn cu_tex_ref_set_format( + state: &mut State, + input: &ArchivedcuTexRefSetFormatIn, +) -> Result { + let tex_ref = state.handles.get(input.hTexRef.to_native())?; + unsafe { + cuTexRefSetFormat( + tex_ref, + CUarray_format(input.fmt.to_native()), + input.NumPackedComponents.to_native(), + ) + }?; + Ok(cuTexRefSetFormatOut {}) +} + +fn cu_tex_ref_set_flags( + state: &mut State, + input: &ArchivedcuTexRefSetFlagsIn, +) -> Result { + let tex_ref = state.handles.get(input.hTexRef.to_native())?; + unsafe { cuTexRefSetFlags(tex_ref, input.Flags.to_native()) }?; + Ok(cuTexRefSetFlagsOut {}) +} + +fn cu_tex_ref_set_address_v2( + state: &mut State, + input: &ArchivedcuTexRefSetAddress_v2In, +) -> Result { + let mut byte_offset = 0; + let dptr = input.dptr.to_native(); + let dptr = CUdeviceptr_v2(state.devmemory.translate(dptr)?); + unsafe { + cuTexRefSetAddress_v2( + &mut byte_offset, + state.handles.get(input.hTexRef.to_native())?, + dptr, + input.bytes.to_native() as usize, + ) + }?; + Ok(cuTexRefSetAddress_v2Out { + ByteOffset: (byte_offset as u32).into(), + }) +} + +fn cu_mem_get_address_range_v2( + state: &mut State, + input: &ArchivedcuMemGetAddressRange_v2In, +) -> Result { + let range = state + .devmemory + .get_range(input.dptr.to_native()) + .ok_or(CUerror::INVALID_VALUE)?; + Ok(cuMemGetAddressRange_v2Out { + pbase: (range.start * Allocator::ALLOCATION_UNIT).into(), + psize: ((range.end - range.start) * Allocator::ALLOCATION_UNIT).into(), + }) +} + +fn cu_memcpy_dtoh_async_v2( + state: &mut State, + input: &ArchivedcuMemcpyDtoHAsync_v2In, +) -> Result { + let devptr = state.devmemory.translate(input.src_device.to_native())?; + let stream = input.stream.to_native(); + let stream = CUstream(state.handles.get(stream)?); + let mut dst_host = vec![0u8; input.byte_count.to_native() as usize]; + unsafe { + cuMemcpyDtoHAsync_v2( + dst_host.as_mut_ptr().cast(), + CUdeviceptr_v2(devptr), + input.byte_count.to_native() as usize, + stream, + ) + }?; + unsafe { cuStreamSynchronize(stream) }?; + Ok(cuMemcpyDtoHAsync_v2Out { dst_host }) +} + +fn cu_ctx_synchronize(_input: &ArchivedcuCtxSynchronizeIn) -> Result { + unsafe { cuCtxSynchronize() }?; + Ok(cuCtxSynchronizeOut {}) +} + +fn cu_launch_kernel( + state: &mut State, + input: &ArchivedcuLaunchKernelIn, +) -> Result { + let mut device = 0; + unsafe { cuCtxGetDevice(&mut device) }?; + let mut params = input + .kernel_params + .iter() + .map(|p| p.as_ptr().cast_mut().cast::()) + .collect::>(); + let mut base64_ptr = state.devmemory.get_device_ptr()?; + params.push(ptr::from_mut(&mut base64_ptr).cast()); + let function = CUfunction(state.handles.get(input.f.to_native())?); + let function_info = state + .modules + .functions + .get(&function) + .ok_or(CUerror::INVALID_VALUE)?; + let globals = function_info + .globals + .iter() + .map(|global| global.allocation.start * Allocator::ALLOCATION_UNIT) + .collect::>(); + for g in globals.iter() { + params.push(ptr::from_ref(g).cast_mut().cast()); + } + unsafe { + cuLaunchKernel( + function, + input.grid_dim_x.to_native(), + input.grid_dim_y.to_native(), + input.grid_dim_z.to_native(), + input.block_dim_x.to_native(), + input.block_dim_y.to_native(), + input.block_dim_z.to_native(), + input.shared_mem_bytes.to_native(), + CUstream(state.handles.get(input.stream.to_native())?), + params.as_mut_ptr(), + std::ptr::null_mut(), + ) + }?; + Ok(cuLaunchKernelOut {}) +} + +fn zluda_get_function_args( + state: &mut State, + input: &ArchivedzludaGetFunctionArgsIn, +) -> Result { + let hfunc = state.handles.get(input.f.to_native())?; + let mut count = 0; + unsafe { + state.modules.dark_api.get_function_info( + std::ptr::null_mut(), + &mut count, + CUfunction(hfunc), + ) + }?; + let mut arg_sizes = vec![FunctionArgInfo { size: 0, align: 0 }; count as usize]; + unsafe { + state.modules.dark_api.get_function_info( + arg_sizes.as_mut_ptr(), + &mut count, + CUfunction(hfunc), + ) + }?; + Ok(zludaGetFunctionArgsOut { args: arg_sizes }) +} + +fn cu_module_get_tex_ref( + state: &mut State, + input: &ArchivedcuModuleGetTexRefIn, +) -> Result { + let hmod = state.handles.get::(input.hmod.to_native())?; + let module = state + .modules + .modules + .get_mut(&CUmodule(hmod)) + .ok_or(CUerror::INVALID_VALUE)?; + let texref = match module.texrefs.entry(input.name.to_vec()) { + std::collections::hash_map::Entry::Occupied(entry) => *entry.get(), + std::collections::hash_map::Entry::Vacant(entry) => { + let mut texref = unsafe { mem::zeroed() }; + unsafe { cuModuleGetTexRef(&mut texref, CUmodule(hmod), input.name.as_ptr().cast()) }?; + let handle = state.handles.insert(texref); + *entry.insert(handle) + } + }; + Ok(cuModuleGetTexRefOut { + texref: u32_le::from_native(texref), + }) +} + +fn cu_memcpy_hto_d_async_v2( + state: &mut State, + input: &ArchivedcuMemcpyHtoDAsync_v2In, +) -> Result { + let devptr = state.devmemory.translate(input.dst_device.to_native())?; + let stream = CUstream(state.handles.get(input.stream.to_native())?); + unsafe { + cuMemcpyHtoDAsync_v2( + CUdeviceptr_v2(devptr), + input.src_host.as_ptr().cast(), + input.src_host.len(), + stream, + ) + }?; + Ok(cuMemcpyHtoDAsync_v2Out {}) +} + +fn cu_mem_alloc_v2( + state: &mut State, + input: &ArchivedcuMemAlloc_v2In, +) -> Result { + let fake_ptr = state.devmemory.alloc(input.bytesize.to_native())?; + Ok(cuMemAlloc_v2Out { + dptr: u32_le::from_native(fake_ptr), + }) +} + +fn cu_module_get_global_v2( + state: &mut State, + input: &ArchivedcuModuleGetGlobal_v2In, +) -> Result { + let hmod = state.handles.get::(input.hmod.to_native())?; + let module = state + .modules + .modules + .get(&CUmodule(hmod)) + .ok_or(CUerror::INVALID_VALUE)?; + let global = module + .globals + .iter() + .find(|global| global.name.as_bytes() == input.name.as_slice()) + .ok_or(CUerror::NOT_FOUND)?; + Ok(cuModuleGetGlobal_v2Out { + dptr: u32_le::from_native(global.address()), + bytes: u64_le::from_native(global.size as u64), + }) +} + +fn cu_module_get_function( + state: &mut State, + input: &ArchivedcuModuleGetFunctionIn, +) -> Result { + let mut hfunc = unsafe { mem::zeroed() }; + let hmod = state.handles.get(input.hmod.to_native())?; + unsafe { cuModuleGetFunction(&mut hfunc, CUmodule(hmod), input.name.as_ptr().cast()) }?; + state + .modules + .functions + .entry(hfunc) + .or_insert_with(|| Function { + globals: Rc::clone(&state.modules.modules[&CUmodule(hmod)].globals), + }); + Ok(cuModuleGetFunctionOut { + hfunc: u32_le::from_native(state.handles.insert(hfunc.0)), + }) +} + +fn cu_module_load_data( + state: &mut State, + input: &ArchivedcuModuleLoadDataIn, +) -> Result { + let mut module = unsafe { mem::zeroed() }; + unsafe { cuModuleLoadData(&mut module, input.image.as_ptr().cast()) }?; + unsafe { state.modules.new_module(&mut state.devmemory, module) }?; + Ok(cuModuleLoadDataOut { + module: u32_le::from_native(state.handles.insert(module.0)), + }) +} + +fn cu_init(input: &ArchivedcuInitIn) -> Result { + unsafe { cuInit(input.Flags.to_native()) }?; + Ok(cuInitOut {}) +} + +fn cu_device_get_count( + _input: &ArchivedcuDeviceGetCountIn, +) -> Result { + Ok(cuDeviceGetCountOut { count: 1 }) +} + +fn cu_device_get_attribute( + state: &mut State, + input: &ArchivedcuDeviceGetAttributeIn, +) -> Result { + if input.dev.to_native() != state.device { + return Err(CUerror::INVALID_DEVICE); + } + let mut pi = 0; + unsafe { + cuDeviceGetAttribute( + &mut pi, + CUdevice_attribute_enum(input.attrib.to_native()), + state.device, + ) + }?; + Ok(cuDeviceGetAttributeOut { pi }) +} + +fn cu_device_get( + state: &mut State, + _input: &ArchivedcuDeviceGetIn, +) -> Result { + Ok(cuDeviceGetOut { + device: state.device.into(), + }) +} + +fn cu_device_get_name( + state: &mut State, + input: &ArchivedcuDeviceGetNameIn, +) -> Result { + if input.dev.to_native() != state.device { + return Err(CUerror::INVALID_DEVICE); + } + let mut name = vec![0u8; input.len.to_native() as usize]; + unsafe { + cuDeviceGetName( + name.as_mut_ptr().cast(), + input.len.to_native(), + state.device, + ) + }?; + if let Some(pos) = name.iter().copied().position(|c| c == 0) { + name.truncate(pos); + } + Ok(cuDeviceGetNameOut { name }) +} + +fn cu_device_total_mem_v2( + state: &mut State, + input: &ArchivedcuDeviceTotalMem_v2In, +) -> Result { + if input.dev.to_native() != state.device { + return Err(CUerror::INVALID_DEVICE); + } + let mut bytes = 0usize; + unsafe { cuDeviceTotalMem_v2(&mut bytes, state.device) }?; + Ok(cuDeviceTotalMem_v2Out { + bytes: u64_le::from_native(bytes as u64), + }) +} + +fn cu_driver_get_version( + _input: &ArchivedcuDriverGetVersionIn, +) -> Result { + let mut driver_version = 0; + unsafe { cuDriverGetVersion(&mut driver_version) }?; + Ok(cuDriverGetVersionOut { + driverVersion: driver_version, + }) +} + +fn cu_ctx_get_api_version( + state: &mut State, + _input: &ArchivedcuCtxGetApiVersionIn, +) -> Result { + let mut version = 0; + unsafe { cuCtxGetApiVersion(state.ctx, &mut version) }?; + Ok(cuCtxGetApiVersionOut { version }) +} + +async fn handle_cuda_function( + client: &mut NamedPipeClient, + mut buffer: AlignedVecBuffer, + handler: impl FnOnce(&In::Archived) -> Result, +) -> std::io::Result +where + Out: for<'a, 'b> Serialize< + HighSerializer<&'a mut AlignedVec, ArenaHandle<'b>, rkyv::rancor::Failure>, + >, +{ + buffer = read_all::(buffer, client).await?; + let input = unsafe { rkyv::access_unchecked::(buffer.as_init()) }; + match handler(input) { + Ok(output) => { + buffer.clear(); + client.write_u32_le(0).await?; + rkyv::api::high::to_bytes_in::<_, rkyv::rancor::Failure>(&output, &mut buffer.0) + .map_err(|_| { + std::io::Error::new(std::io::ErrorKind::Other, "Failed to serialize response") + })?; + let ((), new_buffer) = buf_try!(@try client.write_all(buffer).await); + Ok(new_buffer) + } + Err(e) => { + client.write_u32_le(e.0.get()).await?; + Ok(buffer) + } + } +} + +async fn handle_cuda_function_framed_in( + client: &mut NamedPipeClient, + mut buffer: AlignedVecBuffer, + handler: impl FnOnce(&In::Archived) -> Result, +) -> std::io::Result +where + Out: for<'a, 'b> Serialize< + HighSerializer<&'a mut AlignedVec, ArenaHandle<'b>, rkyv::rancor::Failure>, + >, +{ + let length_prefix = client.read_u32_le().await? as usize; + buffer = read_sized(buffer, client, length_prefix).await?; + let input = unsafe { rkyv::access_unchecked::(buffer.as_init()) }; + match handler(input) { + Ok(output) => { + buffer.clear(); + client.write_u32_le(0).await?; + rkyv::api::high::to_bytes_in::<_, rkyv::rancor::Failure>(&output, &mut buffer.0) + .map_err(|_| { + std::io::Error::new(std::io::ErrorKind::Other, "Failed to serialize response") + })?; + let ((), new_buffer) = buf_try!(@try client.write_all(buffer).await); + Ok(new_buffer) + } + Err(e) => { + client.write_u32_le(e.0.get()).await?; + Ok(buffer) + } + } +} + +async fn handle_cuda_function_framed_out( + client: &mut NamedPipeClient, + mut buffer: AlignedVecBuffer, + handler: impl FnOnce(&In::Archived) -> Result, +) -> std::io::Result +where + Out: for<'a, 'b> Serialize< + HighSerializer<&'a mut AlignedVec, ArenaHandle<'b>, rkyv::rancor::Failure>, + >, +{ + buffer = read_all::(buffer, client).await?; + let input = unsafe { rkyv::access_unchecked::(buffer.as_init()) }; + match handler(input) { + Ok(output) => { + buffer.clear(); + rkyv::api::high::to_bytes_in::<_, rkyv::rancor::Failure>(&output, &mut buffer.0) + .map_err(|_| { + std::io::Error::new(std::io::ErrorKind::Other, "Failed to serialize response") + })?; + let code_and_len = unsafe { + std::mem::transmute::<(u32, u32), [u8; 8]>((0u32, buffer.0.len() as u32)) + }; + client.write_all(code_and_len).await.0?; + let ((), new_buffer) = buf_try!(@try client.write_all(buffer).await); + Ok(new_buffer) + } + Err(e) => { + client.write_u32_le(e.0.get()).await?; + Ok(buffer) + } + } +} + +async fn read_all( + buffer: AlignedVecBuffer, + client: &mut NamedPipeClient, +) -> std::io::Result { + read_sized(buffer, client, mem::size_of::()).await +} + +async fn read_sized( + mut buffer: AlignedVecBuffer, + client: &mut NamedPipeClient, + mut remaining_read: usize, +) -> std::io::Result { + buffer.clear(); + buffer.reserve(remaining_read)?; + while remaining_read > 0 { + let BufResult(read_result, new_buffer) = client.append(buffer).await; + let n = read_result?; + remaining_read = remaining_read.checked_sub(n).ok_or_else(|| { + std::io::Error::new( + std::io::ErrorKind::InvalidData, + "Read more bytes than expected", + ) + })?; + buffer = new_buffer; + } + Ok(buffer) +} + +struct AlignedVecBuffer(AlignedVec); + +impl AlignedVecBuffer { + fn clear(&mut self) { + self.0.clear(); + } +} + +impl IoBuf for AlignedVecBuffer { + fn as_init(&self) -> &[u8] { + self.0.as_slice() + } +} + +impl SetLen for AlignedVecBuffer { + unsafe fn set_len(&mut self, len: usize) { + unsafe { self.0.set_len(len) } + } +} + +impl IoBufMut for AlignedVecBuffer { + fn as_uninit(&mut self) -> &mut [std::mem::MaybeUninit] { + let ptr = self.0.as_mut_ptr() as *mut std::mem::MaybeUninit; + let cap = self.0.capacity(); + unsafe { std::slice::from_raw_parts_mut(ptr, cap) } + } + + fn reserve(&mut self, len: usize) -> Result<(), ReserveError> { + self.0.reserve(len); + Ok(()) + } + + fn reserve_exact(&mut self, len: usize) -> Result<(), ReserveExactError> { + if self.0.capacity() - self.0.len() >= len { + return Ok(()); + } + + self.0.reserve_exact(len); + + if self.0.capacity() - self.0.len() != len { + return Err(ReserveExactError::ExactSizeMismatch { + reserved: self.0.capacity() - self.0.len(), + expected: len, + }); + } + Ok(()) + } +} + +macro_rules! nop { + ($($abi:literal fn $fn_name:ident( $($arg_id:ident : $arg_type:ty),* ) -> $ret_type:ty;)*) => {}; +} + +macro_rules! implemented { + ($($abi:literal fn $fn_name:ident( $($arg_id:ident : $arg_type:ty),* ) -> $ret_type:ty;)*) => { + $( + #[link(name = "nvcuda", kind = "raw-dylib")] + unsafe extern $abi { + fn $fn_name ( $( $arg_id : $arg_type),* ) -> $ret_type; + } + )* + + }; +} + +cuda_function_declarations! { + nop, + implemented <= [ + // cuCtxCreate_v2, + // cuCtxDetach, + cuCtxGetApiVersion, + // cuCtxGetCurrent, + cuCtxGetDevice, + cuCtxSynchronize, + cuDeviceComputeCapability, + // cuDeviceGet, + cuDeviceGetAttribute, + // cuDeviceGetCount, + cuDeviceGetName, + cuDeviceGetProperties, + cuDeviceTotalMem_v2, + cuDriverGetVersion, + cuEventCreate, + cuEventDestroy_v2, + cuEventQuery, + cuEventRecord, + cuGetExportTable, + cuInit, + cuLaunchKernel, + cuMemAlloc_v2, + // cuMemFreeHost, + // cuMemFree_v2, + // cuMemGetAddressRange_v2, + // cuMemHostAlloc, + cuMemcpyDtoD_v2, + cuMemcpyDtoDAsync_v2, + cuMemcpyDtoHAsync_v2, + cuMemcpyHtoD_v2, + cuMemcpyHtoDAsync_v2, + cuMemsetD8_v2, + cuModuleGetFunction, + // cuModuleGetGlobal_v2, + cuModuleGetTexRef, + cuModuleLoadData, + cuStreamCreate, + cuStreamDestroy_v2, + // cuTexRefSetAddressMode, + cuTexRefSetAddress_v2, + // cuTexRefSetFilterMode, + cuTexRefSetFlags, + cuTexRefSetFormat, + // cuTexRefSetMaxAnisotropy, + // cuTexRefSetMipmapFilterMode, + // cuTexRefSetMipmapLevelBias, + // cuTexRefSetMipmapLevelClamp, + cuStreamSynchronize, + cuDevicePrimaryCtxRetain, + cuCtxSetCurrent, + ] +} diff --git a/zluda_common/src/constants.rs b/zluda_common/src/constants.rs index 8d316211b..fb468e9bf 100644 --- a/zluda_common/src/constants.rs +++ b/zluda_common/src/constants.rs @@ -2,6 +2,7 @@ pub const PROJECT_SUFFIX: &[u8] = b" [ZLUDA]\0"; const COMPUTE_CAPABILITY_MAJOR: i32 = 8; const COMPUTE_CAPABILITY_MINOR: i32 = 8; +#[cfg(target_pointer_width = "64")] pub const BLAS_HANDLE_COOKIE: usize = 0x57c3fdb0fd72b08e; pub fn compute_capability() -> (i32, i32) { diff --git a/zluda_common/src/lib.rs b/zluda_common/src/lib.rs index 4568f2ac2..5a701ac4b 100644 --- a/zluda_common/src/lib.rs +++ b/zluda_common/src/lib.rs @@ -135,6 +135,7 @@ macro_rules! from_cuda_nop { macro_rules! from_cuda_transmute { ($($from:ty => $to:ty),*) => { $( + #[cfg(target_pointer_width = "64")] impl<'a, E: CudaErrorType> FromCuda<'a, $from, E> for $to { fn from_cuda(x: &'a $from) -> Result { Ok(unsafe { std::mem::transmute(*x) }) diff --git a/zluda_common/src/os_win.rs b/zluda_common/src/os_win.rs index 05d8c74d8..10a1a1463 100644 --- a/zluda_common/src/os_win.rs +++ b/zluda_common/src/os_win.rs @@ -1,5 +1,5 @@ use std::path::PathBuf; pub fn self_path() -> Option { - zluda_windows::get_module_path_for_function(self_path as usize).map(PathBuf::from) + zluda_windows::get_module_path_for_function(self_path as *const () as usize).map(PathBuf::from) } diff --git a/zluda_dnn9/Cargo.toml b/zluda_dnn9/Cargo.toml index 4abf2e331..535f9d33d 100644 --- a/zluda_dnn9/Cargo.toml +++ b/zluda_dnn9/Cargo.toml @@ -24,7 +24,7 @@ paste = "1.0" libloading = "0.8" candle-core = "0.9.2" half = { version = "2.7", features = ["rand_distr"] } -rand = { version = "0.9.2" } +rand = { version = "0.9" } rand_chacha = { version = "0.9" } [target.'cfg(windows)'.dependencies] diff --git a/zluda_inject/Cargo.toml b/zluda_inject/Cargo.toml index a334ded57..a8bd44775 100644 --- a/zluda_inject/Cargo.toml +++ b/zluda_inject/Cargo.toml @@ -13,7 +13,6 @@ windows = { version = "0.62.2", features = [ "Win32_Foundation", "Win32_System_Threading", "Win32_Security", - "Win32_System_JobObjects", "Win32_System_Diagnostics_Debug", "Win32_System_LibraryLoader", ] } @@ -34,3 +33,4 @@ zluda_ml = { path = "../zluda_ml" } [package.metadata.zluda] windows_only = true +32bit = true diff --git a/zluda_inject/src/bin.rs b/zluda_inject/src/bin.rs index a75ee40f6..dd571fbe1 100644 --- a/zluda_inject/src/bin.rs +++ b/zluda_inject/src/bin.rs @@ -7,10 +7,6 @@ use std::ffi::{CString, OsStr}; use std::path::PathBuf; use std::{env, mem, process, ptr}; use windows::Win32::Foundation::{HANDLE, WAIT_FAILED}; -use windows::Win32::System::JobObjects::{ - AssignProcessToJobObject, JobObjectExtendedLimitInformation, SetInformationJobObject, - JOBOBJECT_EXTENDED_LIMIT_INFORMATION, JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, -}; use windows::Win32::System::Threading::{ self, GetExitCodeProcess, ResumeThread, WaitForSingleObject, CREATE_SUSPENDED, CREATE_UNICODE_ENVIRONMENT, @@ -69,7 +65,7 @@ pub fn main_impl() -> Result<(), Box> { Option::None ) }; - kill_child_on_process_exit(proc_info.hProcess)?; + zluda_windows::kill_child_on_process_exit(proc_info.hProcess)?; injection_env.copy_payloads_to_process(proc_info.hProcess)?; os_call! { ResumeThread(HANDLE(proc_info.hThread)), |x| x == -1i32 as u32 }; os_call! { WaitForSingleObject(HANDLE(proc_info.hProcess), Threading::INFINITE), |x| x == WAIT_FAILED }; @@ -338,19 +334,3 @@ impl InjectionConfig { Ok(result.into_vec()) } } - -fn kill_child_on_process_exit(child: detours_sys::HANDLE) -> Result<(), Box> { - let job_handle = unsafe { windows::Win32::System::JobObjects::CreateJobObjectA(None, None) }?; - let mut info = JOBOBJECT_EXTENDED_LIMIT_INFORMATION::default(); - info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; - unsafe { - SetInformationJobObject( - job_handle, - JobObjectExtendedLimitInformation, - &mut info as *mut _ as *mut _, - size_of_val(&info) as u32, - ) - }?; - unsafe { AssignProcessToJobObject(job_handle, HANDLE(child)) }?; - Ok(()) -} diff --git a/zluda_redirect/Cargo.toml b/zluda_redirect/Cargo.toml index e216fd7b2..9133e6567 100644 --- a/zluda_redirect/Cargo.toml +++ b/zluda_redirect/Cargo.toml @@ -36,3 +36,4 @@ rustc-hash = "2.0.0" [package.metadata.zluda] windows_only = true +32bit = true diff --git a/zluda_server_common/Cargo.toml b/zluda_server_common/Cargo.toml new file mode 100644 index 000000000..def02f849 --- /dev/null +++ b/zluda_server_common/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "zluda_server_common" +version = "0.0.0" +authors = ["Andrzej Janik "] +edition = "2021" + +[dependencies] +dark_api = { path = "../dark_api" } +cuda_types = { path = "../cuda_types" } +cuda_macros = { path = "../cuda_macros" } +paste = "1" +rkyv = "0.8" +strum = "0.28" +strum_macros = "0.28" diff --git a/zluda_server_common/src/lib.rs b/zluda_server_common/src/lib.rs new file mode 100644 index 000000000..a22c5b1f3 --- /dev/null +++ b/zluda_server_common/src/lib.rs @@ -0,0 +1,362 @@ +use cuda_macros::{cuda_function_declarations, generate_input_struct, generate_output_struct}; +use cuda_types::cuda::*; +use rkyv::rend::{u32_le, u64_le}; +use rkyv::{Archive, Deserialize, Portable, Serialize}; +use strum_macros::FromRepr; + +macro_rules! noop { + ($($abi:literal fn $fn_name:ident( $($arg_id:ident : $arg_type:ty),* ) -> $ret_type:ty;)*) => {}; +} + +macro_rules! generate_messages_inout { + ($($abi:literal fn $fn_name:ident( $($arg_id:ident : $arg_type:ty),* ) -> $ret_type:ty;)*) => { + $( + generate_input_struct!($fn_name, $($arg_id : $arg_type),*); + generate_output_struct!($fn_name, $($arg_id : $arg_type),*); + )* + + #[repr(u32)] + #[derive(FromRepr)] + #[allow(non_camel_case_types)] + pub enum Opcode { + System = 0, + $( + $fn_name, + )* + cuDeviceGetName, + cuDeviceTotalMem_v2, + cuModuleLoadData, + cuModuleGetFunction, + cuModuleGetGlobal_v2, + cuMemAlloc_v2, + cuMemcpyHtoDAsync_v2, + cuModuleGetTexRef, + cuLaunchKernel, + zludaGetFunctionArgs, + cuMemcpyDtoHAsync_v2 + } + }; +} + +macro_rules! generate_messages_in { + ($($abi:literal fn $fn_name:ident( $($arg_id:ident : $arg_type:ty),* ) -> $ret_type:ty;)*) => { + $( + generate_input_struct!($fn_name, $($arg_id : $arg_type),*); + )* + }; +} + +cuda_function_declarations! { + noop, + generate_messages_inout <= [ + // cuCtxCreate_v2, + cuCtxDetach, + cuCtxGetApiVersion, + cuCtxGetCurrent, + cuCtxGetDevice, + cuCtxSynchronize, + cuDeviceComputeCapability, + cuDeviceGet, + cuDeviceGetAttribute, + cuDeviceGetCount, + cuDeviceGetProperties, + cuDriverGetVersion, + cuEventCreate, + cuEventDestroy_v2, + cuEventQuery, + cuEventRecord, + //cuGetExportTable, + cuInit, + // cuLaunchKernel, + //cuMemAlloc_v2, + //cuMemFreeHost, + cuMemFree_v2, + cuMemGetAddressRange_v2, + //cuMemHostAlloc, + cuMemcpyDtoD_v2, + cuMemcpyDtoDAsync_v2, + //cuMemcpyDtoHAsync_v2, + //cuMemcpyHtoDAsync_v2, + cuMemsetD8_v2, + // cuModuleGetFunction, + // cuModuleGetGlobal_v2, + // cuModuleGetTexRef, + cuStreamCreate, + cuStreamDestroy_v2, + cuTexRefSetAddressMode, + cuTexRefSetAddress_v2, + cuTexRefSetFilterMode, + cuTexRefSetFlags, + cuTexRefSetFormat, + cuTexRefSetMaxAnisotropy, + cuTexRefSetMipmapFilterMode, + cuTexRefSetMipmapLevelBias, + cuTexRefSetMipmapLevelClamp, + ], + generate_messages_in <= [ + cuDeviceGetName, + cuDeviceTotalMem_v2 + ] +} + +pub trait CudaEncode: Copy { + type WireObject; + fn encode(self) -> Self::WireObject; + fn decode(o: Self::WireObject) -> Self; +} + +macro_rules! encode_as_self { + ($type_:ty) => { + impl CudaEncode for $type_ { + type WireObject = Self; + fn encode(self) -> Self { + self + } + fn decode(o: Self::WireObject) -> Self { + o + } + } + }; +} + +macro_rules! encode_as_proxy { + ($type_:ty, $proxy_type:ty) => { + impl CudaEncode for $type_ { + type WireObject = $proxy_type; + fn encode(self) -> $proxy_type { + unsafe { std::mem::transmute::(self) } + } + fn decode(o: Self::WireObject) -> Self { + unsafe { std::mem::transmute::<$proxy_type, Self>(o) } + } + } + }; +} + +macro_rules! encode_as_u32 { + ($type_:ty) => { + impl CudaEncode for $type_ { + type WireObject = u32_le; + fn encode(self) -> u32_le { + unsafe { std::mem::transmute_copy::(&self) } + } + fn decode(o: Self::WireObject) -> Self { + unsafe { std::mem::transmute_copy::(&o) } + } + } + }; +} + +encode_as_self!(u8); +encode_as_self!(i8); +encode_as_self!(u32); +encode_as_self!(i32); +encode_as_self!(f32); + +encode_as_proxy!(CUdevprop_v1, CUdevprop_v1_Wire); +encode_as_proxy!(CUdevice_attribute, u32_le); +encode_as_proxy!(CUfilter_mode, u32_le); +encode_as_proxy!(CUaddress_mode, u32_le); +encode_as_proxy!(CUarray_format, u32_le); + +encode_as_u32!(CUcontext); +encode_as_u32!(CUdeviceptr_v2); +encode_as_u32!(CUevent); +encode_as_u32!(CUfunction); +encode_as_u32!(CUmodule); +encode_as_u32!(CUstream); +encode_as_u32!(CUtexref); + +impl CudaEncode for usize { + type WireObject = u32_le; + fn encode(self) -> u32_le { + (self as u32).into() + } + fn decode(o: Self::WireObject) -> Self { + o.to_native() as usize + } +} + +#[repr(C)] +#[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct CUdevprop_v1_Wire { + pub max_threads_per_block: ::core::ffi::c_int, + pub max_threads_dim: [::core::ffi::c_int; 3usize], + pub max_grid_size: [::core::ffi::c_int; 3usize], + pub shared_mem_per_block: ::core::ffi::c_int, + pub total_constant_memory: ::core::ffi::c_int, + pub simd_width: ::core::ffi::c_int, + pub mem_pitch: ::core::ffi::c_int, + pub regs_per_block: ::core::ffi::c_int, + pub clock_rate: ::core::ffi::c_int, + pub texture_align: ::core::ffi::c_int, +} + +impl From for CUdevprop_v1_Wire { + fn from(devprop: CUdevprop_v1) -> Self { + Self { + max_threads_per_block: devprop.maxThreadsPerBlock, + max_threads_dim: devprop.maxThreadsDim, + max_grid_size: devprop.maxGridSize, + shared_mem_per_block: devprop.sharedMemPerBlock, + total_constant_memory: devprop.totalConstantMemory, + simd_width: devprop.SIMDWidth, + mem_pitch: devprop.memPitch, + regs_per_block: devprop.regsPerBlock, + clock_rate: devprop.clockRate, + texture_align: devprop.textureAlign, + } + } +} + +impl Into for CUdevprop_v1_Wire { + fn into(self) -> CUdevprop_v1 { + CUdevprop_v1 { + maxThreadsPerBlock: self.max_threads_per_block, + maxThreadsDim: self.max_threads_dim, + maxGridSize: self.max_grid_size, + sharedMemPerBlock: self.shared_mem_per_block, + totalConstantMemory: self.total_constant_memory, + SIMDWidth: self.simd_width, + memPitch: self.mem_pitch, + regsPerBlock: self.regs_per_block, + clockRate: self.clock_rate, + textureAlign: self.texture_align, + } + } +} + +unsafe impl Portable for CUdevprop_v1_Wire {} + +#[repr(C)] +#[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuDeviceGetNameOut { + pub name: Vec, +} + +#[repr(C)] +#[derive(Portable, Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuDeviceTotalMem_v2Out { + pub bytes: u64_le, +} + +#[repr(C)] +#[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuModuleLoadDataIn { + pub image: Vec, +} + +#[repr(C)] +#[derive(Portable, Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuModuleLoadDataOut { + pub module: ::WireObject, +} + +#[repr(C)] +#[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuModuleGetFunctionIn { + pub hmod: ::WireObject, + pub name: Vec, +} + +#[repr(C)] +#[derive(Portable, Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuModuleGetFunctionOut { + pub hfunc: ::WireObject, +} + +#[repr(C)] +#[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuModuleGetGlobal_v2In { + pub hmod: ::WireObject, + pub name: Vec, +} + +#[repr(C)] +#[derive(Portable, Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuModuleGetGlobal_v2Out { + pub dptr: ::WireObject, + pub bytes: u64_le, +} + +#[repr(C)] +#[derive(Portable, Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuMemAlloc_v2In { + pub bytesize: u32_le, +} + +#[repr(C)] +#[derive(Portable, Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuMemAlloc_v2Out { + pub dptr: ::WireObject, +} + +#[repr(C)] +#[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuMemcpyHtoDAsync_v2In { + pub dst_device: ::WireObject, + pub src_host: Vec, + pub stream: ::WireObject, +} + +#[repr(C)] +#[derive(Portable, Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuMemcpyHtoDAsync_v2Out {} + +#[repr(C)] +#[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuModuleGetTexRefIn { + pub hmod: ::WireObject, + pub name: Vec, +} + +#[repr(C)] +#[derive(Portable, Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuModuleGetTexRefOut { + pub texref: ::WireObject, +} + +#[repr(C)] +#[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuLaunchKernelIn { + pub f: ::WireObject, + pub grid_dim_x: u32_le, + pub grid_dim_y: u32_le, + pub grid_dim_z: u32_le, + pub block_dim_x: u32_le, + pub block_dim_y: u32_le, + pub block_dim_z: u32_le, + pub shared_mem_bytes: u32_le, + pub stream: ::WireObject, + pub kernel_params: Vec>, +} + +#[repr(C)] +#[derive(Portable, Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuLaunchKernelOut {} + +#[repr(C)] +#[derive(Portable, Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct zludaGetFunctionArgsIn { + pub f: ::WireObject, +} + +#[repr(C)] +#[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct zludaGetFunctionArgsOut { + pub args: Vec, +} + +#[repr(C)] +#[derive(Portable, Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuMemcpyDtoHAsync_v2In { + pub src_device: ::WireObject, + pub stream: ::WireObject, + pub byte_count: u32_le, +} + +#[repr(C)] +#[derive(Archive, Deserialize, Serialize, Debug, PartialEq, Clone)] +pub struct cuMemcpyDtoHAsync_v2Out { + pub dst_host: Vec, +} diff --git a/zluda_trace/Cargo.toml b/zluda_trace/Cargo.toml index d36cb1cb1..decfa48f7 100644 --- a/zluda_trace/Cargo.toml +++ b/zluda_trace/Cargo.toml @@ -9,15 +9,14 @@ name = "zluda_trace" crate-type = ["cdylib"] [dependencies] -ptx = { path = "../ptx" } ptx_parser = { path = "../ptx_parser" } zluda_trace_common = { path = "../zluda_trace_common" } zluda_common = { path = "../zluda_common" } format = { path = "../format" } dark_api = { path = "../dark_api" } regex = "1.4" -dynasm = "1.2" -dynasmrt = "1.2" +dynasm = "5.0" +dynasmrt = "5.0" # we don't need elf32, but goblin has a bug where elf64 does not build without elf32 goblin = { version = "0.9", default-features = false, features = [ "elf64", @@ -52,3 +51,4 @@ linux_symlinks = [ "trace_nvidia/libcuda.so.1", ] windows_paths = ["trace/nvcuda.dll"] +32bit = true diff --git a/zluda_trace/src/lib.rs b/zluda_trace/src/lib.rs index b813f631e..20bb3e687 100644 --- a/zluda_trace/src/lib.rs +++ b/zluda_trace/src/lib.rs @@ -63,6 +63,24 @@ impl CudaDynamicFns { } } +#[cfg(unix)] +impl Drop for CudaDynamicFns { + fn drop(&mut self) { + unsafe { + libloading::os::unix::Library::from_raw(self.lib_handle.as_ptr() as _); + } + } +} + +#[cfg(windows)] +impl Drop for CudaDynamicFns { + fn drop(&mut self) { + unsafe { + libloading::os::windows::Library::from_raw(self.lib_handle.as_ptr() as _); + } + } +} + unsafe impl Send for CudaDynamicFns {} unsafe impl Sync for CudaDynamicFns {} @@ -147,13 +165,19 @@ struct InternalTableImpl; impl ::dark_api::zluda_trace::CudaDarkApi for InternalTableImpl { unsafe extern "system" fn logged_call( fn_name: cglue::slice::CSliceRef<'static, u8>, + nvapi_interface: u32, args: ::dark_api::FnFfiRef<::dark_api::ByteVecFfi>, fn_: ::dark_api::FnFfiRef, internal_error: usize, format_status: extern "C" fn(usize) -> ::dark_api::ByteVecFfi, ) -> usize { + let fn_name = if nvapi_interface == 0 { + CudaFunctionName::Normal(unsafe { fn_name.into_str() }) + } else { + CudaFunctionName::Nvapi(nvapi_interface) + }; GlobalState2::under_lock( - CudaFunctionName::Normal(unsafe { fn_name.into_str() }), + fn_name, Some(|| args.call().to_vec()), internal_error, |status| format_status(status).to_vec(), diff --git a/zluda_trace/src/log.rs b/zluda_trace/src/log.rs index 5915f1938..7b6ec98bc 100644 --- a/zluda_trace/src/log.rs +++ b/zluda_trace/src/log.rs @@ -236,6 +236,7 @@ impl Write for WriteBuffer { pub(crate) enum CudaFunctionName { Normal(&'static str), Dark { guid: CUuuid, index: usize }, + Nvapi(u32), } impl Display for CudaFunctionName { @@ -257,6 +258,9 @@ impl Display for CudaFunctionName { } } } + CudaFunctionName::Nvapi(interface) => { + write!(f, "{{nvapi:{:#010x}}}", interface) + } } } } diff --git a/zluda_trace/src/trace.rs b/zluda_trace/src/trace.rs index fa3315076..1db1c62c1 100644 --- a/zluda_trace/src/trace.rs +++ b/zluda_trace/src/trace.rs @@ -102,9 +102,10 @@ impl StateTracker { }) } Ok(zluda_common::CodeModuleRef::File(file)) => { - if let Some(buffer) = fn_logger - .try_(|_| file.get_or_decompress_content().map_err(ErrorEntry::from)) - { + if let Some(buffer) = fn_logger.try_(|_| { + file.get_or_decompress_content(true) + .map_err(ErrorEntry::from) + }) { self.record_new_submodule(index, &*buffer, fn_logger, file.kind()); } } diff --git a/zluda_trace_blas/src/lib.rs b/zluda_trace_blas/src/lib.rs index b1bc28fdc..0ef7600eb 100644 --- a/zluda_trace_blas/src/lib.rs +++ b/zluda_trace_blas/src/lib.rs @@ -35,6 +35,7 @@ macro_rules! unimplemented { }); ReprUsize::from_usize(export_table.logged_call( cglue::slice::CSliceRef::from_str(stringify!($fn_name)), + 0, cglue::trait_obj!(&format_args as dark_api::FnFfi), cglue::trait_obj!(&underlying_fn as dark_api::FnFfi), internal_error_untyped, diff --git a/zluda_trace_blaslt/src/lib.rs b/zluda_trace_blaslt/src/lib.rs index 5202a79dc..e1c4b1f1a 100644 --- a/zluda_trace_blaslt/src/lib.rs +++ b/zluda_trace_blaslt/src/lib.rs @@ -35,6 +35,7 @@ macro_rules! unimplemented { }); ReprUsize::from_usize(export_table.logged_call( cglue::slice::CSliceRef::from_str(stringify!($fn_name)), + 0, cglue::trait_obj!(&format_args as dark_api::FnFfi), cglue::trait_obj!(&underlying_fn as dark_api::FnFfi), internal_error_untyped, diff --git a/zluda_trace_dnn8/src/lib.rs b/zluda_trace_dnn8/src/lib.rs index 6e98a384b..f0ebd0402 100644 --- a/zluda_trace_dnn8/src/lib.rs +++ b/zluda_trace_dnn8/src/lib.rs @@ -35,6 +35,7 @@ macro_rules! unimplemented { }); ReprUsize::from_usize(export_table.logged_call( cglue::slice::CSliceRef::from_str(stringify!($fn_name)), + 0, cglue::trait_obj!(&format_args as dark_api::FnFfi), cglue::trait_obj!(&underlying_fn as dark_api::FnFfi), internal_error_untyped, diff --git a/zluda_trace_dnn9/src/lib.rs b/zluda_trace_dnn9/src/lib.rs index 5989ccb3a..96e1a7536 100644 --- a/zluda_trace_dnn9/src/lib.rs +++ b/zluda_trace_dnn9/src/lib.rs @@ -35,6 +35,7 @@ macro_rules! unimplemented { }); ReprUsize::from_usize(export_table.logged_call( cglue::slice::CSliceRef::from_str(stringify!($fn_name)), + 0, cglue::trait_obj!(&format_args as dark_api::FnFfi), cglue::trait_obj!(&underlying_fn as dark_api::FnFfi), internal_error_untyped, diff --git a/zluda_trace_fft/src/lib.rs b/zluda_trace_fft/src/lib.rs index dbedc29fd..ca1f83881 100644 --- a/zluda_trace_fft/src/lib.rs +++ b/zluda_trace_fft/src/lib.rs @@ -35,6 +35,7 @@ macro_rules! unimplemented { }); ReprUsize::from_usize(export_table.logged_call( cglue::slice::CSliceRef::from_str(stringify!($fn_name)), + 0, cglue::trait_obj!(&format_args as dark_api::FnFfi), cglue::trait_obj!(&underlying_fn as dark_api::FnFfi), internal_error_untyped, diff --git a/zluda_trace_nvml/src/lib.rs b/zluda_trace_nvml/src/lib.rs index 4eed6940f..8fe8b5b51 100644 --- a/zluda_trace_nvml/src/lib.rs +++ b/zluda_trace_nvml/src/lib.rs @@ -35,6 +35,7 @@ macro_rules! unimplemented { }); ReprUsize::from_usize(export_table.logged_call( cglue::slice::CSliceRef::from_str(stringify!($fn_name)), + 0, cglue::trait_obj!(&format_args as dark_api::FnFfi), cglue::trait_obj!(&underlying_fn as dark_api::FnFfi), internal_error_untyped, diff --git a/zluda_trace_sparse/src/lib.rs b/zluda_trace_sparse/src/lib.rs index 44a286d0c..2e2d7683a 100644 --- a/zluda_trace_sparse/src/lib.rs +++ b/zluda_trace_sparse/src/lib.rs @@ -35,6 +35,7 @@ macro_rules! unimplemented { }); ReprUsize::from_usize(export_table.logged_call( cglue::slice::CSliceRef::from_str(stringify!($fn_name)), + 0, cglue::trait_obj!(&format_args as dark_api::FnFfi), cglue::trait_obj!(&underlying_fn as dark_api::FnFfi), internal_error_untyped, diff --git a/zluda_windows/src/lib.rs b/zluda_windows/src/lib.rs index c9d482e70..1a293a94d 100644 --- a/zluda_windows/src/lib.rs +++ b/zluda_windows/src/lib.rs @@ -13,11 +13,19 @@ use widestring::{u16str, U16Str, U16String}; use windows::{ core::{w, HRESULT, PCWSTR}, Win32::{ - Foundation::{HINSTANCE, HMODULE, HWND, LPARAM, S_OK, WPARAM}, - System::LibraryLoader::{ - GetModuleFileNameA, GetModuleFileNameW, GetModuleHandleExW, LoadLibraryExW, - GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - LOAD_LIBRARY_SEARCH_DEFAULT_DIRS, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR, + Foundation::{HANDLE, HINSTANCE, HMODULE, HWND, LPARAM, S_OK, WPARAM}, + System::{ + JobObjects::{ + AssignProcessToJobObject, JobObjectExtendedLimitInformation, + SetInformationJobObject, JOBOBJECT_EXTENDED_LIMIT_INFORMATION, + JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, + }, + LibraryLoader::{ + GetModuleFileNameA, GetModuleFileNameW, GetModuleHandleExW, LoadLibraryExW, + GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, + GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS, + LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR, + }, }, UI::{ Controls::{ @@ -30,9 +38,13 @@ use windows::{ }, }; -pub static LIBRARIES: [LibraryInfo; 16] = [ +#[cfg(target_pointer_width = "32")] +pub static LIBRARIES: [LibraryInfo; 2] = [NVCUDA, NVAPI]; + +#[cfg(target_pointer_width = "64")] +pub static LIBRARIES: [LibraryInfo; 17] = [ NVCUDA, NVML, DNN8, DNN9, BLAS13, BLAS12, BLAS11, BLAS_LT13, BLAS_LT12, BLAS_LT11, SPARSE12, - SPARSE11, SPARSE10, FFT12, FFT11, FFT10, + SPARSE11, SPARSE10, FFT12, FFT11, FFT10, NVAPI, ]; pub const NVCUDA: LibraryInfo = LibraryInfo { @@ -195,6 +207,22 @@ pub const FFT10: LibraryInfo = LibraryInfo { in_system32: false, }; +pub const NVAPI: LibraryInfo = LibraryInfo { + short_name: "nvapi", + is_alias: false, + #[cfg(target_pointer_width = "32")] + ascii_name: "nvapi.dll", + #[cfg(target_pointer_width = "64")] + ascii_name: "nvapi64.dll", + #[cfg(target_pointer_width = "32")] + utf16_name: u16str!("nvapi.dll"), + #[cfg(target_pointer_width = "64")] + utf16_name: u16str!("nvapi64.dll"), + guid: uuid!("f7449ed6-d01c-4376-9fc4-446eb2e4cf70"), + trace_env_var: "ZLUDA_NVAPI_LIB", + in_system32: true, +}; + #[derive(Debug)] pub struct LibraryInfo { pub short_name: &'static str, @@ -506,7 +534,7 @@ pub unsafe fn delay_load_check( } pub unsafe fn try_load_from_self_dir(libname: &str) -> Option { - let path = get_module_path_for_function(try_load_from_self_dir as usize)?; + let path = get_module_path_for_function(try_load_from_self_dir as *const () as usize)?; let mut path_buf = PathBuf::from(path); path_buf.pop(); path_buf.push(libname); @@ -583,6 +611,22 @@ pub fn get_module_path_utf16(hm: HMODULE) -> OsString { OsString::from_wide(&buffer) } +pub fn kill_child_on_process_exit(child: *mut c_void) -> windows::core::Result<()> { + let job_handle = unsafe { windows::Win32::System::JobObjects::CreateJobObjectA(None, None) }?; + let mut info = JOBOBJECT_EXTENDED_LIMIT_INFORMATION::default(); + info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; + unsafe { + SetInformationJobObject( + job_handle, + JobObjectExtendedLimitInformation, + &mut info as *mut _ as *mut _, + size_of_val(&info) as u32, + ) + }?; + unsafe { AssignProcessToJobObject(job_handle, HANDLE(child)) }?; + Ok(()) +} + #[cfg(test)] mod tests { use super::*;