drm/xe/svm: Make to_xe_range a public function

The to_xe_range function will be used in other files. Therefore, make it
public and add kernel-doc documentation

Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Acked-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://lore.kernel.org/r/20250513040228.470682-5-himal.prasad.ghimiray@intel.com
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
This commit is contained in:
Himal Prasad Ghimiray
2025-05-13 09:32:17 +05:30
parent eb07c2fc10
commit 18211ff4d5
2 changed files with 20 additions and 5 deletions
-5
View File
@@ -103,11 +103,6 @@ static void xe_svm_range_free(struct drm_gpusvm_range *range)
kfree(range);
}
static struct xe_svm_range *to_xe_range(struct drm_gpusvm_range *r)
{
return container_of(r, struct xe_svm_range, base);
}
static void
xe_svm_garbage_collector_add_range(struct xe_vm *vm, struct xe_svm_range *range,
const struct mmu_notifier_range *mmu_range)
+20
View File
@@ -85,6 +85,20 @@ static inline bool xe_svm_range_has_dma_mapping(struct xe_svm_range *range)
return range->base.flags.has_dma_mapping;
}
/**
* to_xe_range - Convert a drm_gpusvm_range pointer to a xe_svm_range
* @r: Pointer to the drm_gpusvm_range structure
*
* This function takes a pointer to a drm_gpusvm_range structure and
* converts it to a pointer to the containing xe_svm_range structure.
*
* Return: Pointer to the xe_svm_range structure
*/
static inline struct xe_svm_range *to_xe_range(struct drm_gpusvm_range *r)
{
return container_of(r, struct xe_svm_range, base);
}
#define xe_svm_assert_in_notifier(vm__) \
lockdep_assert_held_write(&(vm__)->svm.gpusvm.notifier_lock)
@@ -101,6 +115,7 @@ void xe_svm_flush(struct xe_vm *vm);
struct drm_pagemap_device_addr;
struct drm_gpusvm_ctx;
struct drm_gpusvm_range;
struct xe_bo;
struct xe_gt;
struct xe_vm;
@@ -179,6 +194,11 @@ int xe_svm_alloc_vram(struct xe_vm *vm, struct xe_tile *tile,
return -EOPNOTSUPP;
}
static inline struct xe_svm_range *to_xe_range(struct drm_gpusvm_range *r)
{
return NULL;
}
#define xe_svm_assert_in_notifier(...) do {} while (0)
#define xe_svm_range_has_dma_mapping(...) false