File tree Expand file tree Collapse file tree 2 files changed +23
-26
lines changed
drivers/gpu/drm/amd/amdgpu Expand file tree Collapse file tree 2 files changed +23
-26
lines changed Original file line number Diff line number Diff line change @@ -509,6 +509,16 @@ int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev, int xcc_id)
509
509
int i , r = 0 ;
510
510
int j ;
511
511
512
+ if (adev -> enable_mes ) {
513
+ for (i = 0 ; i < adev -> gfx .num_compute_rings ; i ++ ) {
514
+ j = i + xcc_id * adev -> gfx .num_compute_rings ;
515
+ amdgpu_mes_unmap_legacy_queue (adev ,
516
+ & adev -> gfx .compute_ring [j ],
517
+ RESET_QUEUES , 0 , 0 );
518
+ }
519
+ return 0 ;
520
+ }
521
+
512
522
if (!kiq -> pmf || !kiq -> pmf -> kiq_unmap_queues )
513
523
return - EINVAL ;
514
524
@@ -551,6 +561,18 @@ int amdgpu_gfx_disable_kgq(struct amdgpu_device *adev, int xcc_id)
551
561
int i , r = 0 ;
552
562
int j ;
553
563
564
+ if (adev -> enable_mes ) {
565
+ if (amdgpu_gfx_is_master_xcc (adev , xcc_id )) {
566
+ for (i = 0 ; i < adev -> gfx .num_gfx_rings ; i ++ ) {
567
+ j = i + xcc_id * adev -> gfx .num_gfx_rings ;
568
+ amdgpu_mes_unmap_legacy_queue (adev ,
569
+ & adev -> gfx .gfx_ring [j ],
570
+ PREEMPT_QUEUES , 0 , 0 );
571
+ }
572
+ }
573
+ return 0 ;
574
+ }
575
+
554
576
if (!kiq -> pmf || !kiq -> pmf -> kiq_unmap_queues )
555
577
return - EINVAL ;
556
578
Original file line number Diff line number Diff line change @@ -3546,42 +3546,17 @@ static int gfx_v12_0_hw_init(void *handle)
3546
3546
return r ;
3547
3547
}
3548
3548
3549
- static int gfx_v12_0_kiq_disable_kgq (struct amdgpu_device * adev )
3550
- {
3551
- struct amdgpu_kiq * kiq = & adev -> gfx .kiq [0 ];
3552
- struct amdgpu_ring * kiq_ring = & kiq -> ring ;
3553
- int i , r = 0 ;
3554
-
3555
- if (!kiq -> pmf || !kiq -> pmf -> kiq_unmap_queues )
3556
- return - EINVAL ;
3557
-
3558
- if (amdgpu_ring_alloc (kiq_ring , kiq -> pmf -> unmap_queues_size *
3559
- adev -> gfx .num_gfx_rings ))
3560
- return - ENOMEM ;
3561
-
3562
- for (i = 0 ; i < adev -> gfx .num_gfx_rings ; i ++ )
3563
- kiq -> pmf -> kiq_unmap_queues (kiq_ring , & adev -> gfx .gfx_ring [i ],
3564
- PREEMPT_QUEUES , 0 , 0 );
3565
-
3566
- if (adev -> gfx .kiq [0 ].ring .sched .ready )
3567
- r = amdgpu_ring_test_helper (kiq_ring );
3568
-
3569
- return r ;
3570
- }
3571
-
3572
3549
static int gfx_v12_0_hw_fini (void * handle )
3573
3550
{
3574
3551
struct amdgpu_device * adev = (struct amdgpu_device * )handle ;
3575
- int r ;
3576
3552
uint32_t tmp ;
3577
3553
3578
3554
amdgpu_irq_put (adev , & adev -> gfx .priv_reg_irq , 0 );
3579
3555
amdgpu_irq_put (adev , & adev -> gfx .priv_inst_irq , 0 );
3580
3556
3581
3557
if (!adev -> no_hw_access ) {
3582
3558
if (amdgpu_async_gfx_ring ) {
3583
- r = gfx_v12_0_kiq_disable_kgq (adev );
3584
- if (r )
3559
+ if (amdgpu_gfx_disable_kgq (adev , 0 ))
3585
3560
DRM_ERROR ("KGQ disable failed\n" );
3586
3561
}
3587
3562
You can’t perform that action at this time.
0 commit comments