xe_pagemap_find_or_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xe_pagemap_find_or_create(9)

okay bestie, so this is a page straight out of the Kernel API Manual β€” yep, the Kernel API Manual, we're fancy now β€” and it's all about xe_pagemap_find_or_create: the little function that goes "hmm, do I already have a struct xe_pagemap for this tile, or do I need to make one?" πŸŽ€ She's a finder and a maker. Multitasking icon. ✨


🌸 NAME 🌸

xe_pagemap_find_or_create β€” find or create a struct xe_pagemap. that's it, that's the whole job, and she does it flawlessly πŸ’…


✨ SYNOPSIS ✨

struct xe_pagemap * xe_pagemap_find_or_create (struct xe_device *xe ,
       struct drm_pagemap_cache *cache , struct xe_vram_region *vr );

like, look at her signature. three arguments, one pointer back. no cap, it's giving main character energy 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • xe β€” the xe device. the whole vibe, the big picture πŸ’–
  • cache β€” the struct xe_pagemap_cache. this is the lil stash where pagemaps hang out when they're not being used.
  • vr β€” the VRAM region. where the memory actually lives, bestie.

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the whole flow, and honestly it's so clean:

  1. check if there's already a used xe_pagemap for this tile β€” and if there is, just return it. done. no drama, no extra work. slay πŸ’…
  2. if not, check if there's a cached xe_pagemap for this tile. if there is, we cancel its destruction, re-initialize it, and return it. literally resurrecting her. iconic behavior 🧚✨
  3. finally, if there's no cached and no already-used pagemap? we create one and register it in the tile's pagemap cache. brand new baby pagemap, welcome to the world πŸŽ€
also a lil heads up: this function is typically called from within an IOCTL, and waits are therefore carried out interruptible if possible. so like, keep that in mind, she's polite about waiting πŸ™ˆ

🌈 RETURN 🌈

a pointer to a struct xe_pagemap if it all works out πŸ’– β€” or an error pointer on failure 😭. that's the whole deal.


⭐ SEE ALSO ⭐

the whole friend group, fr fr:


and that's the page!! πŸ’œ this one lives over in ./drivers/gpu/drm/xe and it's dated October 2026 β€” so yeah, she's from the future, we don't ask questions πŸ¦‹πŸ‘‘ mwah, go read the other nine-ers, ily, bye!! 🌸

πŸ“¦ where this page comes from