xe_bo_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xe_bo_lock β€” like, the manual page, bestie ✨

okay so this is xe_bo_lock(9) from the Kernel API Manual, and no I will not be normal about it 🫢


✨ NAME ✨

xe_bo_lock β€” locks the buffer object's dma_resv object. that's it. that's the whole vibe. πŸ”’


🌸 SYNOPSIS 🌸

int xe_bo_lock (struct xe_bo *bo , bool intr );

πŸŽ€ ARGUMENTS πŸŽ€

  • bo β€” the struct xe_bo whose lock we're taking. this is the main character of the whole operation, lowkey πŸ‘‘
  • intr β€” whether to perform any wait interruptible. so like, do you want to be able to bail out mid-wait or not πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

so what it does: it locks the buffer object's dma_resv object. simple. iconic. no notes. ✨

and here's the little plot twist β€” if the buffer object is pointing to a shared dma_resv object, then that shared lock is what gets locked. iykyk 🧚 not me knowing exactly which lock was like, actually grabbed πŸ’…


🌈 RETURN 🌈

  • 0 β€” success, we ate, periodt πŸ’–
  • -EINTR β€” happens when intr is true and the wait for a contended lock was interrupted. rude but valid 😭
  • and if intr is set to false? the function always returns 0. no cap. fr fr.

⭐ SEE ALSO ⭐

kernel file ./drivers/gpu/drm/xe/xe_bo.c plus this absolute friend-group of siblings, obsessed with all of them honestly:

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_validate(9), xe_bo_decompress(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)

bestie disclaimer: none of these are invented, i literally copy-pasted them with love, go read them, they're all slaying in their own way πŸ”₯

and that's the page!! shoutout to ./drivers/gpu/drm/xe for being the source location, October 2026 for the date, and the Kernel API Manual for hosting us β€” mwah, bye, stay locked πŸ’‹πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from