Skip to content

Commit

Permalink
drm/radeon: Update IH_RB_RPTR register after each processed interrupt
Browse files Browse the repository at this point in the history
This might decrease the chance of IH ring buffer overflows.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Michel Dänzer authored and Alex Deucher committed Sep 22, 2014
1 parent 6cc2fda commit f55e03b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/cik.c
Original file line number Diff line number Diff line change
Expand Up @@ -8251,6 +8251,7 @@ int cik_irq_process(struct radeon_device *rdev)
/* wptr/rptr are in bytes! */
rptr += 16;
rptr &= rdev->ih.ptr_mask;
WREG32(IH_RB_RPTR, rptr);
}
if (queue_hotplug)
schedule_work(&rdev->hotplug_work);
Expand All @@ -8259,7 +8260,6 @@ int cik_irq_process(struct radeon_device *rdev)
if (queue_thermal)
schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rdev->ih.rptr);
atomic_set(&rdev->ih.lock, 0);

/* make sure wptr hasn't changed while processing */
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/evergreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -5137,6 +5137,7 @@ int evergreen_irq_process(struct radeon_device *rdev)
/* wptr/rptr are in bytes! */
rptr += 16;
rptr &= rdev->ih.ptr_mask;
WREG32(IH_RB_RPTR, rptr);
}
if (queue_hotplug)
schedule_work(&rdev->hotplug_work);
Expand All @@ -5145,7 +5146,6 @@ int evergreen_irq_process(struct radeon_device *rdev)
if (queue_thermal && rdev->pm.dpm_enabled)
schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rdev->ih.rptr);
atomic_set(&rdev->ih.lock, 0);

/* make sure wptr hasn't changed while processing */
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/r600.c
Original file line number Diff line number Diff line change
Expand Up @@ -4048,6 +4048,7 @@ int r600_irq_process(struct radeon_device *rdev)
/* wptr/rptr are in bytes! */
rptr += 16;
rptr &= rdev->ih.ptr_mask;
WREG32(IH_RB_RPTR, rptr);
}
if (queue_hotplug)
schedule_work(&rdev->hotplug_work);
Expand All @@ -4056,7 +4057,6 @@ int r600_irq_process(struct radeon_device *rdev)
if (queue_thermal && rdev->pm.dpm_enabled)
schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rdev->ih.rptr);
atomic_set(&rdev->ih.lock, 0);

/* make sure wptr hasn't changed while processing */
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/si.c
Original file line number Diff line number Diff line change
Expand Up @@ -6664,13 +6664,13 @@ int si_irq_process(struct radeon_device *rdev)
/* wptr/rptr are in bytes! */
rptr += 16;
rptr &= rdev->ih.ptr_mask;
WREG32(IH_RB_RPTR, rptr);
}
if (queue_hotplug)
schedule_work(&rdev->hotplug_work);
if (queue_thermal && rdev->pm.dpm_enabled)
schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rdev->ih.rptr);
atomic_set(&rdev->ih.lock, 0);

/* make sure wptr hasn't changed while processing */
Expand Down

0 comments on commit f55e03b

Please sign in to comment.