]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/pagemap, drm/xe: Add refcounting to struct drm_pagemap
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Fri, 19 Dec 2025 11:33:00 +0000 (12:33 +0100)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Tue, 23 Dec 2025 08:35:53 +0000 (09:35 +0100)
commita599b98607decdc899630fc99a3a2847f6b72965
treeb20ad6414638fe4388bfe56f6af878a13d3ee5d6
parent16b5ad31952476fb925c401897fc171cd37f536b
drm/pagemap, drm/xe: Add refcounting to struct drm_pagemap

With the end goal of being able to free unused pagemaps
and allocate them on demand, add a refcount to struct drm_pagemap,
remove the xe embedded drm_pagemap, allocating and freeing it
explicitly.

v2:
- Make the drm_pagemap pointer in drm_gpusvm_pages reference-counted.
v3:
- Call drm_pagemap_get() before drm_pagemap_put() in drm_gpusvm_pages
  (Himal Prasad Ghimiray)

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com> #v1
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> # For merging through drm-xe.
Link: https://patch.msgid.link/20251219113320.183860-5-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/drm_gpusvm.c
drivers/gpu/drm/drm_pagemap.c
drivers/gpu/drm/xe/xe_svm.c
drivers/gpu/drm/xe/xe_vram_types.h
include/drm/drm_pagemap.h