drm/amdgpu: handle asics with 1 SDMA instance
Subsystems (2)
Alex Deucher
maintainerPATCH 1/2 drm/amdgpu: handle asics with 1 SDMA instance
From: Xiaojian Du <[email protected]>
This patch will handle asics with 1 SDMA instance.
--- drivers/gpu/drm/amd/amdgpu/soc21.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc21.c +3 -2
@@ -252,8 +252,9 @@ static int soc21_read_register(struct amdgpu_device *adev, u32 se_num, *value =0 ;for (i =0 ; i <ARRAY_SIZE (soc21_allowed_read_registers); i++) { en = &soc21_allowed_read_registers[i]; -if (reg_offset != - (adev->reg_offset[en->hwip][en->inst][en->seg] + en->reg_offset)) +if ((i ==7 && (adev->sdma.num_instances ==1 )) ||/* some asics don't have SDMA1 */ + reg_offset != + (adev->reg_offset[en->hwip][en->inst][en->seg] + en->reg_offset))continue ; *value = soc21_get_register_value(adev,
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 2/2 drm/amdgpu: skip the new gc doorbell function for some asics
From: Xiaojian Du <[email protected]>
This patch will skip the new gc doorbell function for some asics, only enable new doorbell model on aisc where it is supported.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +2 -1
@@ -4592,7 +4592,8 @@ static int gfx_v11_0_hw_init(void *handle)if (adev->firmware.load_type !=AMDGPU_FW_LOAD_PSP )gfx_v11_0_select_cp_fw_arch (adev); - adev->nbio.funcs->gc_doorbell_init (adev); +if (adev->nbio.funcs->gc_doorbell_init) + adev->nbio.funcs->gc_doorbell_init (adev); r =gfx_v11_0_rlc_resume (adev);if (r)
Signature · 1 line
2.35.1
Christian König
maintainerAm 03.05.22 um 22:38 schrieb Alex Deucher:
Quoted 17 lines
From: Xiaojian Du <[email protected]>
This patch will handle asics with 1 SDMA instance.
Signed-off-by Xiaojian Du <[email protected]>Reviewed-by Huang Rui <[email protected]>Reviewed-by Alex Deucher <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/soc21.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/soc21.c +0
-0
drivers/gpu/drm/amd/amdgpu/soc21.c static int soc21_read_register(struct amdgpu_device *adev, u32 se_num, · line 257
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/soc21.c +3
-2@@ -252,8 +252,9 @@ static int soc21_read_register(struct amdgpu_device *adev, u32 se_num, *value =0 ;for (i =0 ; i <ARRAY_SIZE (soc21_allowed_read_registers); i++) { en = &soc21_allowed_read_registers[i]; -if (reg_offset != - (adev->reg_offset[en->hwip][en->inst][en->seg] + en->reg_offset)) +if ((i ==7 && (adev->sdma.num_instances ==1 )) ||/* some asics don't have SDMA1 */ + reg_offset != + (adev->reg_offset[en->hwip][en->inst][en->seg] + en->reg_offset))
Hui what? Why do we filter out register reads in the low level function?
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/soc21.c +0
-0continue ; *value = soc21_get_register_value(adev,
Quoted 14 lines · Christian König
Am 03.05.22 um 22:38 schrieb Alex Deucher:
Quoted 12 lines
From: Xiaojian Du <[email protected]>
This patch will handle asics with 1 SDMA instance.
Signed-off-by Xiaojian Du <[email protected]>Reviewed-by Huang Rui <[email protected]>Reviewed-by Alex Deucher <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/soc21.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/soc21.c static int soc21_read_register(struct amdgpu_device *adev, u32 se_num, · line 257
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/soc21.c +3
-2@@ -252,8 +252,9 @@ static int soc21_read_register(struct amdgpu_device *adev, u32 se_num, *value =0 ;for (i =0 ; i <ARRAY_SIZE (soc21_allowed_read_registers); i++) { en = &soc21_allowed_read_registers[i]; -if (reg_offset != - (adev->reg_offset[en->hwip][en->inst][en->seg] + en->reg_offset)) +if ((i ==7 && (adev->sdma.num_instances ==1 )) ||/* some asics don't have SDMA1 */ + reg_offset != + (adev->reg_offset[en->hwip][en->inst][en->seg] + en->reg_offset))Hui what? Why do we filter out register reads in the low level function?
It was copied from nv.c. The proper solution is to handle it like we do in soc15.c:
if (adev->reg_offset[en->hwip][en->inst] &&
reg_offset != (adev->reg_offset[en->hwip][en->inst][en->seg]
+ en->reg_offset))
continue;Alex
Quoted 5 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/soc21.c +0
-0continue ; *value = soc21_get_register_value(adev,
Quoted 31 lines · Alex Deucher
Quoted 14 lines · Christian König
Am 03.05.22 um 22:38 schrieb Alex Deucher:
Quoted 12 lines
From: Xiaojian Du <[email protected]>
This patch will handle asics with 1 SDMA instance.
Signed-off-by Xiaojian Du <[email protected]>Reviewed-by Huang Rui <[email protected]>Reviewed-by Alex Deucher <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/soc21.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/soc21.c static int soc21_read_register(struct amdgpu_device *adev, u32 se_num, · line 257
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/soc21.c +3
-2@@ -252,8 +252,9 @@ static int soc21_read_register(struct amdgpu_device *adev, u32 se_num, *value =0 ;for (i =0 ; i <ARRAY_SIZE (soc21_allowed_read_registers); i++) { en = &soc21_allowed_read_registers[i]; -if (reg_offset != - (adev->reg_offset[en->hwip][en->inst][en->seg] + en->reg_offset)) +if ((i ==7 && (adev->sdma.num_instances ==1 )) ||/* some asics don't have SDMA1 */ + reg_offset != + (adev->reg_offset[en->hwip][en->inst][en->seg] + en->reg_offset))Hui what? Why do we filter out register reads in the low level function?
Quoted 7 lines
It was copied from
nv.c. The proper solution is to handle it like we do insoc15.c:
if (adev->reg_offset[en->hwip][en->inst] &®_offset != (adev->reg_offset[en->hwip][en->inst][en->seg] + en->reg_offset)) continue;
The SDMA1_BASE are not contained in GC V11.0.1 APUs, so cannot refer this pointer. Above check is better than before, thanks!
Thanks,
Ray