STRUCT DRM_CLIENT_FUNCS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct drm_client_funcs(9) πŸ’…

okay so this is a page straight outta the Kernel API Manual and it's literally all about struct drm_client_funcs β€” the DRM client callbacks. yes bestie, callbacks. the little functions the kernel rings up when stuff happens. let's get into it 🫢


✨ NAME ✨

struct drm_client_funcs β€” DRM client callbacks πŸŽ€


🌸 SYNOPSIS 🌸

struct drm_client_funcs {
    struct module *owner;
    void (*free)(struct drm_client_dev *client);
    void (*unregister)(struct drm_client_dev *client);
    int (*restore)(struct drm_client_dev *client, bool force);
    int (*hotplug)(struct drm_client_dev *client);
    int (*suspend)(struct drm_client_dev *client);
    int (*resume)(struct drm_client_dev *client);
 };

like, that's the whole shape of it. seven members. every single one matters. no skipping πŸ’€


πŸ‘‘ Members πŸ‘‘

🌟 owner

The module owner. that's it, that's the vibe. it's giving "hi, I own this module" ✨

πŸ¦‹ free

Called when the client gets unregistered. if you're implementing it, you should release all client-specific data and free the memory. all of it, bestie. no leaks, we don't do that here πŸ’…

This callback is optional. (so if you don't need it, you can literally just not.)

🌈 unregister

Called when drm_device is unregistered. your client should respond by releasing its resources using drm_client_release. like a good little cleanup arc 🧚

This callback is optional.

πŸ’– restore

Called on drm_lastclose. here's the tea: the first client instance in the list that returns zero gets the privilege to restore, and no more clients are called after that. first one to say "I got this" wins. main character energy fr πŸ‘‘

also important: this callback is not called after unregister has been called. so don't expect it to show up late to the party πŸ™ˆ

⚠️ note that the core does not guarantee exclusion against concurrent drm_open. clients need to ensure this themselves, for example by using drm_master_internal_acquire and drm_master_internal_release. yes you have to do it yourself. no cap.

and if the caller passes force, the client should ignore any present DRM master and restore the display anyway. force means force, periodt πŸ”₯

This callback is optional.

⭐ hotplug

Called on drm_kms_helper_hotplug_event. also β€” this callback is not called after unregister has been called. same rule as before, iykyk πŸŽ€

This callback is optional.

πŸ’œ suspend

Called when suspending the device. sleepy time for the device 😴

This callback is optional.

πŸ“ resume

Called when resuming the device from suspend. welcome back, device 🫢

This callback is optional.


πŸ” SEE ALSO πŸ”

like, go read those too if you wanna be a real one πŸ“šβœ¨


and that's the whole page, bestie!! πŸ’– this one lives in ./include/drm, and it's dated October 2026, filed under struct drm_client_funcs(9). slay, go forth and write your callbacks πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from