diff options
author | Amber Lin <Amber.Lin@amd.com> | 2018-12-14 09:35:17 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-01-14 15:04:29 -0500 |
commit | 308176d6f625bc782a34ec316beaefcfa7ad75f3 (patch) | |
tree | c2138c46bbec856efa3c3a3f5f3c49ed59a7b556 | |
parent | 8e07e2676a42e7d3e5fe8eebac6262ec975664a1 (diff) |
drm/amdgpu: Remove kgd2kfd function pointers
kgd2kfd function pointers and global kgd2kfd pointer are no longer in use.
Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_module.c | 29 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 50 |
4 files changed, 4 insertions, 85 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index fc926e2f857a..612887cd40cd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | |||
@@ -28,8 +28,6 @@ | |||
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/dma-buf.h> | 29 | #include <linux/dma-buf.h> |
30 | 30 | ||
31 | const struct kgd2kfd_calls *kgd2kfd; | ||
32 | |||
33 | static const unsigned int compute_vmid_bitmap = 0xFF00; | 31 | static const unsigned int compute_vmid_bitmap = 0xFF00; |
34 | 32 | ||
35 | /* Total memory size in system memory and all GPU VRAM. Used to | 33 | /* Total memory size in system memory and all GPU VRAM. Used to |
@@ -47,12 +45,9 @@ int amdgpu_amdkfd_init(void) | |||
47 | amdgpu_amdkfd_total_mem_size *= si.mem_unit; | 45 | amdgpu_amdkfd_total_mem_size *= si.mem_unit; |
48 | 46 | ||
49 | #ifdef CONFIG_HSA_AMD | 47 | #ifdef CONFIG_HSA_AMD |
50 | ret = kgd2kfd_init(KFD_INTERFACE_VERSION, &kgd2kfd); | 48 | ret = kgd2kfd_init(); |
51 | if (ret) | ||
52 | kgd2kfd = NULL; | ||
53 | amdgpu_amdkfd_gpuvm_init_mem_limits(); | 49 | amdgpu_amdkfd_gpuvm_init_mem_limits(); |
54 | #else | 50 | #else |
55 | kgd2kfd = NULL; | ||
56 | ret = -ENOENT; | 51 | ret = -ENOENT; |
57 | #endif | 52 | #endif |
58 | 53 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h index 3214d319071b..0b31a1859023 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | |||
@@ -214,8 +214,7 @@ void amdgpu_amdkfd_gpuvm_init_mem_limits(void); | |||
214 | void amdgpu_amdkfd_unreserve_memory_limit(struct amdgpu_bo *bo); | 214 | void amdgpu_amdkfd_unreserve_memory_limit(struct amdgpu_bo *bo); |
215 | 215 | ||
216 | /* KGD2KFD callbacks */ | 216 | /* KGD2KFD callbacks */ |
217 | int kgd2kfd_init(unsigned interface_version, | 217 | int kgd2kfd_init(void); |
218 | const struct kgd2kfd_calls **g2f); | ||
219 | void kgd2kfd_exit(void); | 218 | void kgd2kfd_exit(void); |
220 | struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd, struct pci_dev *pdev, | 219 | struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd, struct pci_dev *pdev, |
221 | const struct kfd2kgd_calls *f2g); | 220 | const struct kfd2kgd_calls *f2g); |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_module.c b/drivers/gpu/drm/amd/amdkfd/kfd_module.c index 030b39d62973..932007eb9168 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_module.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_module.c | |||
@@ -25,22 +25,6 @@ | |||
25 | #include "kfd_priv.h" | 25 | #include "kfd_priv.h" |
26 | #include "amdgpu_amdkfd.h" | 26 | #include "amdgpu_amdkfd.h" |
27 | 27 | ||
28 | static const struct kgd2kfd_calls kgd2kfd = { | ||
29 | .exit = kgd2kfd_exit, | ||
30 | .probe = kgd2kfd_probe, | ||
31 | .device_init = kgd2kfd_device_init, | ||
32 | .device_exit = kgd2kfd_device_exit, | ||
33 | .interrupt = kgd2kfd_interrupt, | ||
34 | .suspend = kgd2kfd_suspend, | ||
35 | .resume = kgd2kfd_resume, | ||
36 | .quiesce_mm = kgd2kfd_quiesce_mm, | ||
37 | .resume_mm = kgd2kfd_resume_mm, | ||
38 | .schedule_evict_and_restore_process = | ||
39 | kgd2kfd_schedule_evict_and_restore_process, | ||
40 | .pre_reset = kgd2kfd_pre_reset, | ||
41 | .post_reset = kgd2kfd_post_reset, | ||
42 | }; | ||
43 | |||
44 | static int kfd_init(void) | 28 | static int kfd_init(void) |
45 | { | 29 | { |
46 | int err; | 30 | int err; |
@@ -92,18 +76,9 @@ static void kfd_exit(void) | |||
92 | kfd_chardev_exit(); | 76 | kfd_chardev_exit(); |
93 | } | 77 | } |
94 | 78 | ||
95 | int kgd2kfd_init(unsigned int interface_version, | 79 | int kgd2kfd_init() |
96 | const struct kgd2kfd_calls **g2f) | ||
97 | { | 80 | { |
98 | int err; | 81 | return kfd_init(); |
99 | |||
100 | err = kfd_init(); | ||
101 | if (err) | ||
102 | return err; | ||
103 | |||
104 | *g2f = &kgd2kfd; | ||
105 | |||
106 | return 0; | ||
107 | } | 82 | } |
108 | 83 | ||
109 | void kgd2kfd_exit(void) | 84 | void kgd2kfd_exit(void) |
diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h index 3d5c3b00d917..83d960110d23 100644 --- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h +++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h | |||
@@ -34,7 +34,6 @@ | |||
34 | 34 | ||
35 | struct pci_dev; | 35 | struct pci_dev; |
36 | 36 | ||
37 | #define KFD_INTERFACE_VERSION 2 | ||
38 | #define KGD_MAX_QUEUES 128 | 37 | #define KGD_MAX_QUEUES 128 |
39 | 38 | ||
40 | struct kfd_dev; | 39 | struct kfd_dev; |
@@ -330,53 +329,4 @@ struct kfd2kgd_calls { | |||
330 | 329 | ||
331 | }; | 330 | }; |
332 | 331 | ||
333 | /** | ||
334 | * struct kgd2kfd_calls | ||
335 | * | ||
336 | * @exit: Notifies amdkfd that kgd module is unloaded | ||
337 | * | ||
338 | * @probe: Notifies amdkfd about a probe done on a device in the kgd driver. | ||
339 | * | ||
340 | * @device_init: Initialize the newly probed device (if it is a device that | ||
341 | * amdkfd supports) | ||
342 | * | ||
343 | * @device_exit: Notifies amdkfd about a removal of a kgd device | ||
344 | * | ||
345 | * @suspend: Notifies amdkfd about a suspend action done to a kgd device | ||
346 | * | ||
347 | * @resume: Notifies amdkfd about a resume action done to a kgd device | ||
348 | * | ||
349 | * @quiesce_mm: Quiesce all user queue access to specified MM address space | ||
350 | * | ||
351 | * @resume_mm: Resume user queue access to specified MM address space | ||
352 | * | ||
353 | * @schedule_evict_and_restore_process: Schedules work queue that will prepare | ||
354 | * for safe eviction of KFD BOs that belong to the specified process. | ||
355 | * | ||
356 | * @pre_reset: Notifies amdkfd that amdgpu about to reset the gpu | ||
357 | * | ||
358 | * @post_reset: Notify amdkfd that amgpu successfully reseted the gpu | ||
359 | * | ||
360 | * This structure contains function callback pointers so the kgd driver | ||
361 | * will notify to the amdkfd about certain status changes. | ||
362 | * | ||
363 | */ | ||
364 | struct kgd2kfd_calls { | ||
365 | void (*exit)(void); | ||
366 | struct kfd_dev* (*probe)(struct kgd_dev *kgd, struct pci_dev *pdev, | ||
367 | const struct kfd2kgd_calls *f2g); | ||
368 | bool (*device_init)(struct kfd_dev *kfd, | ||
369 | const struct kgd2kfd_shared_resources *gpu_resources); | ||
370 | void (*device_exit)(struct kfd_dev *kfd); | ||
371 | void (*interrupt)(struct kfd_dev *kfd, const void *ih_ring_entry); | ||
372 | void (*suspend)(struct kfd_dev *kfd); | ||
373 | int (*resume)(struct kfd_dev *kfd); | ||
374 | int (*quiesce_mm)(struct mm_struct *mm); | ||
375 | int (*resume_mm)(struct mm_struct *mm); | ||
376 | int (*schedule_evict_and_restore_process)(struct mm_struct *mm, | ||
377 | struct dma_fence *fence); | ||
378 | int (*pre_reset)(struct kfd_dev *kfd); | ||
379 | int (*post_reset)(struct kfd_dev *kfd); | ||
380 | }; | ||
381 | |||
382 | #endif /* KGD_KFD_INTERFACE_H_INCLUDED */ | 332 | #endif /* KGD_KFD_INTERFACE_H_INCLUDED */ |