drm/amdgpu: Fix CIK references in gmc_v8
Subsystems (3)
PATCH 1/2 drm/amdgpu: Fix CIK references in gmc_v8
gmc_v8 is for VI, not CIK, so fix those references
--- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +7 -7
@@ -289,7 +289,7 @@ static int gmc_v8_0_init_microcode(struct amdgpu_device *adev)* * @adev: amdgpu_device pointer * -* Load the GDDR MC ucode into the hw (CIK). +* Load the GDDR MC ucode into the hw (VI). * Returns 0 on success, error on failure. */ static int gmc_v8_0_tonga_mc_load_microcode (struct amdgpu_device *adev)
@@ -443,7 +443,7 @@ static void gmc_v8_0_vram_gtt_location(struct amdgpu_device *adev,* @adev: amdgpu_device pointer * * Set the location of vram, gart, and AGP in the GPU's -* physical address space (CIK). +* physical address space (VI). */ static void gmc_v8_0_mc_program (struct amdgpu_device *adev) {
@@ -515,7 +515,7 @@ static void gmc_v8_0_mc_program(struct amdgpu_device *adev)* @adev: amdgpu_device pointer * * Look up the amount of vram, vram width, and decide how to place -* vram and gart within the GPU's physical address space (CIK). +* vram and gart within the GPU's physical address space (VI). * Returns 0 for success. */ static int gmc_v8_0_mc_init (struct amdgpu_device *adev)
@@ -630,7 +630,7 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev)* @adev: amdgpu_device pointer * @vmid: vm instance to flush * -* Flush the TLB for the requested page table (CIK). +* Flush the TLB for the requested page table (VI). */ static void gmc_v8_0_flush_gpu_tlb (struct amdgpu_device *adev,uint32_t vmid,uint32_t flush_type)
@@ -800,7 +800,7 @@ static void gmc_v8_0_set_prt(struct amdgpu_device *adev, bool enable)* This sets up the TLBs, programs the page tables for VMID0, * sets up the hw for VMIDs 1-15 which are allocated on * demand, and sets up the global locations for the LDS, GDS, -* and GPUVM for FSA64 clients (CIK). +* and GPUVM for FSA64 clients (VI). * Returns 0 for success, errors for failure. */ static int gmc_v8_0_gart_enable (struct amdgpu_device *adev)
@@ -948,7 +948,7 @@ static int gmc_v8_0_gart_init(struct amdgpu_device *adev)* * @adev: amdgpu_device pointer * -* This disables all VM page table (CIK). +* This disables all VM page table (VI). */ static void gmc_v8_0_gart_disable (struct amdgpu_device *adev) {
@@ -978,7 +978,7 @@ static void gmc_v8_0_gart_disable(struct amdgpu_device *adev)* @status: VM_CONTEXT1_PROTECTION_FAULT_STATUS register value * @addr: VM_CONTEXT1_PROTECTION_FAULT_ADDR register value * -* Print human readable fault information (CIK). +* Print human readable fault information (VI). */ static void gmc_v8_0_vm_decode_fault (struct amdgpu_device *adev,u32 status,u32 addr,u32 mc_client,unsigned pasid)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/2 drm/amdkfd: Cosmetic cleanup
Fix some spacing issues, log output, uses of !=NULL/==NULL, unneeded extra lines and clean up a declaration from =1 to =true for clarity
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c | 2 -- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +4 -2
@@ -149,7 +149,8 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) };/* this is going to have a few of the MSBs set that we need to -* clear */ +* clear +*/ bitmap_complement (gpu_resources.queue_bitmap, adev->gfx.mec.queue_bitmap,KGD_MAX_QUEUES );
@@ -163,7 +164,8 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) gpu_resources.queue_bitmap);/* According to linux/bitmap.h we shouldn't use bitmap_clear if -* nbits is not compile time constant */ +* nbits is not compile time constant +*/ last_valid_bit =1 /* only first MEC can have compute queues */ * adev->gfx.mec.num_pipe_per_mec * adev->gfx.mec.num_queue_per_pipe;
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c +1 -1
@@ -310,7 +310,7 @@ static inline uint32_t get_sdma_base_addr(struct cik_sdma_rlc_registers *m) retval = m->sdma_engine_id *SDMA1_REGISTER_OFFSET + m->sdma_queue_id *KFD_CIK_SDMA_QUEUE_OFFSET ; -pr_debug ("kfd: sdma base address: 0x%x\n" , retval); +pr_debug ("sdma base address: 0x%x\n" , retval);return retval; }
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c +1 -1
@@ -266,7 +266,7 @@ static inline uint32_t get_sdma_base_addr(struct vi_sdma_mqd *m) retval = m->sdma_engine_id *SDMA1_REGISTER_OFFSET + m->sdma_queue_id *KFD_VI_SDMA_QUEUE_OFFSET ; -pr_debug ("kfd: sdma base address: 0x%x\n" , retval); +pr_debug ("sdma base address: 0x%x\n" , retval);return retval; }
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +1 -1
@@ -1379,7 +1379,7 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gpu( ret =map_bo_to_gpuvm (adev, entry, ctx.sync, is_invalid_userptr);if (ret) { -pr_err ("Failed to map radeon bo to gpuvm\n" ); +pr_err ("Failed to map bo to gpuvm\n" ); goto map_bo_to_gpuvm_failed; }
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +1 -1
@@ -524,7 +524,7 @@ static int kfd_ioctl_set_trap_handler(struct file *filep,struct kfd_process_device *pdd; dev =kfd_device_by_id (args->gpu_id); -if (dev ==NULL ) +if (!dev)return -EINVAL ;mutex_lock (&p->mutex);
drivers/gpu/drm/amd/amdkfd/kfd_events.c +1 -1
@@ -983,7 +983,7 @@ void kfd_signal_vm_fault_event(struct kfd_dev *dev, unsigned int pasid,return ;/* Presumably process exited. */ memset (&memory_exception_data,0 ,sizeof (memory_exception_data)); memory_exception_data.gpu_id = dev->id; - memory_exception_data.failure.imprecise =1 ; + memory_exception_data.failure.imprecise = true;/* Set failure reason */ if (info) { memory_exception_data.va = (info->page_addr) <<PAGE_SHIFT ;
drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c +0 -2
@@ -436,5 +436,3 @@ int kfd_init_apertures(struct kfd_process *process)return 0 ; } - -
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c +1 -1
@@ -355,7 +355,7 @@ static int init_mqd_sdma(struct mqd_manager *mm, void **mqd,memset (m,0 ,sizeof (struct vi_sdma_mqd )); *mqd = m; -if (gart_addr !=NULL ) +if (gart_addr) *gart_addr = (*mqd_mem_obj)->gpu_addr; retval = mm->update_mqd (mm, m, q);
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -1
@@ -259,7 +259,7 @@ struct kfd_dev {bool interrupts_active;/* Debug manager */ -struct kfd_dbgmgr *dbgmgr; +struct kfd_dbgmgr *dbgmgr;/* Firmware versions */ uint16_t mec_fw_version;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 2/2] drm/amdkfd: Cosmetic cleanup
Thank you Kent! The series is Reviewed-by: Felix Kuehling <[email protected]>
Quoted 147 lines · Kent
[CAUTION: External Email]
Fix some spacing issues, log output, uses of !=NULL/==NULL, unneeded extra lines and clean up a declaration from =1 to =true for clarity
Change-Id I638231cde4887a3c2da0b70e5fee77059cfb0bf2Signed-off-by Kent Russell <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c | 2 -- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +4
-2@@ -149,7 +149,8 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) };/* this is going to have a few of the MSBs set that we need to -* clear */ +* clear +*/ bitmap_complement (gpu_resources.queue_bitmap, adev->gfx.mec.queue_bitmap,KGD_MAX_QUEUES );@@ -163,7 +164,8 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) gpu_resources.queue_bitmap);/* According to linux/bitmap.h we shouldn't use bitmap_clear if -* nbits is not compile time constant */ +* nbits is not compile time constant +*/ last_valid_bit =1 /* only first MEC can have compute queues */ * adev->gfx.mec.num_pipe_per_mec * adev->gfx.mec.num_queue_per_pipe;drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c +1
-1@@ -310,7 +310,7 @@ static inline uint32_t get_sdma_base_addr(struct cik_sdma_rlc_registers *m) retval = m->sdma_engine_id *SDMA1_REGISTER_OFFSET + m->sdma_queue_id *KFD_CIK_SDMA_QUEUE_OFFSET ; -pr_debug ("kfd: sdma base address: 0x%x\n" , retval); +pr_debug ("sdma base address: 0x%x\n" , retval);return retval; }drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c +1
-1@@ -266,7 +266,7 @@ static inline uint32_t get_sdma_base_addr(struct vi_sdma_mqd *m) retval = m->sdma_engine_id *SDMA1_REGISTER_OFFSET + m->sdma_queue_id *KFD_VI_SDMA_QUEUE_OFFSET ; -pr_debug ("kfd: sdma base address: 0x%x\n" , retval); +pr_debug ("sdma base address: 0x%x\n" , retval);return retval; }drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +1
-1@@ -1379,7 +1379,7 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gpu( ret =map_bo_to_gpuvm (adev, entry, ctx.sync, is_invalid_userptr);if (ret) { -pr_err ("Failed to map radeon bo to gpuvm\n" ); +pr_err ("Failed to map bo to gpuvm\n" ); goto map_bo_to_gpuvm_failed; }drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +1
-1@@ -524,7 +524,7 @@ static int kfd_ioctl_set_trap_handler(struct file *filep,struct kfd_process_device *pdd; dev =kfd_device_by_id (args->gpu_id); -if (dev ==NULL ) +if (!dev)return -EINVAL ;mutex_lock (&p->mutex);drivers/gpu/drm/amd/amdkfd/kfd_events.c +1
-1@@ -983,7 +983,7 @@ void kfd_signal_vm_fault_event(struct kfd_dev *dev, unsigned int pasid,return ;/* Presumably process exited. */ memset (&memory_exception_data,0 ,sizeof (memory_exception_data)); memory_exception_data.gpu_id = dev->id; - memory_exception_data.failure.imprecise =1 ; + memory_exception_data.failure.imprecise = true;/* Set failure reason */ if (info) { memory_exception_data.va = (info->page_addr) <<PAGE_SHIFT ;drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c +0
-2@@ -436,5 +436,3 @@ int kfd_init_apertures(struct kfd_process *process)return 0 ; } - -drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c +1
-1@@ -355,7 +355,7 @@ static int init_mqd_sdma(struct mqd_manager *mm, void **mqd,memset (m,0 ,sizeof (struct vi_sdma_mqd )); *mqd = m; -if (gart_addr !=NULL ) +if (gart_addr) *gart_addr = (*mqd_mem_obj)->gpu_addr; retval = mm->update_mqd (mm, m, q);drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1
-2@@ -259,7 +259,7 @@ struct kfd_dev {bool interrupts_active;/* Debug manager */ -struct kfd_dbgmgr *dbgmgr; +struct kfd_dbgmgr *dbgmgr;/* Firmware versions */ uint16_t mec_fw_version; --2.17.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
Reviewed-byAm 01.05.19 um 14:31 schrieb Russell, Kent:
Quoted 4 lines
gmc_v8is for VI, not CIK, so fix those referencesChange-Id Ifa46212fbeadbec7e73ba28d02e97339ffcfb5d1Signed-off-by Kent Russell <[email protected]>
Quoted 63 lines
--- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +6
-6@@ -289,7 +289,7 @@ static int gmc_v8_0_init_microcode(struct amdgpu_device *adev)* * @adev: amdgpu_device pointer * -* Load the GDDR MC ucode into the hw (CIK). +* Load the GDDR MC ucode into the hw (VI). * Returns 0 on success, error on failure. */ static int gmc_v8_0_tonga_mc_load_microcode (struct amdgpu_device *adev)@@ -443,7 +443,7 @@ static void gmc_v8_0_vram_gtt_location(struct amdgpu_device *adev,* @adev: amdgpu_device pointer * * Set the location of vram, gart, and AGP in the GPU's -* physical address space (CIK). +* physical address space (VI). */ static void gmc_v8_0_mc_program (struct amdgpu_device *adev) {@@ -515,7 +515,7 @@ static void gmc_v8_0_mc_program(struct amdgpu_device *adev)* @adev: amdgpu_device pointer * * Look up the amount of vram, vram width, and decide how to place -* vram and gart within the GPU's physical address space (CIK). +* vram and gart within the GPU's physical address space (VI). * Returns 0 for success. */ static int gmc_v8_0_mc_init (struct amdgpu_device *adev)@@ -630,7 +630,7 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev)* @adev: amdgpu_device pointer * @vmid: vm instance to flush * -* Flush the TLB for the requested page table (CIK). +* Flush the TLB for the requested page table (VI). */ static void gmc_v8_0_flush_gpu_tlb (struct amdgpu_device *adev,uint32_t vmid,uint32_t flush_type)@@ -800,7 +800,7 @@ static void gmc_v8_0_set_prt(struct amdgpu_device *adev, bool enable)* This sets up the TLBs, programs the page tables for VMID0, * sets up the hw for VMIDs 1-15 which are allocated on * demand, and sets up the global locations for the LDS, GDS, -* and GPUVM for FSA64 clients (CIK). +* and GPUVM for FSA64 clients (VI). * Returns 0 for success, errors for failure. */ static int gmc_v8_0_gart_enable (struct amdgpu_device *adev)@@ -948,7 +948,7 @@ static int gmc_v8_0_gart_init(struct amdgpu_device *adev)* * @adev: amdgpu_device pointer * -* This disables all VM page table (CIK). +* This disables all VM page table (VI). */ static void gmc_v8_0_gart_disable (struct amdgpu_device *adev) {
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c static void gmc_v8_0_gart_disable(struct amdgpu_device *adev) · line 984
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +1
-1@@ -978,7 +978,7 @@ static void gmc_v8_0_gart_disable(struct amdgpu_device *adev)* @status: VM_CONTEXT1_PROTECTION_FAULT_STATUS register value * @addr: VM_CONTEXT1_PROTECTION_FAULT_ADDR register value * -* Print human readable fault information (CIK). +* Print human readable fault information (VI). */ static void gmc_v8_0_vm_decode_fault (struct amdgpu_device *adev,u32 status,u32 addr,u32 mc_client,unsigned pasid)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx