diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 38 | 
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index d5f78179b2b6..fd8cd8e2d3f2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -41,6 +41,7 @@  #include <drm/drm_fb_helper.h>  #include <drm/drm_probe_helper.h>  #include <drm/amdgpu_drm.h> +#include <linux/device.h>  #include <linux/vgaarb.h>  #include <linux/vga_switcheroo.h>  #include <linux/efi.h> @@ -1073,6 +1074,8 @@ static int amdgpu_device_asic_init(struct amdgpu_device *adev)  	    amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(11, 0, 0)) {  		amdgpu_psp_wait_for_bootloader(adev);  		ret = amdgpu_atomfirmware_asic_init(adev, true); +		/* TODO: check the return val and stop device initialization if boot fails */ +		amdgpu_psp_query_boot_status(adev);  		return ret;  	} else {  		return amdgpu_atom_asic_init(adev->mode_info.atom_context); @@ -2223,7 +2226,6 @@ out:   */  static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)  { -	struct drm_device *dev = adev_to_drm(adev);  	struct pci_dev *parent;  	int i, r;  	bool total; @@ -2294,7 +2296,7 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)  	    (amdgpu_is_atpx_hybrid() ||  	     amdgpu_has_atpx_dgpu_power_cntl()) &&  	    ((adev->flags & AMD_IS_APU) == 0) && -	    !pci_is_thunderbolt_attached(to_pci_dev(dev->dev))) +	    !dev_is_removable(&adev->pdev->dev))  		adev->flags |= AMD_IS_PX;  	if (!(adev->flags & AMD_IS_APU)) { @@ -3962,13 +3964,23 @@ int amdgpu_device_init(struct amdgpu_device *adev,  				}  			}  		} else { -			tmp = amdgpu_reset_method; -			/* It should do a default reset when loading or reloading the driver, -			 * regardless of the module parameter reset_method. -			 */ -			amdgpu_reset_method = AMD_RESET_METHOD_NONE; -			r = amdgpu_asic_reset(adev); -			amdgpu_reset_method = tmp; +			switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) { +			case IP_VERSION(13, 0, 0): +			case IP_VERSION(13, 0, 7): +			case IP_VERSION(13, 0, 10): +				r = psp_gpu_reset(adev); +				break; +			default: +				tmp = amdgpu_reset_method; +				/* It should do a default reset when loading or reloading the driver, +				 * regardless of the module parameter reset_method. +				 */ +				amdgpu_reset_method = AMD_RESET_METHOD_NONE; +				r = amdgpu_asic_reset(adev); +				amdgpu_reset_method = tmp; +				break; +			} +  			if (r) {  				dev_err(adev->dev, "asic reset on init failed\n");  				goto failed; @@ -4132,7 +4144,7 @@ fence_driver_init:  	px = amdgpu_device_supports_px(ddev); -	if (px || (!pci_is_thunderbolt_attached(adev->pdev) && +	if (px || (!dev_is_removable(&adev->pdev->dev) &&  				apple_gmux_detect(NULL, NULL)))  		vga_switcheroo_register_client(adev->pdev,  					       &amdgpu_switcheroo_ops, px); @@ -4282,7 +4294,7 @@ void amdgpu_device_fini_sw(struct amdgpu_device *adev)  	px = amdgpu_device_supports_px(adev_to_drm(adev)); -	if (px || (!pci_is_thunderbolt_attached(adev->pdev) && +	if (px || (!dev_is_removable(&adev->pdev->dev) &&  				apple_gmux_detect(NULL, NULL)))  		vga_switcheroo_unregister_client(adev->pdev); @@ -5566,10 +5578,6 @@ skip_hw_reset:  			drm_sched_start(&ring->sched, true);  		} -		if (adev->enable_mes && -		    amdgpu_ip_version(adev, GC_HWIP, 0) != IP_VERSION(11, 0, 3)) -			amdgpu_mes_self_test(tmp_adev); -  		if (!drm_drv_uses_atomic_modeset(adev_to_drm(tmp_adev)) && !job_signaled)  			drm_helper_resume_force_mode(adev_to_drm(tmp_adev));  | 
