drm/amdgpu: update the handle ptr in dump_ip_state
Subsystems (2)
PATCH 1/2 drm/amdgpu: update the handle ptr in dump_ip_state
Update the ptr handle to amdgpu_ip_block ptr in all the functions.
Signed-off-by Sunil Khatri <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 4 ++-- drivers/gpu/drm/amd/include/amd_shared.h | 4 +++- 22 files changed, 43 insertions(+), 41 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
@@ -5380,7 +5380,7 @@ int amdgpu_device_pre_asic_reset(struct amdgpu_device *adev,for (i =0 ; i < tmp_adev->num_ip_blocks; i++)if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state) tmp_adev->ip_blocks[i].version->funcs - ->dump_ip_state ((void *)tmp_adev); + ->dump_ip_state ((void *)&tmp_adev->ip_blocks[i]);dev_info (tmp_adev->dev,"Dumping IP State Completed\n" ); }
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1 -1
@@ -42,7 +42,7 @@ static void amdgpu_job_do_core_dump(struct amdgpu_device *adev,for (i =0 ; i < adev->num_ip_blocks; i++)if (adev->ip_blocks[i].version->funcs->dump_ip_state) adev->ip_blocks[i].version->funcs - ->dump_ip_state ((void *)adev); + ->dump_ip_state ((void *)&adev->ip_blocks[i]);dev_info (adev->dev,"Dumping IP State Completed\n" );amdgpu_coredump (adev, true, false, job);
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 -2
@@ -9632,9 +9632,9 @@ static void gfx_v10_ip_print(void *handle, struct drm_printer *p) } } -static void gfx_v10_ip_dump (void *handle) +static void gfx_v10_ip_dump (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_10_1);
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +2 -2
@@ -6703,9 +6703,9 @@ static void gfx_v11_ip_print(void *handle, struct drm_printer *p) } } -static void gfx_v11_ip_dump (void *handle) +static void gfx_v11_ip_dump (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_11_0);
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +2 -2
@@ -5102,9 +5102,9 @@ static void gfx_v12_ip_print(void *handle, struct drm_printer *p) } } -static void gfx_v12_ip_dump (void *handle) +static void gfx_v12_ip_dump (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_12_0);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
@@ -7356,9 +7356,9 @@ static void gfx_v9_ip_print(void *handle, struct drm_printer *p) } -static void gfx_v9_ip_dump (void *handle) +static void gfx_v9_ip_dump (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_9);
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +2 -2
@@ -4643,9 +4643,9 @@ static void gfx_v9_4_3_ip_print(void *handle, struct drm_printer *p) } } -static void gfx_v9_4_3_ip_dump (void *handle) +static void gfx_v9_4_3_ip_dump (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k;uint32_t num_xcc, reg, num_inst;uint32_t xcc_id, xcc_offset, inst_offset;
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +2 -2
@@ -2371,9 +2371,9 @@ static void sdma_v4_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v4_0_dump_ip_state (void *handle) +static void sdma_v4_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_4_0);
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -2
@@ -1878,9 +1878,9 @@ static void sdma_v4_4_2_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v4_4_2_dump_ip_state (void *handle) +static void sdma_v4_4_2_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_4_4_2);
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +2 -2
@@ -1799,9 +1799,9 @@ static void sdma_v5_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v5_0_dump_ip_state (void *handle) +static void sdma_v5_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_5_0);
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +2 -2
@@ -1757,9 +1757,9 @@ static void sdma_v5_2_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v5_2_dump_ip_state (void *handle) +static void sdma_v5_2_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_5_2);
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +2 -2
@@ -1624,9 +1624,9 @@ static void sdma_v6_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v6_0_dump_ip_state (void *handle) +static void sdma_v6_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_6_0);
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c +2 -2
@@ -1556,9 +1556,9 @@ static void sdma_v7_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v7_0_dump_ip_state (void *handle) +static void sdma_v7_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_7_0);
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2 -2
@@ -1957,9 +1957,9 @@ static void vcn_v1_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v1_0_dump_ip_state (void *handle) +static void vcn_v1_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +2 -2
@@ -2066,9 +2066,9 @@ static void vcn_v2_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v2_0_dump_ip_state (void *handle) +static void vcn_v2_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +2 -2
@@ -1958,9 +1958,9 @@ static void vcn_v2_5_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v2_5_dump_ip_state (void *handle) +static void vcn_v2_5_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2 -2
@@ -2284,9 +2284,9 @@ static void vcn_v3_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v3_0_dump_ip_state (void *handle) +static void vcn_v3_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +2 -2
@@ -2190,9 +2190,9 @@ static void vcn_v4_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v4_0_dump_ip_state (void *handle) +static void vcn_v4_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +2 -2
@@ -1765,9 +1765,9 @@ static void vcn_v4_0_3_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v4_0_3_dump_ip_state (void *handle) +static void vcn_v4_0_3_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off, inst_id;
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +2 -2
@@ -1648,9 +1648,9 @@ static void vcn_v4_0_5_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v4_0_5_dump_ip_state (void *handle) +static void vcn_v4_0_5_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +2 -2
@@ -1375,9 +1375,9 @@ static void vcn_v5_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v5_0_dump_ip_state (void *handle) +static void vcn_v5_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;
drivers/gpu/drm/amd/include/amd_shared.h +3 -1
@@ -375,6 +375,8 @@ enum amd_dpm_forced_level;* making calls to hooks from each IP block. This list is ordered to ensure * that the driver initializes the IP blocks in a safe sequence. */ +struct amdgpu_ip_block ; +struct amd_ip_funcs {char *name;int (*early_init)(void *handle);
@@ -399,7 +401,7 @@ struct amd_ip_funcs {int (*set_powergating_state)(void *handle,enum amd_powergating_state state);void (*get_clockgating_state)(void *handle,u64 *flags); -void (*dump_ip_state)(void *handle); +void (*dump_ip_state)(struct amdgpu_ip_block *ip_block);void (*print_ip_state)(void *handle,struct drm_printer *p); };
Signature · 1 line
2.34.1
PATCH 2/2 drm/amdgpu: update the handle ptr in print_ip_state
Update the ptr handle to amdgpu_ip_block ptr in all the functions affected.
Signed-off-by Sunil Khatri <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 12 +++++------- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 4 ++-- drivers/gpu/drm/amd/include/amd_shared.h | 2 +- 21 files changed, 44 insertions(+), 46 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c +5 -7
@@ -203,6 +203,7 @@ amdgpu_devcoredump_read(char *buffer, loff_t offset, size_t count,struct amdgpu_coredump_info *coredump = data;struct drm_print_iterator iter;struct amdgpu_vm_fault_info *fault_info; +struct amdgpu_ip_block *ip_block;int ver; iter.data = buffer;
@@ -282,13 +283,10 @@ amdgpu_devcoredump_read(char *buffer, loff_t offset, size_t count,/* dump the ip state for each ip */ drm_printf (&p,"IP Dump\n" );for (int i =0 ; i < coredump->adev->num_ip_blocks; i++) { -if (coredump->adev->ip_blocks[i].version->funcs->print_ip_state) { -drm_printf (&p,"IP: %s\n" , - coredump->adev->ip_blocks[i] - .version->funcs->name); - coredump->adev->ip_blocks[i] - .version->funcs->print_ip_state ( - (void *)coredump->adev, &p); + ip_block = &(coredump->adev->ip_blocks[i]); +if (ip_block->version->funcs->print_ip_state) { +drm_printf (&p,"IP: %s\n" , ip_block->version->funcs->name); + ip_block->version->funcs->print_ip_state (ip_block, &p);drm_printf (&p,"\n" ); } }
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 -2
@@ -9568,9 +9568,9 @@ static int gfx_v10_0_reset_kcq(struct amdgpu_ring *ring,return amdgpu_ring_test_ring (ring); } -static void gfx_v10_ip_print (void *handle,struct drm_printer *p) +static void gfx_v10_ip_print (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_10_1);
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +2 -2
@@ -6639,9 +6639,9 @@ static int gfx_v11_0_reset_kcq(struct amdgpu_ring *ring, unsigned int vmid)return amdgpu_ring_test_ring (ring); } -static void gfx_v11_ip_print (void *handle,struct drm_printer *p) +static void gfx_v11_ip_print (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_11_0);
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +2 -2
@@ -5038,9 +5038,9 @@ static void gfx_v12_ring_insert_nop(struct amdgpu_ring *ring, uint32_t num_nop)amdgpu_ring_write (ring, ring->funcs->nop); } -static void gfx_v12_ip_print (void *handle,struct drm_printer *p) +static void gfx_v12_ip_print (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_12_0);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
@@ -7316,9 +7316,9 @@ static int gfx_v9_0_reset_kcq(struct amdgpu_ring *ring,return amdgpu_ring_test_ring (ring); } -static void gfx_v9_ip_print (void *handle,struct drm_printer *p) +static void gfx_v9_ip_print (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_9);
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +2 -2
@@ -4583,9 +4583,9 @@ static void gfx_v9_4_3_ring_insert_nop(struct amdgpu_ring *ring, uint32_t num_noamdgpu_ring_write (ring, ring->funcs->nop); } -static void gfx_v9_4_3_ip_print (void *handle,struct drm_printer *p) +static void gfx_v9_4_3_ip_print (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k;uint32_t xcc_id, xcc_offset, inst_offset;uint32_t num_xcc, reg, num_inst;
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +2 -2
@@ -2350,9 +2350,9 @@ static void sdma_v4_0_get_clockgating_state(void *handle, u64 *flags) *flags |=AMD_CG_SUPPORT_SDMA_LS ; } -static void sdma_v4_0_print_ip_state (void *handle,struct drm_printer *p) +static void sdma_v4_0_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_4_0);uint32_t instance_offset;
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -2
@@ -1857,9 +1857,9 @@ static void sdma_v4_4_2_get_clockgating_state(void *handle, u64 *flags) *flags |=AMD_CG_SUPPORT_SDMA_LS ; } -static void sdma_v4_4_2_print_ip_state (void *handle,struct drm_printer *p) +static void sdma_v4_4_2_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_4_4_2);uint32_t instance_offset;
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +2 -2
@@ -1778,9 +1778,9 @@ static void sdma_v5_0_get_clockgating_state(void *handle, u64 *flags) *flags |=AMD_CG_SUPPORT_SDMA_LS ; } -static void sdma_v5_0_print_ip_state (void *handle,struct drm_printer *p) +static void sdma_v5_0_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_5_0);uint32_t instance_offset;
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +2 -2
@@ -1736,9 +1736,9 @@ static void sdma_v5_2_ring_end_use(struct amdgpu_ring *ring)amdgpu_gfx_off_ctrl (adev, true); } -static void sdma_v5_2_print_ip_state (void *handle,struct drm_printer *p) +static void sdma_v5_2_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_5_2);uint32_t instance_offset;
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +2 -2
@@ -1603,9 +1603,9 @@ static void sdma_v6_0_get_clockgating_state(void *handle, u64 *flags) { } -static void sdma_v6_0_print_ip_state (void *handle,struct drm_printer *p) +static void sdma_v6_0_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_6_0);uint32_t instance_offset;
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c +2 -2
@@ -1535,9 +1535,9 @@ static void sdma_v7_0_get_clockgating_state(void *handle, u64 *flags) { } -static void sdma_v7_0_print_ip_state (void *handle,struct drm_printer *p) +static void sdma_v7_0_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_7_0);uint32_t instance_offset;
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2 -2
@@ -1925,9 +1925,9 @@ void vcn_v1_0_ring_end_use(struct amdgpu_ring *ring)mutex_unlock (&ring->adev->vcn.vcn1_jpeg1_workaround); } -static void vcn_v1_0_print_ip_state (void *handle,struct drm_printer *p) +static void vcn_v1_0_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (vcn_reg_list_1_0);uint32_t inst_off, is_powered;
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +2 -2
@@ -2034,9 +2034,9 @@ static int vcn_v2_0_start_sriov(struct amdgpu_device *adev)return vcn_v2_0_start_mmsch (adev, &adev->virt.mm_table); } -static void vcn_v2_0_print_ip_state (void *handle,struct drm_printer *p) +static void vcn_v2_0_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (vcn_reg_list_2_0);uint32_t inst_off, is_powered;
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +2 -2
@@ -1926,9 +1926,9 @@ static void vcn_v2_5_set_irq_funcs(struct amdgpu_device *adev) } } -static void vcn_v2_5_print_ip_state (void *handle,struct drm_printer *p) +static void vcn_v2_5_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (vcn_reg_list_2_5);uint32_t inst_off, is_powered;
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2 -2
@@ -2251,9 +2251,9 @@ static void vcn_v3_0_set_irq_funcs(struct amdgpu_device *adev) } } -static void vcn_v3_0_print_ip_state (void *handle,struct drm_printer *p) +static void vcn_v3_0_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (vcn_reg_list_3_0);uint32_t inst_off;
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +2 -2
@@ -2158,9 +2158,9 @@ static void vcn_v4_0_set_irq_funcs(struct amdgpu_device *adev) } } -static void vcn_v4_0_print_ip_state (void *handle,struct drm_printer *p) +static void vcn_v4_0_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (vcn_reg_list_4_0);uint32_t inst_off, is_powered;
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +2 -2
@@ -1733,9 +1733,9 @@ static void vcn_v4_0_3_set_irq_funcs(struct amdgpu_device *adev) adev->vcn.inst->irq.funcs = &vcn_v4_0_3_irq_funcs; } -static void vcn_v4_0_3_print_ip_state (void *handle,struct drm_printer *p) +static void vcn_v4_0_3_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (vcn_reg_list_4_0_3);uint32_t inst_off, is_powered;
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +2 -2
@@ -1616,9 +1616,9 @@ static void vcn_v4_0_5_set_irq_funcs(struct amdgpu_device *adev) } } -static void vcn_v4_0_5_print_ip_state (void *handle,struct drm_printer *p) +static void vcn_v4_0_5_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (vcn_reg_list_4_0_5);uint32_t inst_off, is_powered;
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +2 -2
@@ -1343,9 +1343,9 @@ static void vcn_v5_0_0_set_irq_funcs(struct amdgpu_device *adev) } } -static void vcn_v5_0_print_ip_state (void *handle,struct drm_printer *p) +static void vcn_v5_0_print_ip_state (struct amdgpu_ip_block *ip_block,struct drm_printer *p) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t reg_count =ARRAY_SIZE (vcn_reg_list_5_0);uint32_t inst_off, is_powered;
drivers/gpu/drm/amd/include/amd_shared.h +1 -1
@@ -402,7 +402,7 @@ struct amd_ip_funcs { enum amd_powergating_state state);void (*get_clockgating_state)(void *handle,u64 *flags);void (*dump_ip_state)(struct amdgpu_ip_block *ip_block); -void (*print_ip_state)(void *handle,struct drm_printer *p); +void (*print_ip_state)(struct amdgpu_ip_block *ip_block,struct drm_printer *p); };
Signature · 1 line
2.34.1
Christian König
maintainerAm 25.09.24 um 05:51 schrieb Sunil Khatri:
Quoted 4 lines
Update the ptr handle to
amdgpu_ip_blockptr in all the functions.Signed-off-by Sunil Khatri <[email protected]>
Both patches look like a straightforward cleanup to me.
Feel free to add Reviewed-by: Christian König <[email protected]> to the series.
Thanks,
Christian.
Quoted 377 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 4 ++-- drivers/gpu/drm/amd/include/amd_shared.h | 4 +++- 22 files changed, 43 insertions(+), 41 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -5380,7 +5380,7 @@ int amdgpu_device_pre_asic_reset(struct amdgpu_device *adev,for (i =0 ; i < tmp_adev->num_ip_blocks; i++)if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state) tmp_adev->ip_blocks[i].version->funcs - ->dump_ip_state ((void *)tmp_adev); + ->dump_ip_state ((void *)&tmp_adev->ip_blocks[i]);dev_info (tmp_adev->dev,"Dumping IP State Completed\n" ); }drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1
-1@@ -42,7 +42,7 @@ static void amdgpu_job_do_core_dump(struct amdgpu_device *adev,for (i =0 ; i < adev->num_ip_blocks; i++)if (adev->ip_blocks[i].version->funcs->dump_ip_state) adev->ip_blocks[i].version->funcs - ->dump_ip_state ((void *)adev); + ->dump_ip_state ((void *)&adev->ip_blocks[i]);dev_info (adev->dev,"Dumping IP State Completed\n" );amdgpu_coredump (adev, true, false, job);drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2
-2@@ -9632,9 +9632,9 @@ static void gfx_v10_ip_print(void *handle, struct drm_printer *p) } } -static void gfx_v10_ip_dump (void *handle) +static void gfx_v10_ip_dump (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_10_1);drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +2
-2@@ -6703,9 +6703,9 @@ static void gfx_v11_ip_print(void *handle, struct drm_printer *p) } } -static void gfx_v11_ip_dump (void *handle) +static void gfx_v11_ip_dump (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_11_0);drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +2
-2@@ -5102,9 +5102,9 @@ static void gfx_v12_ip_print(void *handle, struct drm_printer *p) } } -static void gfx_v12_ip_dump (void *handle) +static void gfx_v12_ip_dump (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_12_0);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-2@@ -7356,9 +7356,9 @@ static void gfx_v9_ip_print(void *handle, struct drm_printer *p) } -static void gfx_v9_ip_dump (void *handle) +static void gfx_v9_ip_dump (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k, reg, index =0 ;uint32_t reg_count =ARRAY_SIZE (gc_reg_list_9);drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +2
-2@@ -4643,9 +4643,9 @@ static void gfx_v9_4_3_ip_print(void *handle, struct drm_printer *p) } } -static void gfx_v9_4_3_ip_dump (void *handle) +static void gfx_v9_4_3_ip_dump (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;uint32_t i, j, k;uint32_t num_xcc, reg, num_inst;uint32_t xcc_id, xcc_offset, inst_offset;drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +2
-2@@ -2371,9 +2371,9 @@ static void sdma_v4_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v4_0_dump_ip_state (void *handle) +static void sdma_v4_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_4_0);drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2
-2@@ -1878,9 +1878,9 @@ static void sdma_v4_4_2_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v4_4_2_dump_ip_state (void *handle) +static void sdma_v4_4_2_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_4_4_2);drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +2
-2@@ -1799,9 +1799,9 @@ static void sdma_v5_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v5_0_dump_ip_state (void *handle) +static void sdma_v5_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_5_0);drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +2
-2@@ -1757,9 +1757,9 @@ static void sdma_v5_2_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v5_2_dump_ip_state (void *handle) +static void sdma_v5_2_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_5_2);drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +2
-2@@ -1624,9 +1624,9 @@ static void sdma_v6_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v6_0_dump_ip_state (void *handle) +static void sdma_v6_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_6_0);drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c +2
-2@@ -1556,9 +1556,9 @@ static void sdma_v7_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void sdma_v7_0_dump_ip_state (void *handle) +static void sdma_v7_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;uint32_t instance_offset;uint32_t reg_count =ARRAY_SIZE (sdma_reg_list_7_0);drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2
-2@@ -1957,9 +1957,9 @@ static void vcn_v1_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v1_0_dump_ip_state (void *handle) +static void vcn_v1_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +2
-2@@ -2066,9 +2066,9 @@ static void vcn_v2_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v2_0_dump_ip_state (void *handle) +static void vcn_v2_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +2
-2@@ -1958,9 +1958,9 @@ static void vcn_v2_5_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v2_5_dump_ip_state (void *handle) +static void vcn_v2_5_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2
-2@@ -2284,9 +2284,9 @@ static void vcn_v3_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v3_0_dump_ip_state (void *handle) +static void vcn_v3_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +2
-2@@ -2190,9 +2190,9 @@ static void vcn_v4_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v4_0_dump_ip_state (void *handle) +static void vcn_v4_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +2
-2@@ -1765,9 +1765,9 @@ static void vcn_v4_0_3_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v4_0_3_dump_ip_state (void *handle) +static void vcn_v4_0_3_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off, inst_id;drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +2
-2@@ -1648,9 +1648,9 @@ static void vcn_v4_0_5_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v4_0_5_dump_ip_state (void *handle) +static void vcn_v4_0_5_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +2
-2@@ -1375,9 +1375,9 @@ static void vcn_v5_0_print_ip_state(void *handle, struct drm_printer *p) } } -static void vcn_v5_0_dump_ip_state (void *handle) +static void vcn_v5_0_dump_ip_state (struct amdgpu_ip_block *ip_block) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_device *adev = ip_block->adev;int i, j;bool is_powered;uint32_t inst_off;drivers/gpu/drm/amd/include/amd_shared.h +3
-1@@ -375,6 +375,8 @@ enum amd_dpm_forced_level;* making calls to hooks from each IP block. This list is ordered to ensure * that the driver initializes the IP blocks in a safe sequence. */ +struct amdgpu_ip_block ; +struct amd_ip_funcs {char *name;int (*early_init)(void *handle);@@ -399,7 +401,7 @@ struct amd_ip_funcs {int (*set_powergating_state)(void *handle,enum amd_powergating_state state);void (*get_clockgating_state)(void *handle,u64 *flags); -void (*dump_ip_state)(void *handle); +void (*dump_ip_state)(struct amdgpu_ip_block *ip_block);void (*print_ip_state)(void *handle,struct drm_printer *p); };