STRUCT DRM_CLIENT_FUNCS(9)
π 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 concurrentdrm_open. clients need to ensure this themselves, for example by usingdrm_master_internal_acquireanddrm_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 π
- Kernel file
./include/drm/drm_client.h struct drm_client_dev(9)struct drm_client_buffer(9)drm_client_for_each_modeset(9)drm_client_for_each_connector_iter(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms