drm/amdgpu: Remove duplicated power source update
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 23 Aug 2018 03:46:13 +0000 (11:46 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Aug 2018 20:10:55 +0000 (15:10 -0500)
when ac/dc switch, driver will be notified by acpi event.
then the power source will be updated. so don't need to
get power source when set power state.

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>
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

index daa55fb06171c7bbcf1ff6412e69b7fc42ba4ec2..3e51e9c89f042218153343c34e7a17c51a7a2c81 100644 (file)
@@ -1933,14 +1933,6 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev)
                        amdgpu_fence_wait_empty(ring);
        }
 
-       mutex_lock(&adev->pm.mutex);
-       /* update battery/ac status */
-       if (power_supply_is_system_supplied() > 0)
-               adev->pm.ac_power = true;
-       else
-               adev->pm.ac_power = false;
-       mutex_unlock(&adev->pm.mutex);
-
        if (adev->powerplay.pp_funcs->dispatch_tasks) {
                if (!amdgpu_device_has_dc_support(adev)) {
                        mutex_lock(&adev->pm.mutex);