xe_bo_validate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xe_bo_validate(9) β€” Kernel API Manual ✨

okay so bestie, welcome to the xe_bo_validate(9) page, straight out of the Kernel API Manual. this is the function that makes sure your buffer object is actually where it's supposed to be. no cap. let's get into it 🫢


🌸 NAME 🌸

xe_bo_validate β€” Make sure the bo is in an allowed placement πŸ’–

like literally, that's the whole job. it checks the placement is legal and fixes it if not.


✨ SYNOPSIS ✨

int xe_bo_validate (struct xe_bo *bo , struct xe_vm *vm , bool
       allow_res_evict , struct drm_exec *exec );

it returns an int. that's gonna matter later, bestie. πŸ‘€


πŸ’… ARGUMENTS πŸ’…

  • bo β€” The bo, ✨ (yes that's the entire description, she's brief, she's iconic, periodt).
  • vm β€” Pointer to the vm the bo shares a locked dma_resv object with, or NULL. used together with allow_res_evict, so don't forget about her.
  • allow_res_evict β€” Whether it's allowed to evict bos sharing the vm's reservation object. like, are we permitted to kick them out or not πŸ™ˆ
  • exec β€” The drm_exec transaction to use for exhaustive eviction. she's the paperwork for the whole eviction situation.

πŸ”₯ DESCRIPTION πŸ”₯

So the vibe check here: xe_bo_validate makes sure the bo is in allowed placement, and it migrates it if necessary. migrating, moving, relocating β€” she does the work so you don't have to πŸ’…

and if needed? other bos will be evicted. yes, evicted. it's giving real estate drama 😭.

here's the nuance though, and this part is important: if the bos selected for eviction share the vm's reservation object, they can be evicted iff allow_res_evict is set to true. otherwise they will be bypassed. so like, if that flag isn't set, those bos get skipped entirely β€” no eviction for them, no exceptions. iykyk πŸŽ€


⭐ RETURN ⭐

  • 0 on success πŸŽ‰ slay.
  • a negative error code on failure, so watch out for that.
  • it may return -EINTR or -ERESTARTSYS if internal waits are interrupted by a signal β€” so if a signal comes through mid-wait, that's what you get back, and it's not a bug, it's just how she works fr fr πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./drivers/gpu/drm/xe/xe_bo.c, plus the whole extended friend group:


ok that's the whole page bestie, you now know everything there is to know about validating a bo 🧚 go forth and place your buffer objects correctly. literally iconic of you. πŸ’œ

kisses, this one lives in ./drivers/gpu/drm/xe, dated October 2026, and that's the xe_bo_validate(9) sign-off πŸ“πŸ’–

πŸ“¦ where this page comes from