提交 a0eb38eb 编写于 作者: R Rafał Miłecki 提交者: Dave Airlie

drm/radeon/kms: get_power_state early, not when processing IRQ

Signed-off-by: NRafał Miłecki <zajec5@gmail.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 530079a8
...@@ -273,6 +273,7 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev) ...@@ -273,6 +273,7 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev)
rdev->pm.state = PM_STATE_PAUSED; rdev->pm.state = PM_STATE_PAUSED;
rdev->pm.planned_action = PM_ACTION_UPCLOCK; rdev->pm.planned_action = PM_ACTION_UPCLOCK;
radeon_get_power_state(rdev, rdev->pm.planned_action);
rdev->pm.vblank_callback = true; rdev->pm.vblank_callback = true;
mutex_unlock(&rdev->pm.mutex); mutex_unlock(&rdev->pm.mutex);
...@@ -292,6 +293,7 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev) ...@@ -292,6 +293,7 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev)
if (rdev->pm.state == PM_STATE_MINIMUM) { if (rdev->pm.state == PM_STATE_MINIMUM) {
rdev->pm.state = PM_STATE_ACTIVE; rdev->pm.state = PM_STATE_ACTIVE;
rdev->pm.planned_action = PM_ACTION_UPCLOCK; rdev->pm.planned_action = PM_ACTION_UPCLOCK;
radeon_get_power_state(rdev, rdev->pm.planned_action);
radeon_pm_set_clocks_locked(rdev); radeon_pm_set_clocks_locked(rdev);
queue_delayed_work(rdev->wq, &rdev->pm.idle_work, queue_delayed_work(rdev->wq, &rdev->pm.idle_work,
...@@ -312,6 +314,7 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev) ...@@ -312,6 +314,7 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev)
rdev->pm.state = PM_STATE_MINIMUM; rdev->pm.state = PM_STATE_MINIMUM;
rdev->pm.planned_action = PM_ACTION_MINIMUM; rdev->pm.planned_action = PM_ACTION_MINIMUM;
radeon_get_power_state(rdev, rdev->pm.planned_action);
radeon_pm_set_clocks_locked(rdev); radeon_pm_set_clocks_locked(rdev);
} }
...@@ -324,18 +327,14 @@ static void radeon_pm_set_clocks_locked(struct radeon_device *rdev) ...@@ -324,18 +327,14 @@ static void radeon_pm_set_clocks_locked(struct radeon_device *rdev)
/*radeon_fence_wait_last(rdev);*/ /*radeon_fence_wait_last(rdev);*/
switch (rdev->pm.planned_action) { switch (rdev->pm.planned_action) {
case PM_ACTION_UPCLOCK: case PM_ACTION_UPCLOCK:
radeon_get_power_state(rdev, PM_ACTION_UPCLOCK);
rdev->pm.downclocked = false; rdev->pm.downclocked = false;
break; break;
case PM_ACTION_DOWNCLOCK: case PM_ACTION_DOWNCLOCK:
radeon_get_power_state(rdev, PM_ACTION_DOWNCLOCK);
rdev->pm.downclocked = true; rdev->pm.downclocked = true;
break; break;
case PM_ACTION_MINIMUM: case PM_ACTION_MINIMUM:
radeon_get_power_state(rdev, PM_ACTION_MINIMUM);
break; break;
case PM_ACTION_NONE: case PM_ACTION_NONE:
radeon_get_power_state(rdev, PM_ACTION_NONE);
DRM_ERROR("%s: PM_ACTION_NONE\n", __func__); DRM_ERROR("%s: PM_ACTION_NONE\n", __func__);
break; break;
} }
...@@ -427,6 +426,7 @@ static void radeon_pm_idle_work_handler(struct work_struct *work) ...@@ -427,6 +426,7 @@ static void radeon_pm_idle_work_handler(struct work_struct *work)
rdev->pm.req_vblank |= (1 << 1); rdev->pm.req_vblank |= (1 << 1);
drm_vblank_get(rdev->ddev, 1); drm_vblank_get(rdev->ddev, 1);
} }
radeon_get_power_state(rdev, rdev->pm.planned_action);
rdev->pm.vblank_callback = true; rdev->pm.vblank_callback = true;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册