Commit 8a7820c0 authored by Harish Kasiviswanathan's avatar Harish Kasiviswanathan Committed by Alex Deucher
Browse files

drm/amdgpu: Reduce dequeue retry timeout for gfx9 family



Dequeue retry timeout controls the interval between checks for unmet
conditions. On MI series, reduce this from 0x40 to 0x1 (~ 1 uS). The
cost of additional bandwidth consumed by CP when polling memory
shouldn't be substantial.

Signed-off-by: default avatarHarish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Reviewed-by: default avatarJonathan Kim <jonathan.kim@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 02fc2f3c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ const struct kfd2kgd_calls aldebaran_kfd2kgd = {
	.set_address_watch = kgd_gfx_aldebaran_set_address_watch,
	.clear_address_watch = kgd_gfx_v9_clear_address_watch,
	.get_iq_wait_times = kgd_gfx_v9_get_iq_wait_times,
	.build_grace_period_packet_info = kgd_gfx_v9_build_grace_period_packet_info,
	.build_dequeue_wait_counts_packet_info = kgd_gfx_v9_build_dequeue_wait_counts_packet_info,
	.program_trap_handler_settings = kgd_gfx_v9_program_trap_handler_settings,
	.hqd_get_pq_addr = kgd_gfx_v9_hqd_get_pq_addr,
	.hqd_reset = kgd_gfx_v9_hqd_reset,
+1 −1
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@ const struct kfd2kgd_calls arcturus_kfd2kgd = {
	.set_address_watch = kgd_gfx_v9_set_address_watch,
	.clear_address_watch = kgd_gfx_v9_clear_address_watch,
	.get_iq_wait_times = kgd_gfx_v9_get_iq_wait_times,
	.build_grace_period_packet_info = kgd_gfx_v9_build_grace_period_packet_info,
	.build_dequeue_wait_counts_packet_info = kgd_gfx_v9_build_dequeue_wait_counts_packet_info,
	.get_cu_occupancy = kgd_gfx_v9_get_cu_occupancy,
	.program_trap_handler_settings = kgd_gfx_v9_program_trap_handler_settings,
	.hqd_get_pq_addr = kgd_gfx_v9_hqd_get_pq_addr,
+2 −2
Original line number Diff line number Diff line
@@ -541,8 +541,8 @@ const struct kfd2kgd_calls gc_9_4_3_kfd2kgd = {
	.get_cu_occupancy = kgd_gfx_v9_get_cu_occupancy,
	.program_trap_handler_settings =
				kgd_gfx_v9_program_trap_handler_settings,
	.build_grace_period_packet_info =
				kgd_gfx_v9_build_grace_period_packet_info,
	.build_dequeue_wait_counts_packet_info =
				kgd_gfx_v9_build_dequeue_wait_counts_packet_info,
	.get_iq_wait_times = kgd_gfx_v9_get_iq_wait_times,
	.enable_debug_trap = kgd_aldebaran_enable_debug_trap,
	.disable_debug_trap = kgd_gfx_v9_4_3_disable_debug_trap,
+14 −14
Original line number Diff line number Diff line
@@ -1021,25 +1021,25 @@ void kgd_gfx_v10_get_iq_wait_times(struct amdgpu_device *adev,
	*wait_times = RREG32(SOC15_REG_OFFSET(GC, 0, mmCP_IQ_WAIT_TIME2));
}

void kgd_gfx_v10_build_grace_period_packet_info(struct amdgpu_device *adev,
void kgd_gfx_v10_build_dequeue_wait_counts_packet_info(struct amdgpu_device *adev,
						uint32_t wait_times,
						uint32_t grace_period,
						uint32_t sch_wave,
						uint32_t que_sleep,
						uint32_t *reg_offset,
						uint32_t *reg_data)
{
	*reg_data = wait_times;

	/*
	 * The CP cannont handle a 0 grace period input and will result in
	 * an infinite grace period being set so set to 1 to prevent this.
	 */
	if (grace_period == 0)
		grace_period = 1;

	if (sch_wave)
		*reg_data = REG_SET_FIELD(*reg_data,
				CP_IQ_WAIT_TIME2,
				SCH_WAVE,
			grace_period);
				sch_wave);
	if (que_sleep)
		*reg_data = REG_SET_FIELD(*reg_data,
				CP_IQ_WAIT_TIME2,
				QUE_SLEEP,
				que_sleep);

	*reg_offset = SOC15_REG_OFFSET(GC, 0, mmCP_IQ_WAIT_TIME2);
}
@@ -1115,7 +1115,7 @@ const struct kfd2kgd_calls gfx_v10_kfd2kgd = {
	.set_address_watch = kgd_gfx_v10_set_address_watch,
	.clear_address_watch = kgd_gfx_v10_clear_address_watch,
	.get_iq_wait_times = kgd_gfx_v10_get_iq_wait_times,
	.build_grace_period_packet_info = kgd_gfx_v10_build_grace_period_packet_info,
	.build_dequeue_wait_counts_packet_info = kgd_gfx_v10_build_dequeue_wait_counts_packet_info,
	.program_trap_handler_settings = program_trap_handler_settings,
	.hqd_get_pq_addr = kgd_gfx_v10_hqd_get_pq_addr,
	.hqd_reset = kgd_gfx_v10_hqd_reset,
+3 −2
Original line number Diff line number Diff line
@@ -51,9 +51,10 @@ uint32_t kgd_gfx_v10_clear_address_watch(struct amdgpu_device *adev,
void kgd_gfx_v10_get_iq_wait_times(struct amdgpu_device *adev,
				uint32_t *wait_times,
				uint32_t inst);
void kgd_gfx_v10_build_grace_period_packet_info(struct amdgpu_device *adev,
void kgd_gfx_v10_build_dequeue_wait_counts_packet_info(struct amdgpu_device *adev,
					       uint32_t wait_times,
					       uint32_t grace_period,
					       uint32_t sch_wave,
					       uint32_t que_sleep,
					       uint32_t *reg_offset,
					       uint32_t *reg_data);
uint64_t kgd_gfx_v10_hqd_get_pq_addr(struct amdgpu_device *adev,
Loading