Commit 980a2ff2 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'amd-drm-fixes-6.1-2022-11-02' of...

Merge tag 'amd-drm-fixes-6.1-2022-11-02' of https://gitlab.freedesktop.org/agd5f/linux

 into drm-fixes

amd-drm-fixes-6.1-2022-11-02:

amdgpu:
- DCN 3.1.4 fixes
- DCN 3.2.x fixes
- GC 11.x fixes
- Virtual display fix
- Fail suspend if resources can't be evicted
- SR-IOV fix
- Display PSR fix

amdkfd:
- Fix possible NULL pointer deref
- GC 11.x trap handler fix

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221103023257.10446-1-alexander.deucher@amd.com
parents c941ffc3 6640f8e5
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -706,6 +706,13 @@ int amdgpu_amdkfd_submit_ib(struct amdgpu_device *adev,


void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
{
{
	/* Temporary workaround to fix issues observed in some
	 * compute applications when GFXOFF is enabled on GFX11.
	 */
	if (IP_VERSION_MAJ(adev->ip_versions[GC_HWIP][0]) == 11) {
		pr_debug("GFXOFF is %s\n", idle ? "enabled" : "disabled");
		amdgpu_gfx_off_ctrl(adev, idle);
	}
	amdgpu_dpm_switch_power_profile(adev,
	amdgpu_dpm_switch_power_profile(adev,
					PP_SMC_POWER_PROFILE_COMPUTE,
					PP_SMC_POWER_PROFILE_COMPUTE,
					!idle);
					!idle);
+10 −5
Original line number Original line Diff line number Diff line
@@ -4060,15 +4060,18 @@ void amdgpu_device_fini_sw(struct amdgpu_device *adev)
 * at suspend time.
 * at suspend time.
 *
 *
 */
 */
static void amdgpu_device_evict_resources(struct amdgpu_device *adev)
static int amdgpu_device_evict_resources(struct amdgpu_device *adev)
{
{
	int ret;

	/* No need to evict vram on APUs for suspend to ram or s2idle */
	/* No need to evict vram on APUs for suspend to ram or s2idle */
	if ((adev->in_s3 || adev->in_s0ix) && (adev->flags & AMD_IS_APU))
	if ((adev->in_s3 || adev->in_s0ix) && (adev->flags & AMD_IS_APU))
		return;
		return 0;


	if (amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM))
	ret = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);
	if (ret)
		DRM_WARN("evicting device resources failed\n");
		DRM_WARN("evicting device resources failed\n");

	return ret;
}
}


/*
/*
@@ -4118,7 +4121,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
	if (!adev->in_s0ix)
	if (!adev->in_s0ix)
		amdgpu_amdkfd_suspend(adev, adev->in_runpm);
		amdgpu_amdkfd_suspend(adev, adev->in_runpm);


	amdgpu_device_evict_resources(adev);
	r = amdgpu_device_evict_resources(adev);
	if (r)
		return r;


	amdgpu_fence_driver_hw_fini(adev);
	amdgpu_fence_driver_hw_fini(adev);


+2 −1
Original line number Original line Diff line number Diff line
@@ -2201,7 +2201,8 @@ amdgpu_pci_remove(struct pci_dev *pdev)
		pm_runtime_forbid(dev->dev);
		pm_runtime_forbid(dev->dev);
	}
	}


	if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 2)) {
	if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 2) &&
	    !amdgpu_sriov_vf(adev)) {
		bool need_to_reset_gpu = false;
		bool need_to_reset_gpu = false;


		if (adev->gmc.xgmi.num_physical_nodes > 1) {
		if (adev->gmc.xgmi.num_physical_nodes > 1) {
+6 −4
Original line number Original line Diff line number Diff line
@@ -337,12 +337,14 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info,
		fw_info->feature = adev->psp.cap_feature_version;
		fw_info->feature = adev->psp.cap_feature_version;
		break;
		break;
	case AMDGPU_INFO_FW_MES_KIQ:
	case AMDGPU_INFO_FW_MES_KIQ:
		fw_info->ver = adev->mes.ucode_fw_version[0];
		fw_info->ver = adev->mes.kiq_version & AMDGPU_MES_VERSION_MASK;
		fw_info->feature = 0;
		fw_info->feature = (adev->mes.kiq_version & AMDGPU_MES_FEAT_VERSION_MASK)
					>> AMDGPU_MES_FEAT_VERSION_SHIFT;
		break;
		break;
	case AMDGPU_INFO_FW_MES:
	case AMDGPU_INFO_FW_MES:
		fw_info->ver = adev->mes.ucode_fw_version[1];
		fw_info->ver = adev->mes.sched_version & AMDGPU_MES_VERSION_MASK;
		fw_info->feature = 0;
		fw_info->feature = (adev->mes.sched_version & AMDGPU_MES_FEAT_VERSION_MASK)
					>> AMDGPU_MES_FEAT_VERSION_SHIFT;
		break;
		break;
	case AMDGPU_INFO_FW_IMU:
	case AMDGPU_INFO_FW_IMU:
		fw_info->ver = adev->gfx.imu_fw_version;
		fw_info->ver = adev->gfx.imu_fw_version;
+2 −0
Original line number Original line Diff line number Diff line
@@ -500,6 +500,8 @@ static int amdgpu_vkms_sw_init(void *handle)


	adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
	adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;


	adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;

	r = amdgpu_display_modeset_create_props(adev);
	r = amdgpu_display_modeset_create_props(adev);
	if (r)
	if (r)
		return r;
		return r;
Loading