drm/amdgpu: fix baco handling for soc15
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix baco handling for soc15
Need to check if the operation is one that involves registers before getting the register offset. Fixes a crash in when handling commands without a register offset, e.g., wait.
--- drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c +6 -3
@@ -84,11 +84,14 @@ bool soc15_baco_program_registers(struct pp_hwmgr *hwmgr, const u32 array_size) {struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); -u32 i, reg; +u32 i, reg =0 ;for (i =0 ; i < array_size; i++) { - reg = adev->reg_offset[entry[i].hwip][entry[i].inst][entry[i].seg] - + entry[i].reg_offset; +if ((entry[i].cmd ==CMD_WRITE ) || + (entry[i].cmd ==CMD_READMODIFYWRITE ) || + (entry[i].cmd ==CMD_WAITFOR )) + reg = adev->reg_offset[entry[i].hwip][entry[i].inst][entry[i].seg] + + entry[i].reg_offset;if (!baco_cmd_handler (hwmgr, entry[i].cmd, reg, entry[i].mask, entry[i].shift, entry[i].val, entry[i].timeout))return false;
Signature · 6 lines
2.20.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): 20190125203122.19195-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org
Andrey
Quoted 22 lines · Alex Deucher
Need to check if the operation is one that involves registers before getting the register offset. Fixes a crash in when handling commands without a register offset, e.g., wait.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c +1
-1@@ -84,11 +84,14 @@ bool soc15_baco_program_registers(struct pp_hwmgr *hwmgr, const u32 array_size) {struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); -u32 i, reg; +u32 i, reg =0 ;for (i =0 ; i < array_size; i++) {
drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c bool soc15_baco_program_registers(struct pp_hwmgr *hwmgr, · line 97
Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c +5
-2- reg = adev->reg_offset[entry[i].hwip][entry[i].inst][entry[i].seg] - + entry[i].reg_offset; +if ((entry[i].cmd ==CMD_WRITE ) || + (entry[i].cmd ==CMD_READMODIFYWRITE ) || + (entry[i].cmd ==CMD_WAITFOR )) + reg = adev->reg_offset[entry[i].hwip][entry[i].inst][entry[i].seg] + + entry[i].reg_offset;if (!baco_cmd_handler (hwmgr, entry[i].cmd, reg, entry[i].mask, entry[i].shift, entry[i].val, entry[i].timeout))return false;
_______________________________________________
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): d4dcee2e-fcda-3037-5293-769d37221f5f-5C7GfCeVMHo@public.gmane.org
Qu, Jim
Reviewed-by Jim QuThanks
JimQu
________________________________________
发件人: amd-gfx <[email protected]> 代表 Grodzovsky, Andrey <[email protected]> 发送时间: 2019年1月26日 5:03:30
收件人: Alex Deucher; [email protected]
抄送: Deucher, Alexander
主题: Re: [PATCH] drm/amdgpu: fix baco handling for soc15
Andrey
Quoted 22 lines · Alex Deucher
Need to check if the operation is one that involves registers before getting the register offset. Fixes a crash in when handling commands without a register offset, e.g., wait.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c +1
-1@@ -84,11 +84,14 @@ bool soc15_baco_program_registers(struct pp_hwmgr *hwmgr, const u32 array_size) {struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); -u32 i, reg; +u32 i, reg =0 ;for (i =0 ; i < array_size; i++) {
drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c bool soc15_baco_program_registers(struct pp_hwmgr *hwmgr, · line 97
Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c +5
-2- reg = adev->reg_offset[entry[i].hwip][entry[i].inst][entry[i].seg] - + entry[i].reg_offset; +if ((entry[i].cmd ==CMD_WRITE ) || + (entry[i].cmd ==CMD_READMODIFYWRITE ) || + (entry[i].cmd ==CMD_WAITFOR )) + reg = adev->reg_offset[entry[i].hwip][entry[i].inst][entry[i].seg] + + entry[i].reg_offset;if (!baco_cmd_handler (hwmgr, entry[i].cmd, reg, entry[i].mask, entry[i].shift, entry[i].val, entry[i].timeout))return false;
_______________________________________________
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