xe_bo_validate(9)
π 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 lockeddma_resvobject with, orNULL. used together withallow_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β Thedrm_exectransaction 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 β
0on success π slay.- a negative error code on failure, so watch out for that.
- it may return
-EINTRor-ERESTARTSYSif 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:
xe_bo_has_single_placement(9)xe_bo_is_stolen_devmem(9)xe_bo_is_vm_bound(9)xe_bo_pin_account(9)xe_bo_unpin_account(9)xe_bo_is_visible_vram(9)xe_bo_move_notify(9)xe_bo_set_purgeable_shrinker(9)xe_bo_set_purgeable_state(9)xe_ttm_bo_purge(9)xe_bo_shrink(9)xe_bo_notifier_prepare_pinned(9)xe_bo_notifier_unprepare_pinned(9)xe_bo_evict_pinned(9)xe_bo_restore_pinned(9)xe_bo_read(9)xe_bo_alloc(9)xe_bo_free(9)xe_bo_init_locked(9)xe_bo_create_locked(9)xe_bo_create_user(9)xe_bo_create_pin_range_novm(9)xe_bo_create_pin_map_at_novm(9)xe_bo_create_pin_map(9)xe_bo_create_pin_map_novm(9)xe_managed_bo_reinit_in_vram(9)xe_bo_pin_external(9)xe_bo_pin(9)xe_bo_unpin_external(9)xe_bo_decompress(9)xe_bo_lock(9)xe_bo_unlock(9)xe_bo_can_migrate(9)xe_bo_migrate(9)xe_bo_evict(9)xe_bo_needs_ccs_pages(9)__xe_bo_release_dummy(9)xe_bo_put_commit(9)xe_bo_dev_init(9)xe_bo_dev_fini(9)xe_bo_dumb_create(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms