diff options
| author | Dave Airlie <airlied@redhat.com> | 2018-09-20 19:52:34 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2018-09-20 19:52:53 -0400 |
| commit | 36c9c3c91128e2b892c9be0dd9ee9bd82cbe82ad (patch) | |
| tree | 687db2e37b7fdcb4bd756a078812d049da18c804 /drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | |
| parent | 0320ac5188eab5c6e8b92b110d1eae967ac272d2 (diff) | |
| parent | 846311ae68f3c78365ebf3dff505c99e7da861cf (diff) | |
Merge branch 'drm-next-4.20' of git://people.freedesktop.org/~agd5f/linux into drm-next
This is a new pull for drm-next on top of last weeks with the following
changes:
- Fixed 64 bit divide
- Fixed vram type on vega20
- Misc vega20 fixes
- Misc DC fixes
- Fix GDS/GWS/OA domain handling
Previous changes from last week:
amdgpu/kfd:
- Picasso (new APU) support
- Raven2 (new APU) support
- Vega20 enablement
- ACP powergating improvements
- Add ABGR/XBGR display support
- VCN JPEG engine support
- Initial xGMI support
- Use load balancing for engine scheduling
- Lots of new documentation
- Rework and clean up i2c and aux handling in DC
- Add DP YCbCr 4:2:0 support in DC
- Add DMCU firmware loading for Raven (used for ABM and PSR)
- New debugfs features in DC
- LVDS support in DC
- Implement wave kill for gfx/compute (light weight reset for shaders)
- Use AGP aperture to avoid gart mappings when possible
- GPUVM performance improvements
- Bulk moves for more efficient GPUVM LRU handling
- Merge amdgpu and amdkfd into one module
- Enable gfxoff and stutter mode on Raven
- Misc cleanups
Scheduler:
- Load balancing support
- Bug fixes
ttm:
- Bulk move functionality
- Bug fixes
radeon:
- Misc cleanups
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180920150438.12693-1-alexander.deucher@amd.com
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 58 |
1 files changed, 1 insertions, 57 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index 7056925eb386..176f28777f5e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | |||
| @@ -196,19 +196,6 @@ int amdgpu_fence_emit_polling(struct amdgpu_ring *ring, uint32_t *s) | |||
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | /** | 198 | /** |
| 199 | * amdgpu_fence_schedule_fallback - schedule fallback check | ||
| 200 | * | ||
| 201 | * @ring: pointer to struct amdgpu_ring | ||
| 202 | * | ||
| 203 | * Start a timer as fallback to our interrupts. | ||
| 204 | */ | ||
| 205 | static void amdgpu_fence_schedule_fallback(struct amdgpu_ring *ring) | ||
| 206 | { | ||
| 207 | mod_timer(&ring->fence_drv.fallback_timer, | ||
| 208 | jiffies + AMDGPU_FENCE_JIFFIES_TIMEOUT); | ||
| 209 | } | ||
| 210 | |||
| 211 | /** | ||
| 212 | * amdgpu_fence_process - check for fence activity | 199 | * amdgpu_fence_process - check for fence activity |
| 213 | * | 200 | * |
| 214 | * @ring: pointer to struct amdgpu_ring | 201 | * @ring: pointer to struct amdgpu_ring |
| @@ -229,9 +216,6 @@ void amdgpu_fence_process(struct amdgpu_ring *ring) | |||
| 229 | 216 | ||
| 230 | } while (atomic_cmpxchg(&drv->last_seq, last_seq, seq) != last_seq); | 217 | } while (atomic_cmpxchg(&drv->last_seq, last_seq, seq) != last_seq); |
| 231 | 218 | ||
| 232 | if (seq != ring->fence_drv.sync_seq) | ||
| 233 | amdgpu_fence_schedule_fallback(ring); | ||
| 234 | |||
| 235 | if (unlikely(seq == last_seq)) | 219 | if (unlikely(seq == last_seq)) |
| 236 | return; | 220 | return; |
| 237 | 221 | ||
| @@ -263,21 +247,6 @@ void amdgpu_fence_process(struct amdgpu_ring *ring) | |||
| 263 | } | 247 | } |
| 264 | 248 | ||
| 265 | /** | 249 | /** |
| 266 | * amdgpu_fence_fallback - fallback for hardware interrupts | ||
| 267 | * | ||
| 268 | * @work: delayed work item | ||
| 269 | * | ||
| 270 | * Checks for fence activity. | ||
| 271 | */ | ||
| 272 | static void amdgpu_fence_fallback(struct timer_list *t) | ||
| 273 | { | ||
| 274 | struct amdgpu_ring *ring = from_timer(ring, t, | ||
| 275 | fence_drv.fallback_timer); | ||
| 276 | |||
| 277 | amdgpu_fence_process(ring); | ||
| 278 | } | ||
| 279 | |||
| 280 | /** | ||
| 281 | * amdgpu_fence_wait_empty - wait for all fences to signal | 250 | * amdgpu_fence_wait_empty - wait for all fences to signal |
| 282 | * | 251 | * |
| 283 | * @adev: amdgpu device pointer | 252 | * @adev: amdgpu device pointer |
| @@ -424,8 +393,6 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, | |||
| 424 | atomic_set(&ring->fence_drv.last_seq, 0); | 393 | atomic_set(&ring->fence_drv.last_seq, 0); |
| 425 | ring->fence_drv.initialized = false; | 394 | ring->fence_drv.initialized = false; |
| 426 | 395 | ||
| 427 | timer_setup(&ring->fence_drv.fallback_timer, amdgpu_fence_fallback, 0); | ||
| 428 | |||
| 429 | ring->fence_drv.num_fences_mask = num_hw_submission * 2 - 1; | 396 | ring->fence_drv.num_fences_mask = num_hw_submission * 2 - 1; |
| 430 | spin_lock_init(&ring->fence_drv.lock); | 397 | spin_lock_init(&ring->fence_drv.lock); |
| 431 | ring->fence_drv.fences = kcalloc(num_hw_submission * 2, sizeof(void *), | 398 | ring->fence_drv.fences = kcalloc(num_hw_submission * 2, sizeof(void *), |
| @@ -501,7 +468,6 @@ void amdgpu_fence_driver_fini(struct amdgpu_device *adev) | |||
| 501 | amdgpu_irq_put(adev, ring->fence_drv.irq_src, | 468 | amdgpu_irq_put(adev, ring->fence_drv.irq_src, |
| 502 | ring->fence_drv.irq_type); | 469 | ring->fence_drv.irq_type); |
| 503 | drm_sched_fini(&ring->sched); | 470 | drm_sched_fini(&ring->sched); |
| 504 | del_timer_sync(&ring->fence_drv.fallback_timer); | ||
| 505 | for (j = 0; j <= ring->fence_drv.num_fences_mask; ++j) | 471 | for (j = 0; j <= ring->fence_drv.num_fences_mask; ++j) |
| 506 | dma_fence_put(ring->fence_drv.fences[j]); | 472 | dma_fence_put(ring->fence_drv.fences[j]); |
| 507 | kfree(ring->fence_drv.fences); | 473 | kfree(ring->fence_drv.fences); |
| @@ -595,27 +561,6 @@ static const char *amdgpu_fence_get_timeline_name(struct dma_fence *f) | |||
| 595 | } | 561 | } |
| 596 | 562 | ||
| 597 | /** | 563 | /** |
| 598 | * amdgpu_fence_enable_signaling - enable signalling on fence | ||
| 599 | * @fence: fence | ||
| 600 | * | ||
| 601 | * This function is called with fence_queue lock held, and adds a callback | ||
| 602 | * to fence_queue that checks if this fence is signaled, and if so it | ||
| 603 | * signals the fence and removes itself. | ||
| 604 | */ | ||
| 605 | static bool amdgpu_fence_enable_signaling(struct dma_fence *f) | ||
| 606 | { | ||
| 607 | struct amdgpu_fence *fence = to_amdgpu_fence(f); | ||
| 608 | struct amdgpu_ring *ring = fence->ring; | ||
| 609 | |||
| 610 | if (!timer_pending(&ring->fence_drv.fallback_timer)) | ||
| 611 | amdgpu_fence_schedule_fallback(ring); | ||
| 612 | |||
| 613 | DMA_FENCE_TRACE(&fence->base, "armed on ring %i!\n", ring->idx); | ||
| 614 | |||
| 615 | return true; | ||
| 616 | } | ||
| 617 | |||
| 618 | /** | ||
| 619 | * amdgpu_fence_free - free up the fence memory | 564 | * amdgpu_fence_free - free up the fence memory |
| 620 | * | 565 | * |
| 621 | * @rcu: RCU callback head | 566 | * @rcu: RCU callback head |
| @@ -645,7 +590,6 @@ static void amdgpu_fence_release(struct dma_fence *f) | |||
| 645 | static const struct dma_fence_ops amdgpu_fence_ops = { | 590 | static const struct dma_fence_ops amdgpu_fence_ops = { |
| 646 | .get_driver_name = amdgpu_fence_get_driver_name, | 591 | .get_driver_name = amdgpu_fence_get_driver_name, |
| 647 | .get_timeline_name = amdgpu_fence_get_timeline_name, | 592 | .get_timeline_name = amdgpu_fence_get_timeline_name, |
| 648 | .enable_signaling = amdgpu_fence_enable_signaling, | ||
| 649 | .release = amdgpu_fence_release, | 593 | .release = amdgpu_fence_release, |
| 650 | }; | 594 | }; |
| 651 | 595 | ||
| @@ -701,7 +645,7 @@ static int amdgpu_debugfs_gpu_recover(struct seq_file *m, void *data) | |||
| 701 | struct amdgpu_device *adev = dev->dev_private; | 645 | struct amdgpu_device *adev = dev->dev_private; |
| 702 | 646 | ||
| 703 | seq_printf(m, "gpu recover\n"); | 647 | seq_printf(m, "gpu recover\n"); |
| 704 | amdgpu_device_gpu_recover(adev, NULL, true); | 648 | amdgpu_device_gpu_recover(adev, NULL); |
| 705 | 649 | ||
| 706 | return 0; | 650 | return 0; |
| 707 | } | 651 | } |
