STRUCT DRM_GPUVA_OP_REMAP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct drm_gpuva_op_remap(9) β€” GPU VA remap operation πŸŽ€

okay so bestie, welcome to the Kernel API Manual ✨ (yes that's the manual name, we're being fancy today). This one's about struct drm_gpuva_op_remap, and honestly it's giving "quietly iconic supporting character" energy β€” it doesn't do the whole job itself, it just tells the driver how the mapping situation got split. Let's get into it πŸ’…


✨ NAME ✨

struct drm_gpuva_op_remap β€” the GPU VA remap operation, periodt πŸ’–


🌸 SYNOPSIS 🌸

struct drm_gpuva_op_remap {
    struct drm_gpuva_op_map *prev;
    struct drm_gpuva_op_map *next;
    struct drm_gpuva_op_unmap *unmap;
 };

three lil pointers, one big job 🫢


πŸ¦‹ Members πŸ¦‹

  • prev β€” the preceding part of a split mapping. like, the leftovers before the cut βœ‚οΈ
  • next β€” the subsequent part of a split mapping. the leftovers after the cut, bestie ⭐
  • unmap β€” the unmap operation for the original existing mapping. somebody's gotta clean up the original πŸ‘‘

πŸ’œ Description πŸ’œ

so this represents a single remap operation generated by the DRM GPU VA manager. one operation, one remap, no cap πŸ’…

A remap operation is generated when an existing GPU VA mmapping is split up by inserting a new GPU VA mapping or by partially unmapping existent mapping(s) β€” hence it consists of a maximum of two map and one unmap operation. iykyk 🌈

The unmap operation takes care of removing the original existing mapping. prev is used to remap the preceding part, next the subsequent part. the way that's literally the whole plan 🧚

Now for the alignment lore, listen up πŸ‘‘ β€” if either a new mapping's start address is aligned with the start address of the old mapping, or the new mapping's end address is aligned with the end address of the old mapping, then either prev or next is NULL. This will also be the case when the requested mapping begins before the old mapping's start address or stretches beyond its end address. so yeah, don't go dereferencing both without a vibe check first 😭

Note πŸ“ β€” the reason for a dedicated remap operation, rather than arbitrary unmap and map operations, is to give drivers the chance of extracting driver specific data for creating the new mappings from the unmap operations's drm_gpuva structure, which typically is embedded in larger driver specific structures. that's the whole point fr fr β€” it's giving driver-specific-data-extraction main character energy 🌟

πŸ’€ SEE ALSO πŸ’€

Kernel file ./include/drm/drm_gpuvm.h β€” and the whole extended friend group, in order, no skips 🫢


okay and that's the whole page bestie 🌸 this cutie landed from ./include/drm, the October 2026 edition of struct drm_gpuva_op_remap(9) β€” go read the source, slay, bye πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from