static int mes_v12_1_kiq_hw_init(struct amdgpu_device *adev, uint32_t xcc_id);
static int mes_v12_1_kiq_hw_fini(struct amdgpu_device *adev, uint32_t xcc_id);
static int mes_v12_1_self_test(struct amdgpu_device *adev, int xcc_id);
+static int mes_v12_1_setup_coop_mode(struct amdgpu_device *adev, int xcc_id);
#define MES_EOP_SIZE 2048
mes_set_hw_res_1_pkt.header.dwsize = API_FRAME_SIZE_IN_DWORDS;
mes_set_hw_res_1_pkt.mes_kiq_unmap_timeout = 100;
- if (mes->enable_coop_mode && pipe == AMDGPU_MES_SCHED_PIPE) {
+ /* From version 0x74 above, pipe1 support use shared command buffer
+ to distribute some tasks on individual XCCs*/
+ if (mes->enable_coop_mode &&
+ ((pipe == AMDGPU_MES_SCHED_PIPE) ||
+ ((mes->sched_version & AMDGPU_MES_VERSION_MASK) >= 0x74))) {
master_xcc_id = mes->master_xcc_ids[inst];
mes_set_hw_res_1_pkt.mes_coop_mode = 1;
mes_set_hw_res_1_pkt.coop_sch_shared_mc_addr =
- mes->shared_cmd_buf_gpu_addr[master_xcc_id];
+ mes->shared_cmd_buf_gpu_addr[master_xcc_id + pipe];
}
return mes_v12_1_submit_pkt_and_poll_completion(mes, xcc_id, pipe,
{
int r, inst = MES_PIPE_INST(xcc_id, pipe);
- if (pipe == AMDGPU_MES_KIQ_PIPE)
- return 0;
-
r = amdgpu_bo_create_kernel(adev, PAGE_SIZE, PAGE_SIZE,
AMDGPU_GEM_DOMAIN_VRAM,
&adev->mes.shared_cmd_buf_obj[inst],
goto failure;
if (adev->enable_uni_mes) {
+ r = mes_v12_1_setup_coop_mode(adev, xcc_id);
+ if (r)
+ goto failure;
+
r = mes_v12_1_set_hw_resources(&adev->mes,
AMDGPU_MES_KIQ_PIPE, xcc_id);
if (r)
goto failure;
if (adev->enable_uni_mes) {
- r = mes_v12_1_setup_coop_mode(adev, xcc_id);
- if (r)
- goto failure;
mes_v12_1_set_hw_resources_1(&adev->mes,
AMDGPU_MES_SCHED_PIPE, xcc_id);
}