xe_force_wake_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ xe_force_wake_get(9) ✨

okay so this is a page from the Kernel API Manual bestie, and it's all about xe_force_wake_get β€” the little function that bumps your domain refcount πŸ’… buckle up, it's honestly not that deep but the vibes are immaculate.


🌸 NAME 🌸

xe_force_wake_get β€” increase the domain refcount πŸ”₯ like, that's literally it, that's the whole job.


πŸ¦‹ SYNOPSIS πŸ¦‹

unsigned int xe_force_wake_get (struct xe_force_wake *fw , enum
       xe_force_wake_domains domains );

copy it exactly, don't freestyle the signature, i'm begging πŸ™ˆ


πŸŽ€ ARGUMENTS πŸŽ€

  • fw β€” a struct xe_force_wake, the main character of this whole operation πŸ‘‘
  • domains β€” the forcewake domains you wanna get a refcount on, like picking which ones get the love 🫢

πŸ’– DESCRIPTION πŸ’–

so, what does it do? it wakes up the domains if they're asleep 😴➑️😳 and then takes references on them. that's the tea.

here's the part where you gotta pay attention though, no cap: if the requested domain is XE_FORCEWAKE_ALL, then only the applicable/initialized domains get considered for the refcount. and it is your responsibility as the caller to check the returned ref β€” specifically whether it includes any specific domain β€” by using xe_force_wake_ref_has_domain. like, the function isn't gonna hold your hand on that one πŸ’€

also, you must call xe_force_wake_put to decrease the refcounts you just incremented. don't leave them hanging, that's rude, fr fr.

and now the big sister advice section: when possible, use scope-based forcewake instead of calling this function directly. that means going through CLASS(xe_force_wake, ...) or xe_with_force_wake. it's giving responsible adult energy ✨

so when is direct usage of get/put actually okay? two situations, and only two:

  • the function has goto-based flows that can interfere with scope-based cleanup (yeah, the goto jumps really said "not today") 😭
  • the lifetime of the forcewake reference doesn't match a specific scope β€” e.g. forcewake obtained in one function and released in a different one. different function, different vibe, it happens 🧚

🌈 RETURN 🌈

an opaque reference to the woken domains πŸŽ‰ or zero if none of the requested domains were awake. zero means nobody showed up to the party, don't take it personally πŸ’€


⭐ SEE ALSO ⭐

  • the Kernel file ./drivers/gpu/drm/xe/xe_force_wake.c β€” literally the source, go read it, it's iconic
  • xe_force_wake_put(9) β€” the other half of the get/put duo, you can't have one without the other 🫢

okay that's the whole page bestie, you ate that πŸ’… and for the cute little sign-off: this legendary document comes from ./drivers/gpu/drm/xe, dated October 2026, and stars xe_force_wake_get(9) β€” go forth and refcount responsibly πŸŒΈπŸ’–βœ¨

πŸ“¦ where this page comes from