Commit 81faf9e0 authored by Mukul Joshi's avatar Mukul Joshi Committed by Alex Deucher

drm/amdkfd: Fix reg offset for setting CWSR grace period

This patch fixes the case where the code currently passes
absolute register address and not the reg offset, which HWS
expects, when sending the PM4 packet to set/update CWSR grace
period. Additionally, cleanup the signature of
build_grace_period_packet_info function as it no longer needs
the inst parameter.
Signed-off-by: default avatarMukul Joshi <mukul.joshi@amd.com>
Reviewed-by: default avatarJonathan Kim <jonathan.kim@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent afaf2b38
...@@ -980,8 +980,7 @@ void kgd_gfx_v10_build_grace_period_packet_info(struct amdgpu_device *adev, ...@@ -980,8 +980,7 @@ void kgd_gfx_v10_build_grace_period_packet_info(struct amdgpu_device *adev,
uint32_t wait_times, uint32_t wait_times,
uint32_t grace_period, uint32_t grace_period,
uint32_t *reg_offset, uint32_t *reg_offset,
uint32_t *reg_data, uint32_t *reg_data)
uint32_t inst)
{ {
*reg_data = wait_times; *reg_data = wait_times;
......
...@@ -55,5 +55,4 @@ void kgd_gfx_v10_build_grace_period_packet_info(struct amdgpu_device *adev, ...@@ -55,5 +55,4 @@ void kgd_gfx_v10_build_grace_period_packet_info(struct amdgpu_device *adev,
uint32_t wait_times, uint32_t wait_times,
uint32_t grace_period, uint32_t grace_period,
uint32_t *reg_offset, uint32_t *reg_offset,
uint32_t *reg_data, uint32_t *reg_data);
uint32_t inst);
...@@ -1103,8 +1103,7 @@ void kgd_gfx_v9_build_grace_period_packet_info(struct amdgpu_device *adev, ...@@ -1103,8 +1103,7 @@ void kgd_gfx_v9_build_grace_period_packet_info(struct amdgpu_device *adev,
uint32_t wait_times, uint32_t wait_times,
uint32_t grace_period, uint32_t grace_period,
uint32_t *reg_offset, uint32_t *reg_offset,
uint32_t *reg_data, uint32_t *reg_data)
uint32_t inst)
{ {
*reg_data = wait_times; *reg_data = wait_times;
...@@ -1120,8 +1119,7 @@ void kgd_gfx_v9_build_grace_period_packet_info(struct amdgpu_device *adev, ...@@ -1120,8 +1119,7 @@ void kgd_gfx_v9_build_grace_period_packet_info(struct amdgpu_device *adev,
SCH_WAVE, SCH_WAVE,
grace_period); grace_period);
*reg_offset = SOC15_REG_OFFSET(GC, GET_INST(GC, inst), *reg_offset = SOC15_REG_OFFSET(GC, 0, mmCP_IQ_WAIT_TIME2);
mmCP_IQ_WAIT_TIME2);
} }
void kgd_gfx_v9_program_trap_handler_settings(struct amdgpu_device *adev, void kgd_gfx_v9_program_trap_handler_settings(struct amdgpu_device *adev,
......
...@@ -100,5 +100,4 @@ void kgd_gfx_v9_build_grace_period_packet_info(struct amdgpu_device *adev, ...@@ -100,5 +100,4 @@ void kgd_gfx_v9_build_grace_period_packet_info(struct amdgpu_device *adev,
uint32_t wait_times, uint32_t wait_times,
uint32_t grace_period, uint32_t grace_period,
uint32_t *reg_offset, uint32_t *reg_offset,
uint32_t *reg_data, uint32_t *reg_data);
uint32_t inst);
...@@ -1677,8 +1677,7 @@ static int start_cpsch(struct device_queue_manager *dqm) ...@@ -1677,8 +1677,7 @@ static int start_cpsch(struct device_queue_manager *dqm)
dqm->dev->kfd2kgd->build_grace_period_packet_info( dqm->dev->kfd2kgd->build_grace_period_packet_info(
dqm->dev->adev, dqm->wait_times, dqm->dev->adev, dqm->wait_times,
grace_period, &reg_offset, grace_period, &reg_offset,
&dqm->wait_times, &dqm->wait_times);
ffs(dqm->dev->xcc_mask) - 1);
} }
dqm_unlock(dqm); dqm_unlock(dqm);
......
...@@ -299,8 +299,7 @@ static int pm_set_grace_period_v9(struct packet_manager *pm, ...@@ -299,8 +299,7 @@ static int pm_set_grace_period_v9(struct packet_manager *pm,
pm->dqm->wait_times, pm->dqm->wait_times,
grace_period, grace_period,
&reg_offset, &reg_offset,
&reg_data, &reg_data);
0);
if (grace_period == USE_DEFAULT_GRACE_PERIOD) if (grace_period == USE_DEFAULT_GRACE_PERIOD)
reg_data = pm->dqm->wait_times; reg_data = pm->dqm->wait_times;
......
...@@ -326,8 +326,7 @@ struct kfd2kgd_calls { ...@@ -326,8 +326,7 @@ struct kfd2kgd_calls {
uint32_t wait_times, uint32_t wait_times,
uint32_t grace_period, uint32_t grace_period,
uint32_t *reg_offset, uint32_t *reg_offset,
uint32_t *reg_data, uint32_t *reg_data);
uint32_t inst);
void (*get_cu_occupancy)(struct amdgpu_device *adev, int pasid, void (*get_cu_occupancy)(struct amdgpu_device *adev, int pasid,
int *wave_cnt, int *max_waves_per_cu, uint32_t inst); int *wave_cnt, int *max_waves_per_cu, uint32_t inst);
void (*program_trap_handler_settings)(struct amdgpu_device *adev, void (*program_trap_handler_settings)(struct amdgpu_device *adev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment