diff options
author | Dave Airlie <airlied@redhat.com> | 2016-03-17 17:16:25 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-03-17 17:16:25 -0400 |
commit | 902d02db1ff1b0d0075276917a36ba70847798a7 (patch) | |
tree | 2dbd296578edf17b7abd5d2ecde1b1f2f1eb5e10 /drivers/gpu/drm/amd/amdgpu/amdgpu.h | |
parent | e6087877794520748f7295212a4c6bdb870122f2 (diff) | |
parent | b9c743b85dc378510ef0e5ebe3c2e4ac1495c410 (diff) |
Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next
A few other misc cleanups and bug fixes for 4.6. Highlights:
- unify endian handling in powerplay
- powerplay fixes
- fix a regression in 4.5 on boards with no display connectors
- fence cleanups and locking fixes
- whitespace cleanups and code refactoring in radeon
* 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux: (35 commits)
drm/amdgpu/gfx7: add MTYPE definition
drm/amdgpu: removing BO_VAs shouldn't be interruptible
drm/amd/powerplay: show uvd/vce power gate enablement for tonga.
drm/amd/powerplay: show uvd/vce power gate info for fiji
drm/amdgpu: use sched fence if possible
drm/amdgpu: move ib.fence to job.fence
drm/amdgpu: give a fence param to ib_free
drm/amdgpu: include the right version of gmc header files for iceland
drm/radeon: fix indentation.
drm/amd/powerplay: add uvd/vce dpm enabling flag to fix the performance issue for CZ
drm/amdgpu: switch back to 32bit hw fences v2
drm/amdgpu: remove amdgpu_fence_is_signaled
drm/amdgpu: drop the extra fence range check v2
drm/amdgpu: signal fences directly in amdgpu_fence_process
drm/amdgpu: cleanup amdgpu_fence_wait_empty v2
drm/amdgpu: keep all fences in an RCU protected array v2
drm/amdgpu: add number of hardware submissions to amdgpu_fence_driver_init_ring
drm/amdgpu: RCU protected amd_sched_fence_release
drm/amdgpu: RCU protected amdgpu_fence_release
drm/amdgpu: merge amdgpu_fence_process and _activity
...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 47 |
1 files changed, 13 insertions, 34 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index a80c8cea7609..c4a21c6428f5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -141,7 +141,6 @@ extern unsigned amdgpu_pcie_lane_cap; | |||
141 | #define CIK_CURSOR_HEIGHT 128 | 141 | #define CIK_CURSOR_HEIGHT 128 |
142 | 142 | ||
143 | struct amdgpu_device; | 143 | struct amdgpu_device; |
144 | struct amdgpu_fence; | ||
145 | struct amdgpu_ib; | 144 | struct amdgpu_ib; |
146 | struct amdgpu_vm; | 145 | struct amdgpu_vm; |
147 | struct amdgpu_ring; | 146 | struct amdgpu_ring; |
@@ -348,13 +347,15 @@ struct amdgpu_fence_driver { | |||
348 | uint64_t gpu_addr; | 347 | uint64_t gpu_addr; |
349 | volatile uint32_t *cpu_addr; | 348 | volatile uint32_t *cpu_addr; |
350 | /* sync_seq is protected by ring emission lock */ | 349 | /* sync_seq is protected by ring emission lock */ |
351 | uint64_t sync_seq; | 350 | uint32_t sync_seq; |
352 | atomic64_t last_seq; | 351 | atomic_t last_seq; |
353 | bool initialized; | 352 | bool initialized; |
354 | struct amdgpu_irq_src *irq_src; | 353 | struct amdgpu_irq_src *irq_src; |
355 | unsigned irq_type; | 354 | unsigned irq_type; |
356 | struct timer_list fallback_timer; | 355 | struct timer_list fallback_timer; |
357 | wait_queue_head_t fence_queue; | 356 | unsigned num_fences_mask; |
357 | spinlock_t lock; | ||
358 | struct fence **fences; | ||
358 | }; | 359 | }; |
359 | 360 | ||
360 | /* some special values for the owner field */ | 361 | /* some special values for the owner field */ |
@@ -364,16 +365,6 @@ struct amdgpu_fence_driver { | |||
364 | #define AMDGPU_FENCE_FLAG_64BIT (1 << 0) | 365 | #define AMDGPU_FENCE_FLAG_64BIT (1 << 0) |
365 | #define AMDGPU_FENCE_FLAG_INT (1 << 1) | 366 | #define AMDGPU_FENCE_FLAG_INT (1 << 1) |
366 | 367 | ||
367 | struct amdgpu_fence { | ||
368 | struct fence base; | ||
369 | |||
370 | /* RB, DMA, etc. */ | ||
371 | struct amdgpu_ring *ring; | ||
372 | uint64_t seq; | ||
373 | |||
374 | wait_queue_t fence_wake; | ||
375 | }; | ||
376 | |||
377 | struct amdgpu_user_fence { | 368 | struct amdgpu_user_fence { |
378 | /* write-back bo */ | 369 | /* write-back bo */ |
379 | struct amdgpu_bo *bo; | 370 | struct amdgpu_bo *bo; |
@@ -385,7 +376,8 @@ int amdgpu_fence_driver_init(struct amdgpu_device *adev); | |||
385 | void amdgpu_fence_driver_fini(struct amdgpu_device *adev); | 376 | void amdgpu_fence_driver_fini(struct amdgpu_device *adev); |
386 | void amdgpu_fence_driver_force_completion(struct amdgpu_device *adev); | 377 | void amdgpu_fence_driver_force_completion(struct amdgpu_device *adev); |
387 | 378 | ||
388 | int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring); | 379 | int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, |
380 | unsigned num_hw_submission); | ||
389 | int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring, | 381 | int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring, |
390 | struct amdgpu_irq_src *irq_src, | 382 | struct amdgpu_irq_src *irq_src, |
391 | unsigned irq_type); | 383 | unsigned irq_type); |
@@ -393,7 +385,6 @@ void amdgpu_fence_driver_suspend(struct amdgpu_device *adev); | |||
393 | void amdgpu_fence_driver_resume(struct amdgpu_device *adev); | 385 | void amdgpu_fence_driver_resume(struct amdgpu_device *adev); |
394 | int amdgpu_fence_emit(struct amdgpu_ring *ring, struct fence **fence); | 386 | int amdgpu_fence_emit(struct amdgpu_ring *ring, struct fence **fence); |
395 | void amdgpu_fence_process(struct amdgpu_ring *ring); | 387 | void amdgpu_fence_process(struct amdgpu_ring *ring); |
396 | int amdgpu_fence_wait_next(struct amdgpu_ring *ring); | ||
397 | int amdgpu_fence_wait_empty(struct amdgpu_ring *ring); | 388 | int amdgpu_fence_wait_empty(struct amdgpu_ring *ring); |
398 | unsigned amdgpu_fence_count_emitted(struct amdgpu_ring *ring); | 389 | unsigned amdgpu_fence_count_emitted(struct amdgpu_ring *ring); |
399 | 390 | ||
@@ -539,11 +530,14 @@ int amdgpu_gem_debugfs_init(struct amdgpu_device *adev); | |||
539 | * Assumption is that there won't be hole (all object on same | 530 | * Assumption is that there won't be hole (all object on same |
540 | * alignment). | 531 | * alignment). |
541 | */ | 532 | */ |
533 | |||
534 | #define AMDGPU_SA_NUM_FENCE_LISTS 32 | ||
535 | |||
542 | struct amdgpu_sa_manager { | 536 | struct amdgpu_sa_manager { |
543 | wait_queue_head_t wq; | 537 | wait_queue_head_t wq; |
544 | struct amdgpu_bo *bo; | 538 | struct amdgpu_bo *bo; |
545 | struct list_head *hole; | 539 | struct list_head *hole; |
546 | struct list_head flist[AMDGPU_MAX_RINGS]; | 540 | struct list_head flist[AMDGPU_SA_NUM_FENCE_LISTS]; |
547 | struct list_head olist; | 541 | struct list_head olist; |
548 | unsigned size; | 542 | unsigned size; |
549 | uint64_t gpu_addr; | 543 | uint64_t gpu_addr; |
@@ -727,7 +721,6 @@ struct amdgpu_ib { | |||
727 | uint32_t length_dw; | 721 | uint32_t length_dw; |
728 | uint64_t gpu_addr; | 722 | uint64_t gpu_addr; |
729 | uint32_t *ptr; | 723 | uint32_t *ptr; |
730 | struct fence *fence; | ||
731 | struct amdgpu_user_fence *user; | 724 | struct amdgpu_user_fence *user; |
732 | struct amdgpu_vm *vm; | 725 | struct amdgpu_vm *vm; |
733 | unsigned vm_id; | 726 | unsigned vm_id; |
@@ -1143,7 +1136,7 @@ struct amdgpu_gfx { | |||
1143 | 1136 | ||
1144 | int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, | 1137 | int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, |
1145 | unsigned size, struct amdgpu_ib *ib); | 1138 | unsigned size, struct amdgpu_ib *ib); |
1146 | void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib); | 1139 | void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib, struct fence *f); |
1147 | int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, | 1140 | int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, |
1148 | struct amdgpu_ib *ib, struct fence *last_vm_update, | 1141 | struct amdgpu_ib *ib, struct fence *last_vm_update, |
1149 | struct fence **f); | 1142 | struct fence **f); |
@@ -1164,7 +1157,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, | |||
1164 | struct amdgpu_irq_src *irq_src, unsigned irq_type, | 1157 | struct amdgpu_irq_src *irq_src, unsigned irq_type, |
1165 | enum amdgpu_ring_type ring_type); | 1158 | enum amdgpu_ring_type ring_type); |
1166 | void amdgpu_ring_fini(struct amdgpu_ring *ring); | 1159 | void amdgpu_ring_fini(struct amdgpu_ring *ring); |
1167 | struct amdgpu_ring *amdgpu_ring_from_fence(struct fence *f); | ||
1168 | 1160 | ||
1169 | /* | 1161 | /* |
1170 | * CS. | 1162 | * CS. |
@@ -1206,6 +1198,7 @@ struct amdgpu_job { | |||
1206 | struct amdgpu_ring *ring; | 1198 | struct amdgpu_ring *ring; |
1207 | struct amdgpu_sync sync; | 1199 | struct amdgpu_sync sync; |
1208 | struct amdgpu_ib *ibs; | 1200 | struct amdgpu_ib *ibs; |
1201 | struct fence *fence; /* the hw fence */ | ||
1209 | uint32_t num_ibs; | 1202 | uint32_t num_ibs; |
1210 | void *owner; | 1203 | void *owner; |
1211 | struct amdgpu_user_fence uf; | 1204 | struct amdgpu_user_fence uf; |
@@ -2067,20 +2060,6 @@ u32 amdgpu_mm_rdoorbell(struct amdgpu_device *adev, u32 index); | |||
2067 | void amdgpu_mm_wdoorbell(struct amdgpu_device *adev, u32 index, u32 v); | 2060 | void amdgpu_mm_wdoorbell(struct amdgpu_device *adev, u32 index, u32 v); |
2068 | 2061 | ||
2069 | /* | 2062 | /* |
2070 | * Cast helper | ||
2071 | */ | ||
2072 | extern const struct fence_ops amdgpu_fence_ops; | ||
2073 | static inline struct amdgpu_fence *to_amdgpu_fence(struct fence *f) | ||
2074 | { | ||
2075 | struct amdgpu_fence *__f = container_of(f, struct amdgpu_fence, base); | ||
2076 | |||
2077 | if (__f->base.ops == &amdgpu_fence_ops) | ||
2078 | return __f; | ||
2079 | |||
2080 | return NULL; | ||
2081 | } | ||
2082 | |||
2083 | /* | ||
2084 | * Registers read & write functions. | 2063 | * Registers read & write functions. |
2085 | */ | 2064 | */ |
2086 | #define RREG32(reg) amdgpu_mm_rreg(adev, (reg), false) | 2065 | #define RREG32(reg) amdgpu_mm_rreg(adev, (reg), false) |