Commit 57731a07 authored by Philip Yang's avatar Philip Yang Committed by Alex Deucher

drm/amdgpu: use HMM callback to replace mmu notifier

Replace our MMU notifier with hmm_mirror_ops.sync_cpu_device_pagetables
callback. Enable CONFIG_HMM and CONFIG_HMM_MIRROR as a dependency in
DRM_AMDGPU_USERPTR Kconfig.

It supports both KFD userptr and gfx userptr paths.
Signed-off-by: default avatarPhilip Yang <Philip.Yang@amd.com>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f8b18cf4
...@@ -26,10 +26,10 @@ config DRM_AMDGPU_CIK ...@@ -26,10 +26,10 @@ config DRM_AMDGPU_CIK
config DRM_AMDGPU_USERPTR config DRM_AMDGPU_USERPTR
bool "Always enable userptr write support" bool "Always enable userptr write support"
depends on DRM_AMDGPU depends on DRM_AMDGPU
select MMU_NOTIFIER select HMM_MIRROR
help help
This option selects CONFIG_MMU_NOTIFIER if it isn't already This option selects CONFIG_HMM and CONFIG_HMM_MIRROR if it
selected to enabled full userptr support. isn't already selected to enabled full userptr support.
config DRM_AMDGPU_GART_DEBUGFS config DRM_AMDGPU_GART_DEBUGFS
bool "Allow GART access through debugfs" bool "Allow GART access through debugfs"
......
...@@ -172,7 +172,7 @@ endif ...@@ -172,7 +172,7 @@ endif
amdgpu-$(CONFIG_COMPAT) += amdgpu_ioc32.o amdgpu-$(CONFIG_COMPAT) += amdgpu_ioc32.o
amdgpu-$(CONFIG_VGA_SWITCHEROO) += amdgpu_atpx_handler.o amdgpu-$(CONFIG_VGA_SWITCHEROO) += amdgpu_atpx_handler.o
amdgpu-$(CONFIG_ACPI) += amdgpu_acpi.o amdgpu-$(CONFIG_ACPI) += amdgpu_acpi.o
amdgpu-$(CONFIG_MMU_NOTIFIER) += amdgpu_mn.o amdgpu-$(CONFIG_HMM_MIRROR) += amdgpu_mn.o
include $(FULL_AMD_PATH)/powerplay/Makefile include $(FULL_AMD_PATH)/powerplay/Makefile
......
This diff is collapsed.
...@@ -34,7 +34,7 @@ enum amdgpu_mn_type { ...@@ -34,7 +34,7 @@ enum amdgpu_mn_type {
AMDGPU_MN_TYPE_HSA, AMDGPU_MN_TYPE_HSA,
}; };
#if defined(CONFIG_MMU_NOTIFIER) #if defined(CONFIG_HMM_MIRROR)
void amdgpu_mn_lock(struct amdgpu_mn *mn); void amdgpu_mn_lock(struct amdgpu_mn *mn);
void amdgpu_mn_unlock(struct amdgpu_mn *mn); void amdgpu_mn_unlock(struct amdgpu_mn *mn);
struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev, struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment