drm_pagemap_get_from_cache(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ drm_pagemap_get_from_cache(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸ’… this one's a little gem from the DRM world and it's literally all about finding your pagemap in a cache. yes we're doing pointer lookups today, it's giving main character energy.


🌸 NAME 🌸

drm_pagemap_get_from_cache β€” the lookup of drm_pagemaps. that's it. that's the vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct drm_pagemap * drm_pagemap_get_from_cache (struct
       drm_pagemap_cache *cache );

πŸ’– ARGUMENTS πŸ’–

  • cache β€” the cache we're using for the lookup. that's the one you're digging through, bestie. πŸ”

✨ DESCRIPTION ✨

okay so here's the tea πŸ“ β€” if there's an active pagemap already sitting in the cache, it gets returned immediately. like, instant. no waiting, no nothing. slay.

but if what's in there is an inactive pagemap? then it gets removed from the shrinker list, and an attempt is made to make it active. fingers crossed 🀞

and if there's no pagemap present at all β€” or the attempt to make it active straight-up failed 😭 β€” then NULL is returned. and that's the signal to the caller that says "hey, go create a new drm_pagemap and insert it into the cache." you got this. 🫢


πŸ”₯ RETURN πŸ”₯

so what do you get back? it's one of three things, no cap:

  • a reference-counted pointer to a drm_pagemap if it all worked out πŸ‘‘
  • an error pointer if an error occurred πŸ’€
  • or NULL if no drm_pagemap was found and the caller should insert a new one πŸ™ˆ

🌈 SEE ALSO 🌈

the whole squad, fr fr:


πŸ’œ quick reminder bestie: NULL here is not a fail, it's literally an invitation β€” a "go make a new one and insert it" moment. don't panic.

and that's the page!! 🧚 sign-off time: this lil beauty lives over in ./drivers/gpu/drm, dated October 2026, and you read it in the Kernel API Manual. obsessed. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from