@@ -3410,19 +3410,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
3410
3410
/* doorbell bar mapping and doorbell index init*/
3411
3411
amdgpu_device_doorbell_init (adev );
3412
3412
3413
- /* if we have > 1 VGA cards, then disable the amdgpu VGA resources */
3414
- /* this will fail for cards that aren't VGA class devices, just
3415
- * ignore it */
3416
- if ((adev -> pdev -> class >> 8 ) == PCI_CLASS_DISPLAY_VGA )
3417
- vga_client_register (adev -> pdev , adev , NULL , amdgpu_device_vga_set_decode );
3418
-
3419
- if (amdgpu_device_supports_px (ddev )) {
3420
- px = true;
3421
- vga_switcheroo_register_client (adev -> pdev ,
3422
- & amdgpu_switcheroo_ops , px );
3423
- vga_switcheroo_init_domain_pm_ops (adev -> dev , & adev -> vga_pm_domain );
3424
- }
3425
-
3426
3413
if (amdgpu_emu_mode == 1 ) {
3427
3414
/* post the asic on emulation mode */
3428
3415
emu_soc_asic_init (adev );
@@ -3619,6 +3606,19 @@ int amdgpu_device_init(struct amdgpu_device *adev,
3619
3606
if (amdgpu_device_cache_pci_state (adev -> pdev ))
3620
3607
pci_restore_state (pdev );
3621
3608
3609
+ /* if we have > 1 VGA cards, then disable the amdgpu VGA resources */
3610
+ /* this will fail for cards that aren't VGA class devices, just
3611
+ * ignore it */
3612
+ if ((adev -> pdev -> class >> 8 ) == PCI_CLASS_DISPLAY_VGA )
3613
+ vga_client_register (adev -> pdev , adev , NULL , amdgpu_device_vga_set_decode );
3614
+
3615
+ if (amdgpu_device_supports_px (ddev )) {
3616
+ px = true;
3617
+ vga_switcheroo_register_client (adev -> pdev ,
3618
+ & amdgpu_switcheroo_ops , px );
3619
+ vga_switcheroo_init_domain_pm_ops (adev -> dev , & adev -> vga_pm_domain );
3620
+ }
3621
+
3622
3622
if (adev -> gmc .xgmi .pending_reset )
3623
3623
queue_delayed_work (system_wq , & mgpu_info .delayed_reset_work ,
3624
3624
msecs_to_jiffies (AMDGPU_RESUME_MS ));
@@ -3630,8 +3630,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
3630
3630
3631
3631
failed :
3632
3632
amdgpu_vf_error_trans_all (adev );
3633
- if (px )
3634
- vga_switcheroo_fini_domain_pm_ops (adev -> dev );
3635
3633
3636
3634
failed_unmap :
3637
3635
iounmap (adev -> rmmio );
0 commit comments