Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4369a69e authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/radeon: add a dpm quirk list

Disable dpm on certain problematic boards rather than
disabling dpm for the entire chip family since most
boards work fine.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1386534
https://bugzilla.kernel.org/show_bug.cgi?id=83731



Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent 3a01fd36
Loading
Loading
Loading
Loading
+33 −0
Original line number Original line Diff line number Diff line
@@ -1287,8 +1287,39 @@ static int radeon_pm_init_dpm(struct radeon_device *rdev)
	return ret;
	return ret;
}
}


struct radeon_dpm_quirk {
	u32 chip_vendor;
	u32 chip_device;
	u32 subsys_vendor;
	u32 subsys_device;
};

/* cards with dpm stability problems */
static struct radeon_dpm_quirk radeon_dpm_quirk_list[] = {
	/* TURKS - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1386534 */
	{ PCI_VENDOR_ID_ATI, 0x6759, 0x1682, 0x3195 },
	/* TURKS - https://bugzilla.kernel.org/show_bug.cgi?id=83731 */
	{ PCI_VENDOR_ID_ATI, 0x6840, 0x1179, 0xfb81 },
	{ 0, 0, 0, 0 },
};

int radeon_pm_init(struct radeon_device *rdev)
int radeon_pm_init(struct radeon_device *rdev)
{
{
	struct radeon_dpm_quirk *p = radeon_dpm_quirk_list;
	bool disable_dpm = false;

	/* Apply dpm quirks */
	while (p && p->chip_device != 0) {
		if (rdev->pdev->vendor == p->chip_vendor &&
		    rdev->pdev->device == p->chip_device &&
		    rdev->pdev->subsystem_vendor == p->subsys_vendor &&
		    rdev->pdev->subsystem_device == p->subsys_device) {
			disable_dpm = true;
			break;
		}
		++p;
	}

	/* enable dpm on rv6xx+ */
	/* enable dpm on rv6xx+ */
	switch (rdev->family) {
	switch (rdev->family) {
	case CHIP_RV610:
	case CHIP_RV610:
@@ -1344,6 +1375,8 @@ int radeon_pm_init(struct radeon_device *rdev)
			 (!(rdev->flags & RADEON_IS_IGP)) &&
			 (!(rdev->flags & RADEON_IS_IGP)) &&
			 (!rdev->smc_fw))
			 (!rdev->smc_fw))
			rdev->pm.pm_method = PM_METHOD_PROFILE;
			rdev->pm.pm_method = PM_METHOD_PROFILE;
		else if (disable_dpm && (radeon_dpm == -1))
			rdev->pm.pm_method = PM_METHOD_PROFILE;
		else if (radeon_dpm == 0)
		else if (radeon_dpm == 0)
			rdev->pm.pm_method = PM_METHOD_PROFILE;
			rdev->pm.pm_method = PM_METHOD_PROFILE;
		else
		else