xe_kunit_he...oc_xe_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xe_kunit_he...oc_xe_device(9) β€” Kernel API Manual πŸŽ€

okay so bestie, welcome to the Kernel API Manual entry for xe_kunit_he...oc_xe_device(9) β€” yes the title got truncated by the terminal, no that's not a you problem, it's an everyone problem ✨. Anyway. Sit down, grab a strawberry πŸ“, and let me tell you about the little function that spins up a whole &xe_device just for your KUnit test. it's giving "test fixture but make it graphics driver" and honestly? obsessed.


✨ NAME ✨

xe_kunit_helper_alloc_xe_device β€” it allocates a &xe_device for a KUnit test. that's it. that's the whole job. main character energy, minimal responsibilities 🫢


🌸 SYNOPSIS 🌸

struct xe_device * xe_kunit_helper_alloc_xe_device (struct kunit *test ,
       struct device *dev );

look at her. two args, returns a pointer. clean. iconic. no notes πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • test β€” the kunit where this xe_device will be used. like, this is the test that's gonna own it and be responsible for it, so pls treat it right πŸ₯Ί
  • dev β€” The parent device object. the literal parent. the mother device. the one who birthed this whole situation πŸ’–

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea, bestie: this function allocates xe_device using drm_kunit_helper_alloc_device. that's the helper doing the helper things πŸ”₯

the xe_device allocation is managed by the test. lowkey the most important sentence here β€” the test is the one holding the leash, so nobody's leaking anything on your watch, periodt.

also, dev should be allocated using drm_kunit_helper_alloc_device. not optional. not "eh whatever". do it properly or don't do it at all, iykyk πŸ™ˆ

and!! this function uses KUNIT_ASSERT to detect any allocation failures. so if the allocation flops, it does not quietly return NULL and let you figure it out six stack frames later like some kind of coward. it asserts. loudly. in front of everyone. πŸ’€

ngl if you're not ready for a hard assert the moment something fails to allocate, you're not ready for this function, bestie. but you are. i believe in you 🌈

⭐ RETURN ⭐

a pointer to the new xe_device. brand new. fresh out the box. a whole little device for your test to play with πŸŽ€


🧚 SEE ALSO 🧚


and that's the page!! fr fr you now know everything this manpage knows, no cap, nothing skipped 🫢

shoutout to ./drivers/gpu/drm/xe/tests for housing all this β€” she's been holding it down since October 2026 and she ate πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from