drm_pagemap_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” the drm_pagemap you're initializing. this is the main character right here πŸ‘‘
  • pagemap β€” the associated dev_pagemap that's providing the device private pages. it's the plug, fr fr πŸ”Œ
  • drm β€” the drm device. and okay, important detail coming in hot: the drm_pagemap holds a reference on the drm_device and on the module owning the drm_device until drm_pagemap_release. that's literally what makes drm_pagemap exporting work. so like, don't sleep on this one 😭
  • ops β€” the drm_pagemap ops. 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 🌟

  • 0 on 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.c Overview(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