drm_pagemap_get_from_cache(9)
β¨ 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_pagemapif it all worked out π - an error pointer if an error occurred π
- or
NULLif nodrm_pagemapwas found and the caller should insert a new one π
π SEE ALSO π
the whole squad, fr fr:
- Kernel file
./drivers/gpu/drm/drm_pagemap_util.c struct drm_pagemap_cache(9)struct drm_pagemap_shrinker(9)drm_pagemap_cache_create_devm(9)Cache lookup(9)drm_pagemap_cache_lock_lookup(9)drm_pagemap_cache_unlock_lookup(9)drm_pagemap_cache_set_pagemap(9)drm_pagemap_get_from_cache_if_active(9)drm_pagemap_shrinker_might_lock(9)drm_pagemap_shrinker_add(9)drm_pagemap_shrinker_create_devm(9)struct drm_pagemap_owner(9)drm_pagemap_release_owner(9)interconnect_fn(9)drm_pagemap_acquire_owner(9)
π 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
- 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