@@ -3410,19 +3410,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
34103410 /* doorbell bar mapping and doorbell index init*/
34113411 amdgpu_device_doorbell_init (adev );
34123412
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-
34263413 if (amdgpu_emu_mode == 1 ) {
34273414 /* post the asic on emulation mode */
34283415 emu_soc_asic_init (adev );
@@ -3619,6 +3606,19 @@ int amdgpu_device_init(struct amdgpu_device *adev,
36193606 if (amdgpu_device_cache_pci_state (adev -> pdev ))
36203607 pci_restore_state (pdev );
36213608
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+
36223622 if (adev -> gmc .xgmi .pending_reset )
36233623 queue_delayed_work (system_wq , & mgpu_info .delayed_reset_work ,
36243624 msecs_to_jiffies (AMDGPU_RESUME_MS ));
@@ -3630,8 +3630,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
36303630
36313631failed :
36323632 amdgpu_vf_error_trans_all (adev );
3633- if (px )
3634- vga_switcheroo_fini_domain_pm_ops (adev -> dev );
36353633
36363634failed_unmap :
36373635 iounmap (adev -> rmmio );
0 commit comments