__i915_gem_object_migrate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ __i915_gem_object_migrate(9) β€” a Kernel API Manual moment ✨

okay bestie, welcome to the Kernel API Manual πŸ’… this is the page for __i915_gem_object_migrate, and honestly? it's giving "move my stuff to a better neighborhood" energy and i'm obsessed πŸ¦‹


🌸 NAME 🌸

__i915_gem_object_migrate β€” migrate an object to the desired region id, with control of the extra flags ✨


πŸŽ€ SYNOPSIS πŸŽ€

int __i915_gem_object_migrate (struct drm_i915_gem_object *obj , struct i915_gem_ww_ctx *ww , enum intel_region_id id , unsigned int flags );

πŸ’– ARGUMENTS πŸ’–

  • obj β€” the object you wanna migrate. that's the main character 🫢
  • ww β€” an optional struct i915_gem_ww_ctx. and lowkey important: if it's NULL, the backend may not be successful in evicting other objects to make room for this object 😭
  • id β€” the region id you're migrating to. the destination, the vibe, the new address 🏑
  • flags β€” the object flags. normally just obj->flags. simple like that πŸ’…

🌈 DESCRIPTION 🌈

so what we're doing here is attempting to migrate the object to the desired memory region ✨ but there are rules, bestie, and they are not negotiable:

  • the object backend must support migration
  • the object may not be pinned (that means no explicitly pinned pages and no pinned vmas)
  • the object must be locked πŸ”’

on successful completion, the object will have pages pointing to memory in the new region β€” but (and this is the part people miss, no cap) an async migration task may not have completed yet 😳 and to accomplish that, i915_gem_object_wait_migration must be called. don't skip that step fr fr 🧚


⭐ NOTE ⭐

the ww parameter is not used yet πŸ™ˆ but it's included to make sure callers put some effort into obtaining a valid ww ctx if one is available. it's giving "dress for the job you want" πŸ’€


πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸŽ‰
  • a negative error code on failure. in particular it may return:
    • -ENXIO β€” lack of region space 😬
    • -EDEADLK β€” for deadlock avoidance if ww is set πŸ’€
    • -EINTR or -ERESTARTSYS β€” if signal pending πŸ™ˆ
    • -EBUSY β€” if the object is pinned πŸ“Œ

πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./drivers/gpu/drm/i915/gem/i915_gem_object.c

__i915_gem_object_fini(9), i915_gem_object_set_cache_coherency(9), i915_gem_object_set_pat_index(9), __i915_gem_object_pages_fini(9), i915_gem_object_read_from_page(9), i915_gem_object_evictable(9), i915_gem_object_migratable(9), i915_gem_object_has_struct_page(9), i915_gem_object_has_iomem(9), i915_gem_object_can_migrate(9), i915_gem_object_migrate(9), i915_gem_object_placement_possible(9), i915_gem_object_needs_ccs_pages(9), i915_gem_object_get_moving_fence(9), i915_gem_object_wait_moving_fence(9)


okay that's the whole page, you ate that πŸ’… this lil gem came to you from ./drivers/gpu/drm/i915/gem and it's stamped October 2026 ⭐ periodt, go migrate something responsibly πŸ«ΆπŸ’–

πŸ“¦ where this page comes from