drm_pagemap_init(9)
π drm_pagemap_init (9) β Kernel API Manual, but make it make sense π
okay so bestie, we're in the drm_pagemap_init(9) manual page and honestly? it's giving "small function, big responsibilities" β¨ this one is from the Kernel API Manual and it's so much simpler than it looks, i promise π«Ά
πΈ NAME πΈ
drm_pagemap_init β initialize a pre-allocated drm_pagemap π
like, the drm_pagemap already exists, you're not making a new one, you're just... waking it up. glow-up time π¦
β¨ SYNOPSIS β¨
int drm_pagemap_init (struct drm_pagemap *dpagemap , struct dev_pagemap
*pagemap , struct drm_device *drm , const struct drm_pagemap_ops *ops );
four arguments, one int coming back at you. no cap π
π ARGUMENTS π
dpagemapβ thedrm_pagemapyou're initializing. this is the main character right here πpagemapβ the associateddev_pagemapthat's providing the device private pages. it's the plug, fr fr πdrmβ the drm device. and okay, important detail coming in hot: thedrm_pagemapholds a reference on thedrm_deviceand on the module owning thedrm_deviceuntildrm_pagemap_release. that's literally what makesdrm_pagemapexporting work. so like, don't sleep on this one πopsβ thedrm_pagemapops. the vibes, the behaviour, the whole personality π
π DESCRIPTION π
so what this does is initialize a drm_pagemap and take an initial reference on it. two-for-one, we love a multitasking icon β¨
and then β key part, bestie β after a successful return, you use drm_pagemap_put to destroy it. that's the cleanup, that's the goodbye, that's the "okay love you, bye" π
β οΈ like, actually do the drm_pagemap_put though. holding references forever is not the serve you think it is π
π RETURN π
0on success β slay π- negative error code on error β not slay, handle it π
π¦ SEE ALSO π¦
okay this list is LONG and it ate, so buckle up bestie, we're going through the whole friend group π
- Kernel file
./drivers/gpu/drm/drm_pagemap.cOverview(9) - Migration(9)
struct drm_pagemap_zdd(9)drm_pagemap_zdd_alloc(9)drm_pagemap_zdd_get(9)drm_pagemap_zdd_destroy(9)drm_pagemap_zdd_put(9)drm_pagemap_migration_unlock_put_folio(9)drm_pagemap_migration_unlock_put_pages(9)drm_pagemap_get_devmem_page(9)drm_pagemap_migrate_map_device_private_pages(9)struct drm_pagemap_iova_state(9)drm_pagemap_migrate_map_system_pages(9)drm_pagemap_migrate_populate_src_pages(9)drm_pagemap_migrate_unmap_pages(9)struct migrate_range_loc(9)drm_pagemap_cpages(9)drm_pagemap_migrate_to_devmem(9)drm_pagemap_migrate_populate_ram_pfn(9)struct drm_pagemap_dev_hold(9)drm_pagemap_reinit(9)drm_pagemap_put(9)drm_pagemap_page_get_flags(9)drm_pagemap_page_set_flags(9)drm_pagemap_retire_migrated_pages(9)drm_pagemap_skip_retired_pages(9)drm_pagemap_evict_to_ram(9)__drm_pagemap_migrate_to_ram(9)drm_pagemap_folio_free(9)drm_pagemap_migrate_to_ram(9)drm_pagemap_pagemap_ops_get(9)drm_pagemap_devmem_init(9)drm_pagemap_page_to_dpagemap(9)drm_pagemap_populate_mm(9)
like, that's the whole group chat π every single one of them, tagged, in order, no one left behind π«Ά
and that's the page!! π this one lives at ./drivers/gpu/drm, dated October 2026, and it's drm_pagemap_init(9) β mwah, iconic, 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