aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/2707-drm-amdgpu-Remove-unused-function-pointers.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/2707-drm-amdgpu-Remove-unused-function-pointers.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/2707-drm-amdgpu-Remove-unused-function-pointers.patch324
1 files changed, 324 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/2707-drm-amdgpu-Remove-unused-function-pointers.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/2707-drm-amdgpu-Remove-unused-function-pointers.patch
new file mode 100644
index 00000000..caab89ae
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/2707-drm-amdgpu-Remove-unused-function-pointers.patch
@@ -0,0 +1,324 @@
+From deb99d4fb61bbafa15cbcbd2b6644ac0aea6ee89 Mon Sep 17 00:00:00 2001
+From: Amber Lin <Amber.Lin@amd.com>
+Date: Thu, 18 Oct 2018 12:51:02 -0400
+Subject: [PATCH 2707/2940] drm/amdgpu: Remove unused function pointers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Remove unused function pointers in kfd2kgd structure.
+
+Signed-off-by: Amber Lin <Amber.Lin@amd.com>
+Acked-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 25 ----
+ .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c | 25 ----
+ .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 24 ----
+ .../gpu/drm/amd/include/kgd_kfd_interface.h | 111 ------------------
+ 4 files changed, 185 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
+index 3621d7a1b543..ff7fac7df34b 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
+@@ -174,13 +174,6 @@ static int get_tile_config(struct kgd_dev *kgd,
+ }
+
+ static const struct kfd2kgd_calls kfd2kgd = {
+- .init_gtt_mem_allocation = alloc_gtt_mem,
+- .free_gtt_mem = free_gtt_mem,
+- .get_local_mem_info = get_local_mem_info,
+- .get_gpu_clock_counter = get_gpu_clock_counter,
+- .get_max_engine_clock_in_mhz = get_max_engine_clock_in_mhz,
+- .alloc_pasid = amdgpu_pasid_alloc,
+- .free_pasid = amdgpu_pasid_free,
+ .program_sh_mem_settings = kgd_program_sh_mem_settings,
+ .set_pasid_vmid_mapping = kgd_set_pasid_vmid_mapping,
+ .init_interrupts = kgd_init_interrupts,
+@@ -201,28 +194,10 @@ static const struct kfd2kgd_calls kfd2kgd = {
+ .get_fw_version = get_fw_version,
+ .set_scratch_backing_va = set_scratch_backing_va,
+ .get_tile_config = get_tile_config,
+- .get_cu_info = get_cu_info,
+- .get_vram_usage = amdgpu_amdkfd_get_vram_usage,
+- .create_process_vm = amdgpu_amdkfd_gpuvm_create_process_vm,
+- .acquire_process_vm = amdgpu_amdkfd_gpuvm_acquire_process_vm,
+- .destroy_process_vm = amdgpu_amdkfd_gpuvm_destroy_process_vm,
+- .release_process_vm = amdgpu_amdkfd_gpuvm_release_process_vm,
+- .get_process_page_dir = amdgpu_amdkfd_gpuvm_get_process_page_dir,
+ .set_vm_context_page_table_base = set_vm_context_page_table_base,
+- .alloc_memory_of_gpu = amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu,
+- .free_memory_of_gpu = amdgpu_amdkfd_gpuvm_free_memory_of_gpu,
+- .map_memory_to_gpu = amdgpu_amdkfd_gpuvm_map_memory_to_gpu,
+- .unmap_memory_to_gpu = amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu,
+- .sync_memory = amdgpu_amdkfd_gpuvm_sync_memory,
+- .map_gtt_bo_to_kernel = amdgpu_amdkfd_gpuvm_map_gtt_bo_to_kernel,
+- .restore_process_bos = amdgpu_amdkfd_gpuvm_restore_process_bos,
+ .invalidate_tlbs = invalidate_tlbs,
+ .invalidate_tlbs_vmid = invalidate_tlbs_vmid,
+- .submit_ib = amdgpu_amdkfd_submit_ib,
+- .get_vm_fault_info = amdgpu_amdkfd_gpuvm_get_vm_fault_info,
+ .read_vmid_from_vmfault_reg = read_vmid_from_vmfault_reg,
+- .gpu_recover = amdgpu_amdkfd_gpu_reset,
+- .set_compute_idle = amdgpu_amdkfd_set_compute_idle
+ };
+
+ struct kfd2kgd_calls *amdgpu_amdkfd_gfx_7_get_functions(void)
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c
+index d2f854357c7b..56ea929f524b 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c
+@@ -129,13 +129,6 @@ static int get_tile_config(struct kgd_dev *kgd,
+ }
+
+ static const struct kfd2kgd_calls kfd2kgd = {
+- .init_gtt_mem_allocation = alloc_gtt_mem,
+- .free_gtt_mem = free_gtt_mem,
+- .get_local_mem_info = get_local_mem_info,
+- .get_gpu_clock_counter = get_gpu_clock_counter,
+- .get_max_engine_clock_in_mhz = get_max_engine_clock_in_mhz,
+- .alloc_pasid = amdgpu_pasid_alloc,
+- .free_pasid = amdgpu_pasid_free,
+ .program_sh_mem_settings = kgd_program_sh_mem_settings,
+ .set_pasid_vmid_mapping = kgd_set_pasid_vmid_mapping,
+ .init_interrupts = kgd_init_interrupts,
+@@ -158,27 +151,9 @@ static const struct kfd2kgd_calls kfd2kgd = {
+ .get_fw_version = get_fw_version,
+ .set_scratch_backing_va = set_scratch_backing_va,
+ .get_tile_config = get_tile_config,
+- .get_cu_info = get_cu_info,
+- .get_vram_usage = amdgpu_amdkfd_get_vram_usage,
+- .create_process_vm = amdgpu_amdkfd_gpuvm_create_process_vm,
+- .acquire_process_vm = amdgpu_amdkfd_gpuvm_acquire_process_vm,
+- .destroy_process_vm = amdgpu_amdkfd_gpuvm_destroy_process_vm,
+- .release_process_vm = amdgpu_amdkfd_gpuvm_release_process_vm,
+- .get_process_page_dir = amdgpu_amdkfd_gpuvm_get_process_page_dir,
+ .set_vm_context_page_table_base = set_vm_context_page_table_base,
+- .alloc_memory_of_gpu = amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu,
+- .free_memory_of_gpu = amdgpu_amdkfd_gpuvm_free_memory_of_gpu,
+- .map_memory_to_gpu = amdgpu_amdkfd_gpuvm_map_memory_to_gpu,
+- .unmap_memory_to_gpu = amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu,
+- .sync_memory = amdgpu_amdkfd_gpuvm_sync_memory,
+- .map_gtt_bo_to_kernel = amdgpu_amdkfd_gpuvm_map_gtt_bo_to_kernel,
+- .restore_process_bos = amdgpu_amdkfd_gpuvm_restore_process_bos,
+ .invalidate_tlbs = invalidate_tlbs,
+ .invalidate_tlbs_vmid = invalidate_tlbs_vmid,
+- .submit_ib = amdgpu_amdkfd_submit_ib,
+- .get_vm_fault_info = amdgpu_amdkfd_gpuvm_get_vm_fault_info,
+- .gpu_recover = amdgpu_amdkfd_gpu_reset,
+- .set_compute_idle = amdgpu_amdkfd_set_compute_idle
+ };
+
+ struct kfd2kgd_calls *amdgpu_amdkfd_gfx_8_0_get_functions(void)
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c
+index 7c6cc5ac70ac..381cd2586fb8 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c
+@@ -154,13 +154,6 @@ static int amdgpu_amdkfd_get_tile_config(struct kgd_dev *kgd,
+ }
+
+ static const struct kfd2kgd_calls kfd2kgd = {
+- .init_gtt_mem_allocation = alloc_gtt_mem,
+- .free_gtt_mem = free_gtt_mem,
+- .get_local_mem_info = get_local_mem_info,
+- .get_gpu_clock_counter = get_gpu_clock_counter,
+- .get_max_engine_clock_in_mhz = get_max_engine_clock_in_mhz,
+- .alloc_pasid = amdgpu_pasid_alloc,
+- .free_pasid = amdgpu_pasid_free,
+ .program_sh_mem_settings = kgd_program_sh_mem_settings,
+ .set_pasid_vmid_mapping = kgd_set_pasid_vmid_mapping,
+ .init_interrupts = kgd_init_interrupts,
+@@ -183,26 +176,9 @@ static const struct kfd2kgd_calls kfd2kgd = {
+ .get_fw_version = get_fw_version,
+ .set_scratch_backing_va = set_scratch_backing_va,
+ .get_tile_config = amdgpu_amdkfd_get_tile_config,
+- .get_cu_info = get_cu_info,
+- .get_vram_usage = amdgpu_amdkfd_get_vram_usage,
+- .create_process_vm = amdgpu_amdkfd_gpuvm_create_process_vm,
+- .acquire_process_vm = amdgpu_amdkfd_gpuvm_acquire_process_vm,
+- .destroy_process_vm = amdgpu_amdkfd_gpuvm_destroy_process_vm,
+- .release_process_vm = amdgpu_amdkfd_gpuvm_release_process_vm,
+- .get_process_page_dir = amdgpu_amdkfd_gpuvm_get_process_page_dir,
+ .set_vm_context_page_table_base = set_vm_context_page_table_base,
+- .alloc_memory_of_gpu = amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu,
+- .free_memory_of_gpu = amdgpu_amdkfd_gpuvm_free_memory_of_gpu,
+- .map_memory_to_gpu = amdgpu_amdkfd_gpuvm_map_memory_to_gpu,
+- .unmap_memory_to_gpu = amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu,
+- .sync_memory = amdgpu_amdkfd_gpuvm_sync_memory,
+- .map_gtt_bo_to_kernel = amdgpu_amdkfd_gpuvm_map_gtt_bo_to_kernel,
+- .restore_process_bos = amdgpu_amdkfd_gpuvm_restore_process_bos,
+ .invalidate_tlbs = invalidate_tlbs,
+ .invalidate_tlbs_vmid = invalidate_tlbs_vmid,
+- .submit_ib = amdgpu_amdkfd_submit_ib,
+- .gpu_recover = amdgpu_amdkfd_gpu_reset,
+- .set_compute_idle = amdgpu_amdkfd_set_compute_idle
+ };
+
+ struct kfd2kgd_calls *amdgpu_amdkfd_gfx_9_0_get_functions(void)
+diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
+index b2e3c195382d..8fbd7a52a49d 100644
+--- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
++++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
+@@ -177,20 +177,6 @@ struct tile_config {
+ /**
+ * struct kfd2kgd_calls
+ *
+- * @init_gtt_mem_allocation: Allocate a buffer on the gart aperture.
+- * The buffer can be used for mqds, hpds, kernel queue, fence and runlists
+- *
+- * @free_gtt_mem: Frees a buffer that was allocated on the gart aperture
+- *
+- * @get_local_mem_info: Retrieves information about GPU local memory
+- *
+- * @get_gpu_clock_counter: Retrieves GPU clock counter
+- *
+- * @get_max_engine_clock_in_mhz: Retrieves maximum GPU clock in MHz
+- *
+- * @alloc_pasid: Allocate a PASID
+- * @free_pasid: Free a PASID
+- *
+ * @program_sh_mem_settings: A function that should initiate the memory
+ * properties such as main aperture memory type (cache / non cached) and
+ * secondary aperture base address, size and memory type.
+@@ -227,64 +213,16 @@ struct tile_config {
+ *
+ * @get_tile_config: Returns GPU-specific tiling mode information
+ *
+- * @get_cu_info: Retrieves activated cu info
+- *
+- * @get_vram_usage: Returns current VRAM usage
+- *
+- * @create_process_vm: Create a VM address space for a given process and GPU
+- *
+- * @destroy_process_vm: Destroy a VM
+- *
+- * @get_process_page_dir: Get physical address of a VM page directory
+- *
+ * @set_vm_context_page_table_base: Program page table base for a VMID
+ *
+- * @alloc_memory_of_gpu: Allocate GPUVM memory
+- *
+- * @free_memory_of_gpu: Free GPUVM memory
+- *
+- * @map_memory_to_gpu: Map GPUVM memory into a specific VM address
+- * space. Allocates and updates page tables and page directories as
+- * needed. This function may return before all page table updates have
+- * completed. This allows multiple map operations (on multiple GPUs)
+- * to happen concurrently. Use sync_memory to synchronize with all
+- * pending updates.
+- *
+- * @unmap_memor_to_gpu: Unmap GPUVM memory from a specific VM address space
+- *
+- * @sync_memory: Wait for pending page table updates to complete
+- *
+- * @map_gtt_bo_to_kernel: Map a GTT BO for kernel access
+- * Pins the BO, maps it to kernel address space. Such BOs are never evicted.
+- * The kernel virtual address remains valid until the BO is freed.
+- *
+- * @restore_process_bos: Restore all BOs that belong to the
+- * process. This is intended for restoring memory mappings after a TTM
+- * eviction.
+- *
+ * @invalidate_tlbs: Invalidate TLBs for a specific PASID
+ *
+ * @invalidate_tlbs_vmid: Invalidate TLBs for a specific VMID
+ *
+- * @submit_ib: Submits an IB to the engine specified by inserting the
+- * IB to the corresponding ring (ring type). The IB is executed with the
+- * specified VMID in a user mode context.
+- *
+- * @get_vm_fault_info: Return information about a recent VM fault on
+- * GFXv7 and v8. If multiple VM faults occurred since the last call of
+- * this function, it will return information about the first of those
+- * faults. On GFXv9 VM fault information is fully contained in the IH
+- * packet and this function is not needed.
+- *
+ * @read_vmid_from_vmfault_reg: On Hawaii the VMID is not set in the
+ * IH ring entry. This function allows the KFD ISR to get the VMID
+ * from the fault status register as early as possible.
+ *
+- * @gpu_recover: let kgd reset gpu after kfd detect CPC hang
+- *
+- * @set_compute_idle: Indicates that compute is idle on a device. This
+- * can be used to change power profiles depending on compute activity.
+- *
+ * @get_hive_id: Returns hive id of current device, 0 if xgmi is not enabled
+ *
+ * This structure contains function pointers to services that the kgd driver
+@@ -292,21 +230,6 @@ struct tile_config {
+ *
+ */
+ struct kfd2kgd_calls {
+- int (*init_gtt_mem_allocation)(struct kgd_dev *kgd, size_t size,
+- void **mem_obj, uint64_t *gpu_addr,
+- void **cpu_ptr, bool mqd_gfx9);
+-
+- void (*free_gtt_mem)(struct kgd_dev *kgd, void *mem_obj);
+-
+- void (*get_local_mem_info)(struct kgd_dev *kgd,
+- struct kfd_local_mem_info *mem_info);
+- uint64_t (*get_gpu_clock_counter)(struct kgd_dev *kgd);
+-
+- uint32_t (*get_max_engine_clock_in_mhz)(struct kgd_dev *kgd);
+-
+- int (*alloc_pasid)(unsigned int bits);
+- void (*free_pasid)(unsigned int pasid);
+-
+ /* Register access functions */
+ void (*program_sh_mem_settings)(struct kgd_dev *kgd, uint32_t vmid,
+ uint32_t sh_mem_config, uint32_t sh_mem_ape1_base,
+@@ -370,48 +293,14 @@ struct kfd2kgd_calls {
+ uint64_t va, uint32_t vmid);
+ int (*get_tile_config)(struct kgd_dev *kgd, struct tile_config *config);
+
+- void (*get_cu_info)(struct kgd_dev *kgd,
+- struct kfd_cu_info *cu_info);
+- uint64_t (*get_vram_usage)(struct kgd_dev *kgd);
+-
+- int (*create_process_vm)(struct kgd_dev *kgd, void **vm,
+- void **process_info, struct dma_fence **ef);
+- int (*acquire_process_vm)(struct kgd_dev *kgd, struct file *filp,
+- void **vm, void **process_info, struct dma_fence **ef);
+- void (*destroy_process_vm)(struct kgd_dev *kgd, void *vm);
+- void (*release_process_vm)(struct kgd_dev *kgd, void *vm);
+- uint64_t (*get_process_page_dir)(void *vm);
+ void (*set_vm_context_page_table_base)(struct kgd_dev *kgd,
+ uint32_t vmid, uint64_t page_table_base);
+- int (*alloc_memory_of_gpu)(struct kgd_dev *kgd, uint64_t va,
+- uint64_t size, void *vm,
+- struct kgd_mem **mem, uint64_t *offset,
+- uint32_t flags);
+- int (*free_memory_of_gpu)(struct kgd_dev *kgd, struct kgd_mem *mem);
+- int (*map_memory_to_gpu)(struct kgd_dev *kgd, struct kgd_mem *mem,
+- void *vm);
+- int (*unmap_memory_to_gpu)(struct kgd_dev *kgd, struct kgd_mem *mem,
+- void *vm);
+- int (*sync_memory)(struct kgd_dev *kgd, struct kgd_mem *mem, bool intr);
+- int (*map_gtt_bo_to_kernel)(struct kgd_dev *kgd, struct kgd_mem *mem,
+- void **kptr, uint64_t *size);
+- int (*restore_process_bos)(void *process_info, struct dma_fence **ef);
+-
+ int (*invalidate_tlbs)(struct kgd_dev *kgd, uint16_t pasid);
+ int (*invalidate_tlbs_vmid)(struct kgd_dev *kgd, uint16_t vmid);
+
+- int (*submit_ib)(struct kgd_dev *kgd, enum kgd_engine_type engine,
+- uint32_t vmid, uint64_t gpu_addr,
+- uint32_t *ib_cmd, uint32_t ib_len);
+
+- int (*get_vm_fault_info)(struct kgd_dev *kgd,
+- struct kfd_vm_fault_info *info);
+ uint32_t (*read_vmid_from_vmfault_reg)(struct kgd_dev *kgd);
+
+- void (*gpu_recover)(struct kgd_dev *kgd);
+-
+- void (*set_compute_idle)(struct kgd_dev *kgd, bool idle);
+-
+ uint64_t (*get_hive_id)(struct kgd_dev *kgd);
+
+ };
+--
+2.17.1
+