summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_pm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2011-08-25 13:39:48 -0400
committerDave Airlie <airlied@redhat.com>2011-12-20 19:49:28 +0000
commit7465280c076d6440e5908c158c83b542dc063a30 (patch)
tree7781cffcc3784293e5bb97f20fb4a6c8109684ec /drivers/gpu/drm/radeon/radeon_pm.c
parent851a6bd99edda0094def3b0b81bb1c7c0e886e65 (diff)
drm/radeon/kms: add support for multiple fence queues v2
For supporting multiple CP ring buffers, async DMA engines and UVD. We still need a way to synchronize between engines. v2 initialize unused fence driver ring to avoid issue in suspend/unload Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_pm.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 1fb84676afe..19ed2c6c424 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -271,7 +271,7 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
if (rdev->cp.ready) {
struct radeon_fence *fence;
radeon_ring_alloc(rdev, 64);
- radeon_fence_create(rdev, &fence);
+ radeon_fence_create(rdev, &fence, RADEON_RING_TYPE_GFX_INDEX);
radeon_fence_emit(rdev, fence);
radeon_ring_commit(rdev);
radeon_fence_wait(fence, false);
@@ -797,17 +797,25 @@ static void radeon_dynpm_idle_work_handler(struct work_struct *work)
if (rdev->pm.dynpm_state == DYNPM_STATE_ACTIVE) {
unsigned long irq_flags;
int not_processed = 0;
-
- read_lock_irqsave(&rdev->fence_drv.lock, irq_flags);
- if (!list_empty(&rdev->fence_drv.emitted)) {
- struct list_head *ptr;
- list_for_each(ptr, &rdev->fence_drv.emitted) {
- /* count up to 3, that's enought info */
- if (++not_processed >= 3)
- break;
+ int i;
+
+ read_lock_irqsave(&rdev->fence_lock, irq_flags);
+ for (i = 0; i < RADEON_NUM_RINGS; ++i) {
+ if (!rdev->fence_drv[i].initialized)
+ continue;
+
+ if (!list_empty(&rdev->fence_drv[i].emitted)) {
+ struct list_head *ptr;
+ list_for_each(ptr, &rdev->fence_drv[i].emitted) {
+ /* count up to 3, that's enought info */
+ if (++not_processed >= 3)
+ break;
+ }
}
+ if (not_processed >= 3)
+ break;
}
- read_unlock_irqrestore(&rdev->fence_drv.lock, irq_flags);
+ read_unlock_irqrestore(&rdev->fence_lock, irq_flags);
if (not_processed >= 3) { /* should upclock */
if (rdev->pm.dynpm_planned_action == DYNPM_ACTION_DOWNCLOCK) {