Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'drm-rust-fixes-2025-12-29' of https://gitlab.freedesktop.org/drm/rust/kernel into drm-fixes

DRM Rust fixes for v6.19-rc4

MAINTAINERS:
- Fix Nova GPU driver git links.
- Fix typo in TYR driver entry preventing correct behavior of
scripts/get_maintainer.pl.
- Exclude TYR driver from DRM MISC.

Nova Core:
- Correctly select RUST_FW_LOADER_ABSTRACTIONS to prevent build
errors.
- Regenerate nova-core bindgen bindings with '--explicit-padding' to
avoid uninitialized bytes.
- Fix length of received GSP messages, due to miscalculated message
payload size.
- Regenerate bindings to derive MaybeZeroable.
- Use a bindings alias to derive the firmware version.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: "Danilo Krummrich" <dakr@kernel.org>
Link: https://patch.msgid.link/DFATYVSQRQ4W.1R030NZ34XUZK@kernel.org

+117 -100
+4 -3
MAINTAINERS
··· 2158 2158 L: dri-devel@lists.freedesktop.org 2159 2159 S: Supported 2160 2160 W: https://rust-for-linux.com/tyr-gpu-driver 2161 - W https://drm.pages.freedesktop.org/maintainer-tools/drm-rust.html 2161 + W: https://drm.pages.freedesktop.org/maintainer-tools/drm-rust.html 2162 2162 B: https://gitlab.freedesktop.org/panfrost/linux/-/issues 2163 2163 T: git https://gitlab.freedesktop.org/drm/rust/kernel.git 2164 2164 F: Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml ··· 8067 8067 Q: https://patchwork.freedesktop.org/project/nouveau/ 8068 8068 B: https://gitlab.freedesktop.org/drm/nova/-/issues 8069 8069 C: irc://irc.oftc.net/nouveau 8070 - T: git https://gitlab.freedesktop.org/drm/nova.git nova-next 8070 + T: git https://gitlab.freedesktop.org/drm/rust/kernel.git drm-rust-next 8071 8071 F: Documentation/gpu/nova/ 8072 8072 F: drivers/gpu/nova-core/ 8073 8073 ··· 8079 8079 Q: https://patchwork.freedesktop.org/project/nouveau/ 8080 8080 B: https://gitlab.freedesktop.org/drm/nova/-/issues 8081 8081 C: irc://irc.oftc.net/nouveau 8082 - T: git https://gitlab.freedesktop.org/drm/nova.git nova-next 8082 + T: git https://gitlab.freedesktop.org/drm/rust/kernel.git drm-rust-next 8083 8083 F: Documentation/gpu/nova/ 8084 8084 F: drivers/gpu/drm/nova/ 8085 8085 F: include/uapi/drm/nova_drm.h ··· 8357 8357 X: drivers/gpu/drm/nova/ 8358 8358 X: drivers/gpu/drm/radeon/ 8359 8359 X: drivers/gpu/drm/tegra/ 8360 + X: drivers/gpu/drm/tyr/ 8360 8361 X: drivers/gpu/drm/xe/ 8361 8362 8362 8363 DRM DRIVERS AND COMMON INFRASTRUCTURE [RUST]
+1 -1
drivers/gpu/nova-core/Kconfig
··· 3 3 depends on 64BIT 4 4 depends on PCI 5 5 depends on RUST 6 - depends on RUST_FW_LOADER_ABSTRACTIONS 6 + select RUST_FW_LOADER_ABSTRACTIONS 7 7 select AUXILIARY_BUS 8 8 default n 9 9 help
+8 -6
drivers/gpu/nova-core/gsp/cmdq.rs
··· 588 588 header.length(), 589 589 ); 590 590 591 + let payload_length = header.payload_length(); 592 + 591 593 // Check that the driver read area is large enough for the message. 592 - if slice_1.len() + slice_2.len() < header.length() { 594 + if slice_1.len() + slice_2.len() < payload_length { 593 595 return Err(EIO); 594 596 } 595 597 596 598 // Cut the message slices down to the actual length of the message. 597 - let (slice_1, slice_2) = if slice_1.len() > header.length() { 598 - // PANIC: we checked above that `slice_1` is at least as long as `msg_header.length()`. 599 - (slice_1.split_at(header.length()).0, &slice_2[0..0]) 599 + let (slice_1, slice_2) = if slice_1.len() > payload_length { 600 + // PANIC: we checked above that `slice_1` is at least as long as `payload_length`. 601 + (slice_1.split_at(payload_length).0, &slice_2[0..0]) 600 602 } else { 601 603 ( 602 604 slice_1, 603 605 // PANIC: we checked above that `slice_1.len() + slice_2.len()` is at least as 604 - // large as `msg_header.length()`. 605 - slice_2.split_at(header.length() - slice_1.len()).0, 606 + // large as `payload_length`. 607 + slice_2.split_at(payload_length - slice_1.len()).0, 606 608 ) 607 609 }; 608 610
+38 -40
drivers/gpu/nova-core/gsp/fw.rs
··· 141 141 // are valid. 142 142 unsafe impl FromBytes for GspFwWprMeta {} 143 143 144 - type GspFwWprMetaBootResumeInfo = r570_144::GspFwWprMeta__bindgen_ty_1; 145 - type GspFwWprMetaBootInfo = r570_144::GspFwWprMeta__bindgen_ty_1__bindgen_ty_1; 144 + type GspFwWprMetaBootResumeInfo = bindings::GspFwWprMeta__bindgen_ty_1; 145 + type GspFwWprMetaBootInfo = bindings::GspFwWprMeta__bindgen_ty_1__bindgen_ty_1; 146 146 147 147 impl GspFwWprMeta { 148 148 /// Fill in and return a `GspFwWprMeta` suitable for booting `gsp_firmware` using the ··· 150 150 pub(crate) fn new(gsp_firmware: &GspFirmware, fb_layout: &FbLayout) -> Self { 151 151 Self(bindings::GspFwWprMeta { 152 152 // CAST: we want to store the bits of `GSP_FW_WPR_META_MAGIC` unmodified. 153 - magic: r570_144::GSP_FW_WPR_META_MAGIC as u64, 154 - revision: u64::from(r570_144::GSP_FW_WPR_META_REVISION), 153 + magic: bindings::GSP_FW_WPR_META_MAGIC as u64, 154 + revision: u64::from(bindings::GSP_FW_WPR_META_REVISION), 155 155 sysmemAddrOfRadix3Elf: gsp_firmware.radix3_dma_handle(), 156 156 sizeOfRadix3Elf: u64::from_safe_cast(gsp_firmware.size), 157 157 sysmemAddrOfBootloader: gsp_firmware.bootloader.ucode.dma_handle(), ··· 315 315 #[repr(u32)] 316 316 pub(crate) enum SeqBufOpcode { 317 317 // Core operation opcodes 318 - CoreReset = r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_RESET, 319 - CoreResume = r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_RESUME, 320 - CoreStart = r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_START, 321 - CoreWaitForHalt = r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_WAIT_FOR_HALT, 318 + CoreReset = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_RESET, 319 + CoreResume = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_RESUME, 320 + CoreStart = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_START, 321 + CoreWaitForHalt = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_WAIT_FOR_HALT, 322 322 323 323 // Delay opcode 324 - DelayUs = r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_DELAY_US, 324 + DelayUs = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_DELAY_US, 325 325 326 326 // Register operation opcodes 327 - RegModify = r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_MODIFY, 328 - RegPoll = r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_POLL, 329 - RegStore = r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_STORE, 330 - RegWrite = r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_WRITE, 327 + RegModify = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_MODIFY, 328 + RegPoll = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_POLL, 329 + RegStore = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_STORE, 330 + RegWrite = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_WRITE, 331 331 } 332 332 333 333 impl fmt::Display for SeqBufOpcode { ··· 351 351 352 352 fn try_from(value: u32) -> Result<SeqBufOpcode> { 353 353 match value { 354 - r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_RESET => { 354 + bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_RESET => { 355 355 Ok(SeqBufOpcode::CoreReset) 356 356 } 357 - r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_RESUME => { 357 + bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_RESUME => { 358 358 Ok(SeqBufOpcode::CoreResume) 359 359 } 360 - r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_START => { 360 + bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_START => { 361 361 Ok(SeqBufOpcode::CoreStart) 362 362 } 363 - r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_WAIT_FOR_HALT => { 363 + bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_WAIT_FOR_HALT => { 364 364 Ok(SeqBufOpcode::CoreWaitForHalt) 365 365 } 366 - r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_DELAY_US => Ok(SeqBufOpcode::DelayUs), 367 - r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_MODIFY => { 366 + bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_DELAY_US => Ok(SeqBufOpcode::DelayUs), 367 + bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_MODIFY => { 368 368 Ok(SeqBufOpcode::RegModify) 369 369 } 370 - r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_POLL => Ok(SeqBufOpcode::RegPoll), 371 - r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_STORE => Ok(SeqBufOpcode::RegStore), 372 - r570_144::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_WRITE => Ok(SeqBufOpcode::RegWrite), 370 + bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_POLL => Ok(SeqBufOpcode::RegPoll), 371 + bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_STORE => Ok(SeqBufOpcode::RegStore), 372 + bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_WRITE => Ok(SeqBufOpcode::RegWrite), 373 373 _ => Err(EINVAL), 374 374 } 375 375 } ··· 385 385 /// Wrapper for GSP sequencer register write payload. 386 386 #[repr(transparent)] 387 387 #[derive(Copy, Clone)] 388 - pub(crate) struct RegWritePayload(r570_144::GSP_SEQ_BUF_PAYLOAD_REG_WRITE); 388 + pub(crate) struct RegWritePayload(bindings::GSP_SEQ_BUF_PAYLOAD_REG_WRITE); 389 389 390 390 impl RegWritePayload { 391 391 /// Returns the register address. ··· 408 408 /// Wrapper for GSP sequencer register modify payload. 409 409 #[repr(transparent)] 410 410 #[derive(Copy, Clone)] 411 - pub(crate) struct RegModifyPayload(r570_144::GSP_SEQ_BUF_PAYLOAD_REG_MODIFY); 411 + pub(crate) struct RegModifyPayload(bindings::GSP_SEQ_BUF_PAYLOAD_REG_MODIFY); 412 412 413 413 impl RegModifyPayload { 414 414 /// Returns the register address. ··· 436 436 /// Wrapper for GSP sequencer register poll payload. 437 437 #[repr(transparent)] 438 438 #[derive(Copy, Clone)] 439 - pub(crate) struct RegPollPayload(r570_144::GSP_SEQ_BUF_PAYLOAD_REG_POLL); 439 + pub(crate) struct RegPollPayload(bindings::GSP_SEQ_BUF_PAYLOAD_REG_POLL); 440 440 441 441 impl RegPollPayload { 442 442 /// Returns the register address. ··· 469 469 /// Wrapper for GSP sequencer delay payload. 470 470 #[repr(transparent)] 471 471 #[derive(Copy, Clone)] 472 - pub(crate) struct DelayUsPayload(r570_144::GSP_SEQ_BUF_PAYLOAD_DELAY_US); 472 + pub(crate) struct DelayUsPayload(bindings::GSP_SEQ_BUF_PAYLOAD_DELAY_US); 473 473 474 474 impl DelayUsPayload { 475 475 /// Returns the delay value in microseconds. ··· 487 487 /// Wrapper for GSP sequencer register store payload. 488 488 #[repr(transparent)] 489 489 #[derive(Copy, Clone)] 490 - pub(crate) struct RegStorePayload(r570_144::GSP_SEQ_BUF_PAYLOAD_REG_STORE); 490 + pub(crate) struct RegStorePayload(bindings::GSP_SEQ_BUF_PAYLOAD_REG_STORE); 491 491 492 492 impl RegStorePayload { 493 493 /// Returns the register address. ··· 510 510 511 511 /// Wrapper for GSP sequencer buffer command. 512 512 #[repr(transparent)] 513 - pub(crate) struct SequencerBufferCmd(r570_144::GSP_SEQUENCER_BUFFER_CMD); 513 + pub(crate) struct SequencerBufferCmd(bindings::GSP_SEQUENCER_BUFFER_CMD); 514 514 515 515 impl SequencerBufferCmd { 516 516 /// Returns the opcode as a `SeqBufOpcode` enum, or error if invalid. ··· 612 612 613 613 /// Wrapper for GSP run CPU sequencer RPC. 614 614 #[repr(transparent)] 615 - pub(crate) struct RunCpuSequencer(r570_144::rpc_run_cpu_sequencer_v17_00); 615 + pub(crate) struct RunCpuSequencer(bindings::rpc_run_cpu_sequencer_v17_00); 616 616 617 617 impl RunCpuSequencer { 618 618 /// Returns the command index. ··· 797 797 } 798 798 } 799 799 800 - // SAFETY: We can't derive the Zeroable trait for this binding because the 801 - // procedural macro doesn't support the syntax used by bindgen to create the 802 - // __IncompleteArrayField types. So instead we implement it here, which is safe 803 - // because these are explicitly padded structures only containing types for 804 - // which any bit pattern, including all zeros, is valid. 805 - unsafe impl Zeroable for bindings::rpc_message_header_v {} 806 - 807 800 /// GSP Message Element. 808 801 /// 809 802 /// This is essentially a message header expected to be followed by the message data. ··· 846 853 self.inner.checkSum = checksum; 847 854 } 848 855 849 - /// Returns the total length of the message. 856 + /// Returns the length of the message's payload. 857 + pub(crate) fn payload_length(&self) -> usize { 858 + // `rpc.length` includes the length of the RPC message header. 859 + num::u32_as_usize(self.inner.rpc.length) 860 + .saturating_sub(size_of::<bindings::rpc_message_header_v>()) 861 + } 862 + 863 + /// Returns the total length of the message, message and RPC headers included. 850 864 pub(crate) fn length(&self) -> usize { 851 - // `rpc.length` includes the length of the GspRpcHeader but not the message header. 852 - size_of::<Self>() - size_of::<bindings::rpc_message_header_v>() 853 - + num::u32_as_usize(self.inner.rpc.length) 865 + size_of::<Self>() + self.payload_length() 854 866 } 855 867 856 868 // Returns the sequence number of the message.
+7 -4
drivers/gpu/nova-core/gsp/fw/r570_144.rs
··· 24 24 unreachable_pub, 25 25 unsafe_op_in_unsafe_fn 26 26 )] 27 - use kernel::{ 28 - ffi, 29 - prelude::Zeroable, // 30 - }; 27 + use kernel::ffi; 28 + use pin_init::MaybeZeroable; 29 + 31 30 include!("r570_144/bindings.rs"); 31 + 32 + // SAFETY: This type has a size of zero, so its inclusion into another type should not affect their 33 + // ability to implement `Zeroable`. 34 + unsafe impl<T> kernel::prelude::Zeroable for __IncompleteArrayField<T> {}
+59 -46
drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs
··· 320 320 pub const NV_VGPU_MSG_EVENT_NUM_EVENTS: _bindgen_ty_3 = 4131; 321 321 pub type _bindgen_ty_3 = ffi::c_uint; 322 322 #[repr(C)] 323 - #[derive(Debug, Default, Copy, Clone)] 323 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 324 324 pub struct NV0080_CTRL_GPU_GET_SRIOV_CAPS_PARAMS { 325 325 pub totalVFs: u32_, 326 326 pub firstVfOffset: u32_, 327 327 pub vfFeatureMask: u32_, 328 + pub __bindgen_padding_0: [u8; 4usize], 328 329 pub FirstVFBar0Address: u64_, 329 330 pub FirstVFBar1Address: u64_, 330 331 pub FirstVFBar2Address: u64_, ··· 341 340 pub bClientRmAllocatedCtxBuffer: u8_, 342 341 pub bNonPowerOf2ChannelCountSupported: u8_, 343 342 pub bVfResizableBAR1Supported: u8_, 343 + pub __bindgen_padding_1: [u8; 7usize], 344 344 } 345 345 #[repr(C)] 346 - #[derive(Debug, Default, Copy, Clone)] 346 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 347 347 pub struct NV2080_CTRL_BIOS_GET_SKU_INFO_PARAMS { 348 348 pub BoardID: u32_, 349 349 pub chipSKU: [ffi::c_char; 9usize], 350 350 pub chipSKUMod: [ffi::c_char; 5usize], 351 + pub __bindgen_padding_0: [u8; 2usize], 351 352 pub skuConfigVersion: u32_, 352 353 pub project: [ffi::c_char; 5usize], 353 354 pub projectSKU: [ffi::c_char; 5usize], 354 355 pub CDP: [ffi::c_char; 6usize], 355 356 pub projectSKUMod: [ffi::c_char; 2usize], 357 + pub __bindgen_padding_1: [u8; 2usize], 356 358 pub businessCycle: u32_, 357 359 } 358 360 pub type NV2080_CTRL_CMD_FB_GET_FB_REGION_SURFACE_MEM_TYPE_FLAG = [u8_; 17usize]; 359 361 #[repr(C)] 360 - #[derive(Debug, Default, Copy, Clone)] 362 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 361 363 pub struct NV2080_CTRL_CMD_FB_GET_FB_REGION_FB_REGION_INFO { 362 364 pub base: u64_, 363 365 pub limit: u64_, ··· 372 368 pub blackList: NV2080_CTRL_CMD_FB_GET_FB_REGION_SURFACE_MEM_TYPE_FLAG, 373 369 } 374 370 #[repr(C)] 375 - #[derive(Debug, Default, Copy, Clone)] 371 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 376 372 pub struct NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_PARAMS { 377 373 pub numFBRegions: u32_, 374 + pub __bindgen_padding_0: [u8; 4usize], 378 375 pub fbRegion: [NV2080_CTRL_CMD_FB_GET_FB_REGION_FB_REGION_INFO; 16usize], 379 376 } 380 377 #[repr(C)] 381 - #[derive(Debug, Copy, Clone)] 378 + #[derive(Debug, Copy, Clone, MaybeZeroable)] 382 379 pub struct NV2080_CTRL_GPU_GET_GID_INFO_PARAMS { 383 380 pub index: u32_, 384 381 pub flags: u32_, ··· 396 391 } 397 392 } 398 393 #[repr(C)] 399 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 394 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 400 395 pub struct DOD_METHOD_DATA { 401 396 pub status: u32_, 402 397 pub acpiIdListLen: u32_, 403 398 pub acpiIdList: [u32_; 16usize], 404 399 } 405 400 #[repr(C)] 406 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 401 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 407 402 pub struct JT_METHOD_DATA { 408 403 pub status: u32_, 409 404 pub jtCaps: u32_, ··· 412 407 pub __bindgen_padding_0: u8, 413 408 } 414 409 #[repr(C)] 415 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 410 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 416 411 pub struct MUX_METHOD_DATA_ELEMENT { 417 412 pub acpiId: u32_, 418 413 pub mode: u32_, 419 414 pub status: u32_, 420 415 } 421 416 #[repr(C)] 422 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 417 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 423 418 pub struct MUX_METHOD_DATA { 424 419 pub tableLen: u32_, 425 420 pub acpiIdMuxModeTable: [MUX_METHOD_DATA_ELEMENT; 16usize], ··· 427 422 pub acpiIdMuxStateTable: [MUX_METHOD_DATA_ELEMENT; 16usize], 428 423 } 429 424 #[repr(C)] 430 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 425 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 431 426 pub struct CAPS_METHOD_DATA { 432 427 pub status: u32_, 433 428 pub optimusCaps: u32_, 434 429 } 435 430 #[repr(C)] 436 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 431 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 437 432 pub struct ACPI_METHOD_DATA { 438 433 pub bValid: u8_, 439 434 pub __bindgen_padding_0: [u8; 3usize], ··· 443 438 pub capsMethodData: CAPS_METHOD_DATA, 444 439 } 445 440 #[repr(C)] 446 - #[derive(Debug, Default, Copy, Clone)] 441 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 447 442 pub struct VIRTUAL_DISPLAY_GET_MAX_RESOLUTION_PARAMS { 448 443 pub headIndex: u32_, 449 444 pub maxHResolution: u32_, 450 445 pub maxVResolution: u32_, 451 446 } 452 447 #[repr(C)] 453 - #[derive(Debug, Default, Copy, Clone)] 448 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 454 449 pub struct VIRTUAL_DISPLAY_GET_NUM_HEADS_PARAMS { 455 450 pub numHeads: u32_, 456 451 pub maxNumHeads: u32_, 457 452 } 458 453 #[repr(C)] 459 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 454 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 460 455 pub struct BUSINFO { 461 456 pub deviceID: u16_, 462 457 pub vendorID: u16_, ··· 466 461 pub __bindgen_padding_0: u8, 467 462 } 468 463 #[repr(C)] 469 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 464 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 470 465 pub struct GSP_VF_INFO { 471 466 pub totalVFs: u32_, 472 467 pub firstVFOffset: u32_, ··· 479 474 pub __bindgen_padding_0: [u8; 5usize], 480 475 } 481 476 #[repr(C)] 482 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 477 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 483 478 pub struct GSP_PCIE_CONFIG_REG { 484 479 pub linkCap: u32_, 485 480 } 486 481 #[repr(C)] 487 - #[derive(Debug, Default, Copy, Clone)] 482 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 488 483 pub struct EcidManufacturingInfo { 489 484 pub ecidLow: u32_, 490 485 pub ecidHigh: u32_, 491 486 pub ecidExtended: u32_, 492 487 } 493 488 #[repr(C)] 494 - #[derive(Debug, Default, Copy, Clone)] 489 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 495 490 pub struct FW_WPR_LAYOUT_OFFSET { 496 491 pub nonWprHeapOffset: u64_, 497 492 pub frtsOffset: u64_, 498 493 } 499 494 #[repr(C)] 500 - #[derive(Debug, Copy, Clone)] 495 + #[derive(Debug, Copy, Clone, MaybeZeroable)] 501 496 pub struct GspStaticConfigInfo_t { 502 497 pub grCapsBits: [u8_; 23usize], 498 + pub __bindgen_padding_0: u8, 503 499 pub gidInfo: NV2080_CTRL_GPU_GET_GID_INFO_PARAMS, 504 500 pub SKUInfo: NV2080_CTRL_BIOS_GET_SKU_INFO_PARAMS, 501 + pub __bindgen_padding_1: [u8; 4usize], 505 502 pub fbRegionInfoParams: NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_PARAMS, 506 503 pub sriovCaps: NV0080_CTRL_GPU_GET_SRIOV_CAPS_PARAMS, 507 504 pub sriovMaxGfid: u32_, 508 505 pub engineCaps: [u32_; 3usize], 509 506 pub poisonFuseEnabled: u8_, 507 + pub __bindgen_padding_2: [u8; 7usize], 510 508 pub fb_length: u64_, 511 509 pub fbio_mask: u64_, 512 510 pub fb_bus_width: u32_, ··· 535 527 pub bIsMigSupported: u8_, 536 528 pub RTD3GC6TotalBoardPower: u16_, 537 529 pub RTD3GC6PerstDelay: u16_, 530 + pub __bindgen_padding_3: [u8; 2usize], 538 531 pub bar1PdeBase: u64_, 539 532 pub bar2PdeBase: u64_, 540 533 pub bVbiosValid: u8_, 534 + pub __bindgen_padding_4: [u8; 3usize], 541 535 pub vbiosSubVendor: u32_, 542 536 pub vbiosSubDevice: u32_, 543 537 pub bPageRetirementSupported: u8_, 544 538 pub bSplitVasBetweenServerClientRm: u8_, 545 539 pub bClRootportNeedsNosnoopWAR: u8_, 540 + pub __bindgen_padding_5: u8, 546 541 pub displaylessMaxHeads: VIRTUAL_DISPLAY_GET_NUM_HEADS_PARAMS, 547 542 pub displaylessMaxResolution: VIRTUAL_DISPLAY_GET_MAX_RESOLUTION_PARAMS, 543 + pub __bindgen_padding_6: [u8; 4usize], 548 544 pub displaylessMaxPixels: u64_, 549 545 pub hInternalClient: u32_, 550 546 pub hInternalDevice: u32_, ··· 570 558 } 571 559 } 572 560 #[repr(C)] 573 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 561 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 574 562 pub struct GspSystemInfo { 575 563 pub gpuPhysAddr: u64_, 576 564 pub gpuPhysFbAddr: u64_, ··· 627 615 pub hostPageSize: u64_, 628 616 } 629 617 #[repr(C)] 630 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 618 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 631 619 pub struct MESSAGE_QUEUE_INIT_ARGUMENTS { 632 620 pub sharedMemPhysAddr: u64_, 633 621 pub pageTableEntryCount: u32_, ··· 636 624 pub statQueueOffset: u64_, 637 625 } 638 626 #[repr(C)] 639 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 627 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 640 628 pub struct GSP_SR_INIT_ARGUMENTS { 641 629 pub oldLevel: u32_, 642 630 pub flags: u32_, ··· 644 632 pub __bindgen_padding_0: [u8; 3usize], 645 633 } 646 634 #[repr(C)] 647 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 635 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 648 636 pub struct GSP_ARGUMENTS_CACHED { 649 637 pub messageQueueInitArguments: MESSAGE_QUEUE_INIT_ARGUMENTS, 650 638 pub srInitArguments: GSP_SR_INIT_ARGUMENTS, ··· 654 642 pub profilerArgs: GSP_ARGUMENTS_CACHED__bindgen_ty_1, 655 643 } 656 644 #[repr(C)] 657 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 645 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 658 646 pub struct GSP_ARGUMENTS_CACHED__bindgen_ty_1 { 659 647 pub pa: u64_, 660 648 pub size: u64_, 661 649 } 662 650 #[repr(C)] 663 - #[derive(Copy, Clone, Zeroable)] 651 + #[derive(Copy, Clone, MaybeZeroable)] 664 652 pub union rpc_message_rpc_union_field_v03_00 { 665 653 pub spare: u32_, 666 654 pub cpuRmGfid: u32_, ··· 676 664 } 677 665 pub type rpc_message_rpc_union_field_v = rpc_message_rpc_union_field_v03_00; 678 666 #[repr(C)] 667 + #[derive(MaybeZeroable)] 679 668 pub struct rpc_message_header_v03_00 { 680 669 pub header_version: u32_, 681 670 pub signature: u32_, ··· 699 686 } 700 687 pub type rpc_message_header_v = rpc_message_header_v03_00; 701 688 #[repr(C)] 702 - #[derive(Copy, Clone, Zeroable)] 689 + #[derive(Copy, Clone, MaybeZeroable)] 703 690 pub struct GspFwWprMeta { 704 691 pub magic: u64_, 705 692 pub revision: u64_, ··· 734 721 pub verified: u64_, 735 722 } 736 723 #[repr(C)] 737 - #[derive(Copy, Clone, Zeroable)] 724 + #[derive(Copy, Clone, MaybeZeroable)] 738 725 pub union GspFwWprMeta__bindgen_ty_1 { 739 726 pub __bindgen_anon_1: GspFwWprMeta__bindgen_ty_1__bindgen_ty_1, 740 727 pub __bindgen_anon_2: GspFwWprMeta__bindgen_ty_1__bindgen_ty_2, 741 728 } 742 729 #[repr(C)] 743 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 730 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 744 731 pub struct GspFwWprMeta__bindgen_ty_1__bindgen_ty_1 { 745 732 pub sysmemAddrOfSignature: u64_, 746 733 pub sizeOfSignature: u64_, 747 734 } 748 735 #[repr(C)] 749 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 736 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 750 737 pub struct GspFwWprMeta__bindgen_ty_1__bindgen_ty_2 { 751 738 pub gspFwHeapFreeListWprOffset: u32_, 752 739 pub unused0: u32_, ··· 762 749 } 763 750 } 764 751 #[repr(C)] 765 - #[derive(Copy, Clone, Zeroable)] 752 + #[derive(Copy, Clone, MaybeZeroable)] 766 753 pub union GspFwWprMeta__bindgen_ty_2 { 767 754 pub __bindgen_anon_1: GspFwWprMeta__bindgen_ty_2__bindgen_ty_1, 768 755 pub __bindgen_anon_2: GspFwWprMeta__bindgen_ty_2__bindgen_ty_2, 769 756 } 770 757 #[repr(C)] 771 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 758 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 772 759 pub struct GspFwWprMeta__bindgen_ty_2__bindgen_ty_1 { 773 760 pub partitionRpcAddr: u64_, 774 761 pub partitionRpcRequestOffset: u16_, ··· 780 767 pub lsUcodeVersion: u32_, 781 768 } 782 769 #[repr(C)] 783 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 770 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 784 771 pub struct GspFwWprMeta__bindgen_ty_2__bindgen_ty_2 { 785 772 pub partitionRpcPadding: [u32_; 4usize], 786 773 pub sysmemAddrOfCrashReportQueue: u64_, ··· 815 802 pub const LibosMemoryRegionLoc_LIBOS_MEMORY_REGION_LOC_FB: LibosMemoryRegionLoc = 2; 816 803 pub type LibosMemoryRegionLoc = ffi::c_uint; 817 804 #[repr(C)] 818 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 805 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 819 806 pub struct LibosMemoryRegionInitArgument { 820 807 pub id8: LibosAddress, 821 808 pub pa: LibosAddress, ··· 825 812 pub __bindgen_padding_0: [u8; 6usize], 826 813 } 827 814 #[repr(C)] 828 - #[derive(Debug, Default, Copy, Clone)] 815 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 829 816 pub struct PACKED_REGISTRY_ENTRY { 830 817 pub nameOffset: u32_, 831 818 pub type_: u8_, ··· 834 821 pub length: u32_, 835 822 } 836 823 #[repr(C)] 837 - #[derive(Debug, Default)] 824 + #[derive(Debug, Default, MaybeZeroable)] 838 825 pub struct PACKED_REGISTRY_TABLE { 839 826 pub size: u32_, 840 827 pub numEntries: u32_, 841 828 pub entries: __IncompleteArrayField<PACKED_REGISTRY_ENTRY>, 842 829 } 843 830 #[repr(C)] 844 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 831 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 845 832 pub struct msgqTxHeader { 846 833 pub version: u32_, 847 834 pub size: u32_, ··· 853 840 pub entryOff: u32_, 854 841 } 855 842 #[repr(C)] 856 - #[derive(Debug, Default, Copy, Clone, Zeroable)] 843 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 857 844 pub struct msgqRxHeader { 858 845 pub readPtr: u32_, 859 846 } 860 847 #[repr(C)] 861 848 #[repr(align(8))] 862 - #[derive(Zeroable)] 849 + #[derive(MaybeZeroable)] 863 850 pub struct GSP_MSG_QUEUE_ELEMENT { 864 851 pub authTagBuffer: [u8_; 16usize], 865 852 pub aadBuffer: [u8_; 16usize], ··· 879 866 } 880 867 } 881 868 #[repr(C)] 882 - #[derive(Debug, Default)] 869 + #[derive(Debug, Default, MaybeZeroable)] 883 870 pub struct rpc_run_cpu_sequencer_v17_00 { 884 871 pub bufferSizeDWord: u32_, 885 872 pub cmdIndex: u32_, ··· 897 884 pub const GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_RESUME: GSP_SEQ_BUF_OPCODE = 8; 898 885 pub type GSP_SEQ_BUF_OPCODE = ffi::c_uint; 899 886 #[repr(C)] 900 - #[derive(Debug, Default, Copy, Clone)] 887 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 901 888 pub struct GSP_SEQ_BUF_PAYLOAD_REG_WRITE { 902 889 pub addr: u32_, 903 890 pub val: u32_, 904 891 } 905 892 #[repr(C)] 906 - #[derive(Debug, Default, Copy, Clone)] 893 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 907 894 pub struct GSP_SEQ_BUF_PAYLOAD_REG_MODIFY { 908 895 pub addr: u32_, 909 896 pub mask: u32_, 910 897 pub val: u32_, 911 898 } 912 899 #[repr(C)] 913 - #[derive(Debug, Default, Copy, Clone)] 900 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 914 901 pub struct GSP_SEQ_BUF_PAYLOAD_REG_POLL { 915 902 pub addr: u32_, 916 903 pub mask: u32_, ··· 919 906 pub error: u32_, 920 907 } 921 908 #[repr(C)] 922 - #[derive(Debug, Default, Copy, Clone)] 909 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 923 910 pub struct GSP_SEQ_BUF_PAYLOAD_DELAY_US { 924 911 pub val: u32_, 925 912 } 926 913 #[repr(C)] 927 - #[derive(Debug, Default, Copy, Clone)] 914 + #[derive(Debug, Default, Copy, Clone, MaybeZeroable)] 928 915 pub struct GSP_SEQ_BUF_PAYLOAD_REG_STORE { 929 916 pub addr: u32_, 930 917 pub index: u32_, 931 918 } 932 919 #[repr(C)] 933 - #[derive(Copy, Clone)] 920 + #[derive(Copy, Clone, MaybeZeroable)] 934 921 pub struct GSP_SEQUENCER_BUFFER_CMD { 935 922 pub opCode: GSP_SEQ_BUF_OPCODE, 936 923 pub payload: GSP_SEQUENCER_BUFFER_CMD__bindgen_ty_1, 937 924 } 938 925 #[repr(C)] 939 - #[derive(Copy, Clone)] 926 + #[derive(Copy, Clone, MaybeZeroable)] 940 927 pub union GSP_SEQUENCER_BUFFER_CMD__bindgen_ty_1 { 941 928 pub regWrite: GSP_SEQ_BUF_PAYLOAD_REG_WRITE, 942 929 pub regModify: GSP_SEQ_BUF_PAYLOAD_REG_MODIFY,