STRUCT DRM_PANTHOR_VM_CREATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct drm_panthor_vm_create(9) πŸŽ€

okay so bestie, this is a page from the Kernel API Manual and it's literally all about struct drm_panthor_vm_create β€” the little args package you hand over to DRM_PANTHOR_IOCTL_VM_CREATE when you want a shiny new VM. no cap, that's the whole vibe. πŸ’–


✨ NAME ✨

struct drm_panthor_vm_create β€” the arguments you pass in to DRM_PANTHOR_IOCTL_VM_CREATE 🫢


🌸 SYNOPSIS 🌸

struct drm_panthor_vm_create {
    __u32 flags;
    __u32 id;
    __u64 user_va_range;
 };

look at her. three fields. immaculate. πŸ‘‘


πŸ¦‹ Members πŸ¦‹

okay let's meet the cast, one by one, they all ate:

  • flags β€” the VM flags. MBZ, and if you don't know what MBZ means, it stands for Must Be Zero β€” so like… don't touch, bestie. leave it at zero, it's giving ✨respect the protocol✨.
  • id β€” this one's a returned VM ID. so the kernel fills it in for you, you don't write it. it's the kernel's little gift back 🎁.
  • user_va_range β€” the size of the VA space that's reserved for user objects. this is the main character of the struct, fr fr.
okay so this next bit is important, listen up πŸ’€

the kernel is gonna pick the remaining space to map kernel-only objects into the VM β€” and by that I mean heap chunks, heap context, ring buffers, kernel synchronization objects, ... the whole squad. 😭 so if the space left over for kernel objects is too small, kernel object allocation will fail further down the road. like, not now. later. sneak attack. πŸ’€

one can use drm_panthor_gpu_info::mmu_features to extract the total virtual address range, and then chose a user_va_range that leaves some space to the kernel. (yes, that's "chose" β€” the original says "chose" β€” we don't gatekeep, we just quote 🫢)

if user_va_range is zero, the kernel will pick a sensible value based on TASK_SIZE and the virtual range supported by the GPU MMU. and like, the reasoning is kind of iconic: the kernel/user split should leave enough VA space for userspace processes to support SVM, while still allowing the kernel to map some amount of kernel objects in the kernel VA range. ✨ the value chosen by the driver will be returned in user_va_range β€” so you get to see what it decided, slay πŸ™ˆ

and for the layout girlies: user VA space always starts at 0x0, and kernel VA space is always placed after the user VA range. periodt. πŸ’…


🌈 SEE ALSO 🌈

literally so many friends, buckle up bestie, this is the whole group chat:

  • Kernel file ./include/uapi/drm/panthor_drm.h
  • Introduction(9)
  • MMIO regions exposed to userspace.(9)
  • IOCTL IDs(9)
  • IOCTL arguments(9)
  • struct drm_panthor_obj_array(9)
  • DRM_PANTHOR_OBJ_ARRAY(9)
  • enum drm_panthor_sync_op_flags(9)
  • struct drm_panthor_sync_op(9)
  • enum drm_panthor_dev_query_type(9)
  • enum drm_panthor_gpu_coherency(9)
  • struct drm_panthor_gpu_info(9)
  • struct drm_panthor_csif_info(9)
  • enum drm_panthor_timestamp_info_flags(9)
  • struct drm_panthor_timestamp_info(9)
  • struct drm_panthor_mmu_info(9)
  • struct drm_panthor_group_priorities_info(9)
  • struct drm_panthor_dev_query(9)
  • struct drm_panthor_vm_destroy(9)
  • enum drm_panthor_vm_bind_op_flags(9)
  • struct drm_panthor_vm_bind_op(9)
  • enum drm_panthor_vm_bind_flags(9)
  • struct drm_panthor_vm_bind(9)
  • enum drm_panthor_vm_state(9)
  • struct drm_panthor_vm_get_state(9)
  • enum drm_panthor_bo_flags(9)
  • struct drm_panthor_bo_create(9)
  • struct drm_panthor_bo_mmap_offset(9)
  • struct drm_panthor_queue_create(9)
  • enum drm_panthor_group_priority(9)
  • struct drm_panthor_group_create(9)
  • struct drm_panthor_group_destroy(9)
  • struct drm_panthor_queue_submit(9)
  • struct drm_panthor_group_submit(9)
  • enum drm_panthor_group_state_flags(9)
  • struct drm_panthor_group_get_state(9)
  • struct drm_panthor_tiler_heap_create(9)
  • struct drm_panthor_tiler_heap_destroy(9)
  • struct drm_panthor_bo_set_label(9)
  • struct drm_panthor_set_user_mmio_offset(9)
  • enum drm_panthor_bo_sync_op_type(9)
  • struct drm_panthor_bo_sync_op(9)
  • struct drm_panthor_bo_sync(9)
  • enum drm_panthor_bo_extra_flags(9)
  • struct drm_panthor_bo_query_info(9)
  • DRM_IOCTL_PANTHOR(9)

and that's the page, bestie!! πŸ§šπŸ’œ this little drop came from ./include/uapi/drm and it's dated October 2026 β€” go forth and create VMs responsibly, ily, bye!! πŸŒΈπŸŽ€πŸ’–

πŸ“¦ where this page comes from