summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorshaoyunl <shaoyun.liu@amd.com>2023-11-22 14:34:11 -0500
committerAlex Deucher <alexander.deucher@amd.com>2024-05-02 16:18:12 -0400
commit19e69a5d2872ac185333c3a314fb3aa0c6032182 (patch)
tree7baddf911dd59b0694c81e25326b9ab6d4637eda /drivers/gpu/drm
parenta2211e475cc0641cd49d019f9c70b1f69fd30e1c (diff)
downloadlinux-next-19e69a5d2872ac185333c3a314fb3aa0c6032182.tar.gz
linux-next-19e69a5d2872ac185333c3a314fb3aa0c6032182.zip
drm/amdgpu: Enable unmapped doorbell handling basic mode on mes 12
Enable basic mode handling for doorbell ring on unmapped CP queue. In this mode, MES can start schedule the queue mapping based on HW interrupt instead of timer. Signed-off-by: shaoyunl <shaoyun.liu@amd.com> Reviewed-by: Harish Kasiviswanthan <Harish.Kasiviswanthan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/mes_v12_0.c16
-rw-r--r--drivers/gpu/drm/amd/include/mes_v12_api_def.h3
2 files changed, 17 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
index 2d713e7b976a..4a041cc22f68 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
@@ -394,7 +394,14 @@ static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes)
mes_set_hw_res_pkt.disable_mes_log = 1;
mes_set_hw_res_pkt.use_different_vmid_compute = 1;
mes_set_hw_res_pkt.enable_reg_active_poll = 1;
- mes_set_hw_res_pkt.oversubscription_timer = 50;
+
+ /*
+ * No need to enable oversubscribe timer when we have unmapped doorbell
+ * handling support.
+ * handling mode - 0: disabled; 1: basic version; 2: basic+ version
+ */
+ mes_set_hw_res_pkt.oversubscription_timer = 0;
+ mes_set_hw_res_pkt.unmapped_doorbell_handling = 1;
return mes_v12_0_submit_pkt_and_poll_completion(mes,
&mes_set_hw_res_pkt, sizeof(mes_set_hw_res_pkt),
@@ -831,6 +838,13 @@ static int mes_v12_0_mqd_init(struct amdgpu_ring *ring)
mqd->cp_hqd_iq_timer = regCP_HQD_IQ_TIMER_DEFAULT;
mqd->cp_hqd_quantum = regCP_HQD_QUANTUM_DEFAULT;
+ /*
+ * Set CP_HQD_GFX_CONTROL.DB_UPDATED_MSG_EN[15] to enable unmapped
+ * doorbell handling. This is a reserved CP internal register can
+ * not be accesss by others
+ */
+ mqd->reserved_184 = BIT(15);
+
return 0;
}
diff --git a/drivers/gpu/drm/amd/include/mes_v12_api_def.h b/drivers/gpu/drm/amd/include/mes_v12_api_def.h
index 81cc0a554049..2cdecf937ace 100644
--- a/drivers/gpu/drm/amd/include/mes_v12_api_def.h
+++ b/drivers/gpu/drm/amd/include/mes_v12_api_def.h
@@ -238,7 +238,8 @@ union MESAPI_SET_HW_RESOURCES {
uint32_t send_write_data : 1;
uint32_t os_tdr_timeout_override : 1;
uint32_t use_rs64mem_for_proc_gang_ctx : 1;
- uint32_t reserved : 17;
+ uint32_t unmapped_doorbell_handling: 2;
+ uint32_t reserved : 15;
};
uint32_t uint32_all;
};