Skip to content

Commit 9f36f9c

Browse files
committed
Merge tag 'drm-amdkfd-next-2018-03-27' of git://people.freedesktop.org/~gabbayo/linux into drm-next
- GPUVM support for dGPUs - KFD events support for dGPUs - Fix live-lock situation when restoring multiple evicted processes - Fix VM page table allocation on large-bar systems - Fix for build failure on frv architecture * tag 'drm-amdkfd-next-2018-03-27' of git://people.freedesktop.org/~gabbayo/linux: drm/amdkfd: Use ordered workqueue to restore processes drm/amdgpu: Fix acquiring VM on large-BAR systems drm/amdkfd: Add module option for testing large-BAR functionality drm/amdkfd: Kmap event page for dGPUs drm/amdkfd: Add ioctls for GPUVM memory management drm/amdkfd: Add TC flush on VMID deallocation for Hawaii drm/amdkfd: Allocate CWSR trap handler memory for dGPUs drm/amdkfd: Add per-process IDR for buffer handles drm/amdkfd: Aperture setup for dGPUs drm/amdkfd: Remove limit on number of GPUs drm/amdkfd: Populate DRM render device minor drm/amdkfd: Create KFD VMs on demand drm/amdgpu: Add kfd2kgd interface to acquire an existing VM drm/amdgpu: Add helper to turn an existing VM into a compute VM drm/amdgpu: Fix initial validation of PD BO for KFD VMs drm/amdgpu: Move KFD-specific fields into struct amdgpu_vm drm/amdkfd: fix uninitialized variable use drm/amdkfd: add missing include of mm.h
2 parents cb17aa5 + 1679ae8 commit 9f36f9c

19 files changed

+1398
-165
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#define AMDGPU_AMDKFD_H_INCLUDED
2727

2828
#include <linux/types.h>
29+
#include <linux/mm.h>
2930
#include <linux/mmu_context.h>
3031
#include <kgd_kfd_interface.h>
3132
#include <drm/ttm/ttm_execbuf_util.h>
@@ -92,27 +93,6 @@ struct amdkfd_process_info {
9293
struct amdgpu_amdkfd_fence *eviction_fence;
9394
};
9495

95-
/* struct amdkfd_vm -
96-
* For Memory Eviction KGD requires a mechanism to keep track of all KFD BOs
97-
* belonging to a KFD process. All the VMs belonging to the same process point
98-
* to the same amdkfd_process_info.
99-
*/
100-
struct amdkfd_vm {
101-
/* Keep base as the first parameter for pointer compatibility between
102-
* amdkfd_vm and amdgpu_vm.
103-
*/
104-
struct amdgpu_vm base;
105-
106-
/* List node in amdkfd_process_info.vm_list_head*/
107-
struct list_head vm_list_node;
108-
109-
struct amdgpu_device *adev;
110-
/* Points to the KFD process VM info*/
111-
struct amdkfd_process_info *process_info;
112-
113-
uint64_t pd_phys_addr;
114-
};
115-
11696
int amdgpu_amdkfd_init(void);
11797
void amdgpu_amdkfd_fini(void);
11898

@@ -165,6 +145,12 @@ uint64_t amdgpu_amdkfd_get_vram_usage(struct kgd_dev *kgd);
165145
int amdgpu_amdkfd_gpuvm_create_process_vm(struct kgd_dev *kgd, void **vm,
166146
void **process_info,
167147
struct dma_fence **ef);
148+
int amdgpu_amdkfd_gpuvm_acquire_process_vm(struct kgd_dev *kgd,
149+
struct file *filp,
150+
void **vm, void **process_info,
151+
struct dma_fence **ef);
152+
void amdgpu_amdkfd_gpuvm_destroy_cb(struct amdgpu_device *adev,
153+
struct amdgpu_vm *vm);
168154
void amdgpu_amdkfd_gpuvm_destroy_process_vm(struct kgd_dev *kgd, void *vm);
169155
uint32_t amdgpu_amdkfd_gpuvm_get_process_page_dir(void *vm);
170156
int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ static const struct kfd2kgd_calls kfd2kgd = {
205205
.get_cu_info = get_cu_info,
206206
.get_vram_usage = amdgpu_amdkfd_get_vram_usage,
207207
.create_process_vm = amdgpu_amdkfd_gpuvm_create_process_vm,
208+
.acquire_process_vm = amdgpu_amdkfd_gpuvm_acquire_process_vm,
208209
.destroy_process_vm = amdgpu_amdkfd_gpuvm_destroy_process_vm,
209210
.get_process_page_dir = amdgpu_amdkfd_gpuvm_get_process_page_dir,
210211
.set_vm_context_page_table_base = set_vm_context_page_table_base,

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ static const struct kfd2kgd_calls kfd2kgd = {
165165
.get_cu_info = get_cu_info,
166166
.get_vram_usage = amdgpu_amdkfd_get_vram_usage,
167167
.create_process_vm = amdgpu_amdkfd_gpuvm_create_process_vm,
168+
.acquire_process_vm = amdgpu_amdkfd_gpuvm_acquire_process_vm,
168169
.destroy_process_vm = amdgpu_amdkfd_gpuvm_destroy_process_vm,
169170
.get_process_page_dir = amdgpu_amdkfd_gpuvm_get_process_page_dir,
170171
.set_vm_context_page_table_base = set_vm_context_page_table_base,

0 commit comments

Comments
 (0)