Commit 80e12f3e authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'amd-drm-fixes-6.15-2025-05-08' of...

Merge tag 'amd-drm-fixes-6.15-2025-05-08' of https://gitlab.freedesktop.org/agd5f/linux

 into drm-fixes

amd-drm-fixes-6.15-2025-05-08:

amdgpu:
- DC FP fixes
- Freesync fix
- DMUB AUX fixes
- VCN fix
- Hibernation fixes
- HDP fixes

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Alex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20250508194102.3242372-1-alexander.deucher@amd.com
parents 20a4c814 5a11a276
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1614,11 +1614,9 @@ static inline void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_cap
#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
void amdgpu_choose_low_power_state(struct amdgpu_device *adev);
#else
static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
static inline void amdgpu_choose_low_power_state(struct amdgpu_device *adev) { }
#endif

void amdgpu_register_gpu_instance(struct amdgpu_device *adev);
+0 −18
Original line number Diff line number Diff line
@@ -1533,22 +1533,4 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
#endif /* CONFIG_AMD_PMC */
}

/**
 * amdgpu_choose_low_power_state
 *
 * @adev: amdgpu_device_pointer
 *
 * Choose the target low power state for the GPU
 */
void amdgpu_choose_low_power_state(struct amdgpu_device *adev)
{
	if (adev->in_runpm)
		return;

	if (amdgpu_acpi_is_s0ix_active(adev))
		adev->in_s0ix = true;
	else if (amdgpu_acpi_is_s3_active(adev))
		adev->in_s3 = true;
}

#endif /* CONFIG_SUSPEND */
+7 −22
Original line number Diff line number Diff line
@@ -4907,28 +4907,20 @@ static int amdgpu_device_evict_resources(struct amdgpu_device *adev)
 * @data: data
 *
 * This function is called when the system is about to suspend or hibernate.
 * It is used to evict resources from the device before the system goes to
 * sleep while there is still access to swap.
 * It is used to set the appropriate flags so that eviction can be optimized
 * in the pm prepare callback.
 */
static int amdgpu_device_pm_notifier(struct notifier_block *nb, unsigned long mode,
				     void *data)
{
	struct amdgpu_device *adev = container_of(nb, struct amdgpu_device, pm_nb);
	int r;

	switch (mode) {
	case PM_HIBERNATION_PREPARE:
		adev->in_s4 = true;
		fallthrough;
	case PM_SUSPEND_PREPARE:
		r = amdgpu_device_evict_resources(adev);
		/*
		 * This is considered non-fatal at this time because
		 * amdgpu_device_prepare() will also fatally evict resources.
		 * See https://gitlab.freedesktop.org/drm/amd/-/issues/3781
		 */
		if (r)
			drm_warn(adev_to_drm(adev), "Failed to evict resources, freeze active processes if problems occur: %d\n", r);
		break;
	case PM_POST_HIBERNATION:
		adev->in_s4 = false;
		break;
	}

@@ -4949,15 +4941,13 @@ int amdgpu_device_prepare(struct drm_device *dev)
	struct amdgpu_device *adev = drm_to_adev(dev);
	int i, r;

	amdgpu_choose_low_power_state(adev);

	if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
		return 0;

	/* Evict the majority of BOs before starting suspend sequence */
	r = amdgpu_device_evict_resources(adev);
	if (r)
		goto unprepare;
		return r;

	flush_delayed_work(&adev->gfx.gfx_off_delay_work);

@@ -4968,15 +4958,10 @@ int amdgpu_device_prepare(struct drm_device *dev)
			continue;
		r = adev->ip_blocks[i].version->funcs->prepare_suspend(&adev->ip_blocks[i]);
		if (r)
			goto unprepare;
			return r;
	}

	return 0;

unprepare:
	adev->in_s0ix = adev->in_s3 = adev->in_s4 = false;

	return r;
}

/**
+1 −9
Original line number Diff line number Diff line
@@ -2615,13 +2615,8 @@ static int amdgpu_pmops_freeze(struct device *dev)
static int amdgpu_pmops_thaw(struct device *dev)
{
	struct drm_device *drm_dev = dev_get_drvdata(dev);
	struct amdgpu_device *adev = drm_to_adev(drm_dev);
	int r;

	r = amdgpu_device_resume(drm_dev, true);
	adev->in_s4 = false;

	return r;
	return amdgpu_device_resume(drm_dev, true);
}

static int amdgpu_pmops_poweroff(struct device *dev)
@@ -2634,9 +2629,6 @@ static int amdgpu_pmops_poweroff(struct device *dev)
static int amdgpu_pmops_restore(struct device *dev)
{
	struct drm_device *drm_dev = dev_get_drvdata(dev);
	struct amdgpu_device *adev = drm_to_adev(drm_dev);

	adev->in_s4 = false;

	return amdgpu_device_resume(drm_dev, true);
}
+0 −1
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@
#define VCN_ENC_CMD_REG_WAIT		0x0000000c

#define VCN_AON_SOC_ADDRESS_2_0 	0x1f800
#define VCN1_AON_SOC_ADDRESS_3_0 	0x48000
#define VCN_VID_IP_ADDRESS_2_0		0x0
#define VCN_AON_IP_ADDRESS_2_0		0x30000

Loading