@@ -148,7 +148,7 @@ static int mes_v12_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,
148148 union MESAPI__QUERY_MES_STATUS mes_status_pkt ;
149149 signed long timeout = 3000000 ; /* 3000 ms */
150150 struct amdgpu_device * adev = mes -> adev ;
151- struct amdgpu_ring * ring = & mes -> ring ;
151+ struct amdgpu_ring * ring = & mes -> ring [ 0 ] ;
152152 struct MES_API_STATUS * api_status ;
153153 union MESAPI__MISC * x_pkt = pkt ;
154154 const char * op_str , * misc_op_str ;
@@ -177,7 +177,7 @@ static int mes_v12_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,
177177 status_ptr = (u64 * )& adev -> wb .wb [status_offset ];
178178 * status_ptr = 0 ;
179179
180- spin_lock_irqsave (& mes -> ring_lock , flags );
180+ spin_lock_irqsave (& mes -> ring_lock [ 0 ] , flags );
181181 r = amdgpu_ring_alloc (ring , (size + sizeof (mes_status_pkt )) / 4 );
182182 if (r )
183183 goto error_unlock_free ;
@@ -207,7 +207,7 @@ static int mes_v12_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,
207207 sizeof (mes_status_pkt ) / 4 );
208208
209209 amdgpu_ring_commit (ring );
210- spin_unlock_irqrestore (& mes -> ring_lock , flags );
210+ spin_unlock_irqrestore (& mes -> ring_lock [ 0 ] , flags );
211211
212212 op_str = mes_v12_0_get_op_string (x_pkt );
213213 misc_op_str = mes_v12_0_get_misc_op_string (x_pkt );
@@ -249,7 +249,7 @@ static int mes_v12_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,
249249 amdgpu_ring_undo (ring );
250250
251251error_unlock_free :
252- spin_unlock_irqrestore (& mes -> ring_lock , flags );
252+ spin_unlock_irqrestore (& mes -> ring_lock [ 0 ] , flags );
253253
254254error_wb_free :
255255 amdgpu_device_wb_free (adev , status_offset );
@@ -1095,7 +1095,7 @@ static int mes_v12_0_kiq_enable_queue(struct amdgpu_device *adev)
10951095 return r ;
10961096 }
10971097
1098- kiq -> pmf -> kiq_map_queues (kiq_ring , & adev -> mes .ring );
1098+ kiq -> pmf -> kiq_map_queues (kiq_ring , & adev -> mes .ring [ 0 ] );
10991099
11001100 r = amdgpu_ring_test_ring (kiq_ring );
11011101 if (r ) {
@@ -1114,7 +1114,7 @@ static int mes_v12_0_queue_init(struct amdgpu_device *adev,
11141114 if (pipe == AMDGPU_MES_KIQ_PIPE )
11151115 ring = & adev -> gfx .kiq [0 ].ring ;
11161116 else if (pipe == AMDGPU_MES_SCHED_PIPE )
1117- ring = & adev -> mes .ring ;
1117+ ring = & adev -> mes .ring [ 0 ] ;
11181118 else
11191119 BUG ();
11201120
@@ -1160,7 +1160,7 @@ static int mes_v12_0_ring_init(struct amdgpu_device *adev)
11601160{
11611161 struct amdgpu_ring * ring ;
11621162
1163- ring = & adev -> mes .ring ;
1163+ ring = & adev -> mes .ring [ 0 ] ;
11641164
11651165 ring -> funcs = & mes_v12_0_ring_funcs ;
11661166
@@ -1213,7 +1213,7 @@ static int mes_v12_0_mqd_sw_init(struct amdgpu_device *adev,
12131213 if (pipe == AMDGPU_MES_KIQ_PIPE )
12141214 ring = & adev -> gfx .kiq [0 ].ring ;
12151215 else if (pipe == AMDGPU_MES_SCHED_PIPE )
1216- ring = & adev -> mes .ring ;
1216+ ring = & adev -> mes .ring [ 0 ] ;
12171217 else
12181218 BUG ();
12191219
@@ -1302,12 +1302,12 @@ static int mes_v12_0_sw_fini(void *handle)
13021302 & adev -> gfx .kiq [0 ].ring .mqd_gpu_addr ,
13031303 & adev -> gfx .kiq [0 ].ring .mqd_ptr );
13041304
1305- amdgpu_bo_free_kernel (& adev -> mes .ring .mqd_obj ,
1306- & adev -> mes .ring .mqd_gpu_addr ,
1307- & adev -> mes .ring .mqd_ptr );
1305+ amdgpu_bo_free_kernel (& adev -> mes .ring [ 0 ] .mqd_obj ,
1306+ & adev -> mes .ring [ 0 ] .mqd_gpu_addr ,
1307+ & adev -> mes .ring [ 0 ] .mqd_ptr );
13081308
13091309 amdgpu_ring_fini (& adev -> gfx .kiq [0 ].ring );
1310- amdgpu_ring_fini (& adev -> mes .ring );
1310+ amdgpu_ring_fini (& adev -> mes .ring [ 0 ] );
13111311
13121312 if (adev -> firmware .load_type == AMDGPU_FW_LOAD_DIRECT ) {
13131313 mes_v12_0_free_ucode_buffers (adev , AMDGPU_MES_KIQ_PIPE );
@@ -1351,7 +1351,7 @@ static void mes_v12_0_kiq_dequeue_sched(struct amdgpu_device *adev)
13511351 soc21_grbm_select (adev , 0 , 0 , 0 , 0 );
13521352 mutex_unlock (& adev -> srbm_mutex );
13531353
1354- adev -> mes .ring .sched .ready = false;
1354+ adev -> mes .ring [ 0 ] .sched .ready = false;
13551355}
13561356
13571357static void mes_v12_0_kiq_setting (struct amdgpu_ring * ring )
@@ -1415,9 +1415,9 @@ static int mes_v12_0_kiq_hw_init(struct amdgpu_device *adev)
14151415
14161416static int mes_v12_0_kiq_hw_fini (struct amdgpu_device * adev )
14171417{
1418- if (adev -> mes .ring .sched .ready ) {
1418+ if (adev -> mes .ring [ 0 ] .sched .ready ) {
14191419 mes_v12_0_kiq_dequeue_sched (adev );
1420- adev -> mes .ring .sched .ready = false;
1420+ adev -> mes .ring [ 0 ] .sched .ready = false;
14211421 }
14221422
14231423 mes_v12_0_enable (adev , false);
@@ -1430,7 +1430,7 @@ static int mes_v12_0_hw_init(void *handle)
14301430 int r ;
14311431 struct amdgpu_device * adev = (struct amdgpu_device * )handle ;
14321432
1433- if (adev -> mes .ring .sched .ready )
1433+ if (adev -> mes .ring [ 0 ] .sched .ready )
14341434 goto out ;
14351435
14361436 if (!adev -> enable_mes_kiq || adev -> enable_uni_mes ) {
@@ -1482,7 +1482,7 @@ static int mes_v12_0_hw_init(void *handle)
14821482 * with MES enabled.
14831483 */
14841484 adev -> gfx .kiq [0 ].ring .sched .ready = false;
1485- adev -> mes .ring .sched .ready = true;
1485+ adev -> mes .ring [ 0 ] .sched .ready = true;
14861486
14871487 return 0 ;
14881488
0 commit comments