aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-10-31 10:41:49 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-10-31 11:49:29 -0400
commit066f1f0b4719eb4573ef09bfc63c2bbb6f7676ca (patch)
treeac2b85e78fbe216ffb323bd67acd56f4c24730cd /drivers/gpu
parent3b496626ee8f07919256a4e99cddf42ecd4ba891 (diff)
drm/radeon: disable runtime pm in certain cases
If the platform does not support hybrid graphics or ATPX dGPU power control. bug: https://bugzilla.kernel.org/show_bug.cgi?id=51381 Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index eb92aef46e3c..621af069a3d2 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -104,6 +104,14 @@ static const char radeon_family_name[][16] = {
104 "LAST", 104 "LAST",
105}; 105};
106 106
107#if defined(CONFIG_VGA_SWITCHEROO)
108bool radeon_has_atpx_dgpu_power_cntl(void);
109bool radeon_is_atpx_hybrid(void);
110#else
111static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; }
112static inline bool radeon_is_atpx_hybrid(void) { return false; }
113#endif
114
107#define RADEON_PX_QUIRK_DISABLE_PX (1 << 0) 115#define RADEON_PX_QUIRK_DISABLE_PX (1 << 0)
108#define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1) 116#define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1)
109 117
@@ -160,6 +168,11 @@ static void radeon_device_handle_px_quirks(struct radeon_device *rdev)
160 168
161 if (rdev->px_quirk_flags & RADEON_PX_QUIRK_DISABLE_PX) 169 if (rdev->px_quirk_flags & RADEON_PX_QUIRK_DISABLE_PX)
162 rdev->flags &= ~RADEON_IS_PX; 170 rdev->flags &= ~RADEON_IS_PX;
171
172 /* disable PX is the system doesn't support dGPU power control or hybrid gfx */
173 if (!radeon_is_atpx_hybrid() &&
174 !radeon_has_atpx_dgpu_power_cntl())
175 rdev->flags &= ~RADEON_IS_PX;
163} 176}
164 177
165/** 178/**