Skip to content

Commit 5951fed

Browse files
committed
drm/xe: Add Xe SVM devmem_release GPU SVM vfunc
Implement with a simple BO put which releases the device memory. v2: - Use new drm_gpusvm_devmem_ops v3: - Better commit message (Thomas) v4: - Use xe_bo_put_async (Thomas) Signed-off-by: Matthew Brost <[email protected]> Reviewed-by: Thomas Hellström <[email protected]> Reviewed-by: Himal Prasad Ghimiray <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ecacec0 commit 5951fed

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/gpu/drm/xe/xe_svm.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © 2024 Intel Corporation
44
*/
55

6+
#include "xe_bo.h"
67
#include "xe_gt_tlb_invalidation.h"
78
#include "xe_migrate.h"
89
#include "xe_pt.h"
@@ -467,6 +468,13 @@ static struct xe_bo *to_xe_bo(struct drm_gpusvm_devmem *devmem_allocation)
467468
return container_of(devmem_allocation, struct xe_bo, devmem_allocation);
468469
}
469470

471+
static void xe_svm_devmem_release(struct drm_gpusvm_devmem *devmem_allocation)
472+
{
473+
struct xe_bo *bo = to_xe_bo(devmem_allocation);
474+
475+
xe_bo_put_async(bo);
476+
}
477+
470478
static u64 block_offset_to_pfn(struct xe_vram_region *vr, u64 offset)
471479
{
472480
return PHYS_PFN(offset + vr->hpa_base);
@@ -502,6 +510,7 @@ static int xe_svm_populate_devmem_pfn(struct drm_gpusvm_devmem *devmem_allocatio
502510

503511
__maybe_unused
504512
static const struct drm_gpusvm_devmem_ops gpusvm_devmem_ops = {
513+
.devmem_release = xe_svm_devmem_release,
505514
.populate_devmem_pfn = xe_svm_populate_devmem_pfn,
506515
.copy_to_devmem = xe_svm_copy_to_devmem,
507516
.copy_to_ram = xe_svm_copy_to_ram,

0 commit comments

Comments
 (0)