drm_privacy...n_lookup_add(9)
π drm_privacy_screen_lookup_add(9) β the Kernel API Manual, bestie edition
Okay so this one lives in the 9 section of the Kernel API Manual β it's a kernel function page, and honestly? It's a short one, but it's important so stay with me π«Ά
β¨ NAME β¨
drm_privacy_screen_lookup_add β adds one entry to the static privacy-screen lookup list. That's it, that's the whole job π
πΈ SYNOPSIS πΈ
void drm_privacy_screen_lookup_add (struct drm_privacy_screen_lookup *lookup );
It returns void, so likeβ¦ nothing comes back out. No return value to obsess over, no error code to check. It just does the thing π
π ARGUMENTS π
lookupβ the lookup list entry you wanna add. That's the whole argument list, one (1) singular struct pointer, we love a low-effort signature β¨
π¦ DESCRIPTION π¦
So the vibe here is: you call this, and it adds an entry to the static privacy-screen lookup list. Simple, right? But here's the part where you need to pay attention, bestie, because this is the main character caveat π
The struct list_head that lives inside your struct drm_privacy_screen_lookup? It gets added to a list that's owned by the privacy-screen core. Not by you. Not by your driver. By the core. So you are not the owner anymore, you're likeβ¦ the cool aunt who dropped the kid off at a sleepover π
Which means β and I need you to hear me on this β the struct drm_privacy_screen_lookup you passed in must not be free-ed until it gets removed from the lookup list. And the way you remove it is by calling drm_privacy_screen_lookup_remove. Periodt. π
Freeing that struct early is a one-way ticket to use-after-free town and the kernel will not be nice about it. Do the remove call first, then free. In that order. No cap π₯
π SEE ALSO π
Go binge the related lore, bestie, it's all connected π§
- Kernel file
./drivers/gpu/drm/drm_privacy_screen.coverview(9) drm_privacy_screen_lookup_remove(9)drm_privacy_screen_get(9)drm_privacy_screen_put(9)drm_privacy_screen_set_sw_state(9)drm_privacy_screen_get_state(9)drm_privacy_screen_register_notifier(9)drm_privacy_screen_unregister_notifier(9)drm_privacy_screen_register(9)drm_privacy_screen_unregister(9)drm_privacy_screen_call_notifier_chain(9)
π sign-off π
This little icon comes to you straight from ./drivers/gpu/drm, dated October 2026 β screenshot it, frame it, put it on your wall π
β¨ mwah, go add your lookups responsibly π
π¦ 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