]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gpu: nova-core: Add a slice-buffer (sbuffer) datastructure
authorJoel Fernandes <joelagnelf@nvidia.com>
Mon, 10 Nov 2025 13:34:14 +0000 (22:34 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Fri, 14 Nov 2025 11:25:56 +0000 (20:25 +0900)
commitd416035fb6fb4367e40388552ff8079a97c7155f
tree9183081f5192cab287f7563e9ce070df1864c4ac
parent41235c40eda024f8d2a1e2456ab7a82c9db05e78
gpu: nova-core: Add a slice-buffer (sbuffer) datastructure

A data structure that can be used to write across multiple slices which
may be out of order in memory. This lets SBuffer user correctly and
safely write out of memory order, without error-prone tracking of
pointers/offsets.

    let mut buf1 = [0u8; 3];
    let mut buf2 = [0u8; 5];
    let mut sbuffer = SBuffer::new([&mut buf1[..], &mut buf2[..]]);

    let data = b"hello";
    let result = sbuffer.write(data);

Reviewed-by: Lyude Paul <lyude@redhat.com>
Co-developed-by: Alistair Popple <apopple@nvidia.com>
Signed-off-by: Alistair Popple <apopple@nvidia.com>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Co-developed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Message-ID: <20251110-gsp_boot-v9-6-8ae4058e3c0e@nvidia.com>
drivers/gpu/nova-core/nova_core.rs
drivers/gpu/nova-core/sbuffer.rs [new file with mode: 0644]