drm_kunit_h...c_drm_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

Okay bestie, this page is from the Kernel API Manual, and it's all about drm_kunit_helper_alloc_drm_device β€” it allocates a mock DRM device for KUnit tests πŸ’…. Yes, this is that drm_kunit_h...c_drm_device(9) cutie. She's giving test-helper main character energy πŸŽ€.

πŸ¦‹ SYNOPSIS πŸ¦‹

drm_kunit_helper_alloc_drm_device (_test , _dev , _type , _member ,
       _feat );

πŸŽ€ ARGUMENTS πŸŽ€

  • _test β€” The test context object, aka the vibe holder for this test 🫢.
  • _dev β€” The parent device object.
  • _type β€” the type of the struct which contains struct drm_device.
  • _member β€” the name of the drm_device within _type.
  • _feat β€” Mocked DRM device driver features ✨.

🌸 DESCRIPTION 🌸

So this function creates a struct drm_driver, and then it will create a struct drm_device from _dev and that driver. Lowkey iconic setup behavior.

_dev should be allocated using drm_kunit_helper_alloc_device. No cap, that's the required move β€” not a suggestion, bestie 😭.

The driver is tied to the _test context and will get cleaned at the end of the test. The drm_device is allocated through devm_drm_dev_alloc and will thus be freed through a device-managed resource. So yeah, cleanup is handled, and that's honestly slay 🧚.

⭐ RETURN ⭐

A pointer to the new drm_device, or an ERR_PTR otherwise. That's it β€” either the cute new device pointer, or the error-pointer plot twist πŸ’€.

πŸ‘‘ SEE ALSO πŸ‘‘


Okay that's the whole page, bestie πŸ’– β€” this one comes from ./include/drm, dated October 2026, and the page title is drm_kunit_h...c_drm_device(9). Go forth and test your DRM device allocation with main character confidence πŸŒˆπŸ‘‘.

πŸ“¦ where this page comes from