aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-03-02 12:10:20 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-03-09 13:03:52 -0500
commitbedf2a65c1aa8fb29ba8527fd00c0f68ec1f55f1 (patch)
tree68527b30aad2184f325a4265498baaa0e7ff4a15 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parente64c952efb8e0c15ae82cec8e455ab4910690ef1 (diff)
drm/amdgpu: disable runtime pm on PX laptops without dGPU power control
Some PX laptops don't provide an ACPI method to control dGPU power. On those systems, the driver is responsible for handling the dGPU power state. Disable runtime PM on them until support for this is implemented. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index db20d2783def..462fec0ab594 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -62,6 +62,12 @@ static const char *amdgpu_asic_name[] = {
62 "LAST", 62 "LAST",
63}; 63};
64 64
65#if defined(CONFIG_VGA_SWITCHEROO)
66bool amdgpu_has_atpx_dgpu_power_cntl(void);
67#else
68static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; }
69#endif
70
65bool amdgpu_device_is_px(struct drm_device *dev) 71bool amdgpu_device_is_px(struct drm_device *dev)
66{ 72{
67 struct amdgpu_device *adev = dev->dev_private; 73 struct amdgpu_device *adev = dev->dev_private;
@@ -1479,7 +1485,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
1479 1485
1480 if (amdgpu_runtime_pm == 1) 1486 if (amdgpu_runtime_pm == 1)
1481 runtime = true; 1487 runtime = true;
1482 if (amdgpu_device_is_px(ddev)) 1488 if (amdgpu_device_is_px(ddev) && amdgpu_has_atpx_dgpu_power_cntl())
1483 runtime = true; 1489 runtime = true;
1484 vga_switcheroo_register_client(adev->pdev, &amdgpu_switcheroo_ops, runtime); 1490 vga_switcheroo_register_client(adev->pdev, &amdgpu_switcheroo_ops, runtime);
1485 if (runtime) 1491 if (runtime)