summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-06-04 18:26:18 +0800
committerAlex Deucher <alexander.deucher@amd.com>2018-06-15 12:20:46 -0500
commitb1ddf5484727296f8812118a6042c76ebd1faff4 (patch)
tree573569d8d55f4c0b4e7f9f4deb970839176a177c /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parente1e36485e9f398be7207630d866810df485fbf34 (diff)
downloadop-kernel-dev-b1ddf5484727296f8812118a6042c76ebd1faff4.zip
op-kernel-dev-b1ddf5484727296f8812118a6042c76ebd1faff4.tar.gz
drm/amdgpu: Get real power source to initizlize ac_power
driver need to know the real power source to do some power related configuration when initialize. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 3317d15..fe76ec1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -25,6 +25,7 @@
* Alex Deucher
* Jerome Glisse
*/
+#include <linux/power_supply.h>
#include <linux/kthread.h>
#include <linux/console.h>
#include <linux/slab.h>
@@ -2293,6 +2294,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
INIT_DELAYED_WORK(&adev->late_init_work,
amdgpu_device_ip_late_init_func_handler);
+ adev->pm.ac_power = power_supply_is_system_supplied() > 0 ? true : false;
+
/* Registers mapping */
/* TODO: block userspace mapping of io register */
if (adev->asic_type >= CHIP_BONAIRE) {
OpenPOWER on IntegriCloud