xe_drm_pagemap_from_fd(9)
π xe_drm_pagemap_from_fd(9) β like, the whole kernel API manual, bestie β¨
okay so real talk, this page lives in the Kernel API Manual and it's about one very specific little function. no cap, it's a short one, so let's get into it π«Ά
πΈ NAME πΈ
xe_drm_pagemap_from_fd β hands you back a drm_pagemap pointer when you give it a (file_descriptor, region_instance) pair. that's the whole vibe π«
β¨ SYNOPSIS β¨
struct drm_pagemap * xe_drm_pagemap_from_fd (int fd , u32 region_instance );
like, you call it with two things and it gives you a struct drm_pagemap * back. iconic signature honestly π
π ARGUMENTS π
fdβ an fd opened against an xe device. yes bestie, an actual file descriptor, opened on an xe device. that's the requirement, don't come at it with anything else πregion_instanceβ the region instance, and it's au32. it's the one representing the device memory on the opened xe device. so like, which memory region on that device. iykyk π
π¦ DESCRIPTION π¦
this is where it does the thing: it opens a struct drm_pagemap pointer on the indicated device and region_instance. that's it, that's the function. lowkey elegant, highkey underrated. periodt π
π RETURN π
- on success π β you get a reference-counted
struct drm_pagemappointer. note the reference-counted part, it's giving "you own a reference now, act like it" energy. - on failure π β you get a negative error pointer. classic kernel move, so check that thing with your error-checking macros, okay? don't be out here dereferencing it fr fr π
β SEE ALSO β
the whole friend group, no one left out π«Ά:
- Kernel file
./drivers/gpu/drm/xe/xe_svm.c drm_pagemap reference-counting in xe:(9)xe_svm_init(9)xe_svm_close(9)xe_svm_fini(9)xe_svm_range_validate(9)xe_svm_find_vma_start(9)xe_svm_range_needs_migrate_to_vram(9)xe_svm_handle_pagefault(9)xe_svm_has_mapping(9)xe_svm_unmap_address_range(9)xe_svm_bo_evict(9)xe_svm_range_find_or_insert(9)xe_svm_range_get_pages(9)xe_svm_ranges_zap_ptes_in_range(9)xe_vma_resolve_pagemap(9)xe_svm_alloc_vram(9)xe_pagemap_create(9)xe_pagemap_find_or_create(9)xe_pagemap_shrinker_create(9)xe_pagemap_cache_create(9)xe_svm_flush(9)
go read them, bestie, they're all literally right there in the same directory π§ββοΈ
and that's the tea β this one's brought to you by source ./drivers/gpu/drm/xe, dated October 2026 β mwah, xoxo, go get that pagemap ππ
π¦ 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