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 /include | |
| 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 'include')
| -rw-r--r-- | include/drm/gpu_scheduler.h | 42 | ||||
| -rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 16 | ||||
| -rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 28 | ||||
| -rw-r--r-- | include/uapi/drm/amdgpu_drm.h | 2 |
4 files changed, 75 insertions, 13 deletions
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 21c648b0b2a1..daec50f887b3 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h | |||
| @@ -50,7 +50,10 @@ enum drm_sched_priority { | |||
| 50 | * | 50 | * |
| 51 | * @list: used to append this struct to the list of entities in the | 51 | * @list: used to append this struct to the list of entities in the |
| 52 | * runqueue. | 52 | * runqueue. |
| 53 | * @rq: runqueue to which this entity belongs. | 53 | * @rq: runqueue on which this entity is currently scheduled. |
| 54 | * @rq_list: a list of run queues on which jobs from this entity can | ||
| 55 | * be scheduled | ||
| 56 | * @num_rq_list: number of run queues in the rq_list | ||
| 54 | * @rq_lock: lock to modify the runqueue to which this entity belongs. | 57 | * @rq_lock: lock to modify the runqueue to which this entity belongs. |
| 55 | * @job_queue: the list of jobs of this entity. | 58 | * @job_queue: the list of jobs of this entity. |
| 56 | * @fence_seq: a linearly increasing seqno incremented with each | 59 | * @fence_seq: a linearly increasing seqno incremented with each |
| @@ -67,6 +70,7 @@ enum drm_sched_priority { | |||
| 67 | * @fini_status: contains the exit status in case the process was signalled. | 70 | * @fini_status: contains the exit status in case the process was signalled. |
| 68 | * @last_scheduled: points to the finished fence of the last scheduled job. | 71 | * @last_scheduled: points to the finished fence of the last scheduled job. |
| 69 | * @last_user: last group leader pushing a job into the entity. | 72 | * @last_user: last group leader pushing a job into the entity. |
| 73 | * @stopped: Marks the enity as removed from rq and destined for termination. | ||
| 70 | * | 74 | * |
| 71 | * Entities will emit jobs in order to their corresponding hardware | 75 | * Entities will emit jobs in order to their corresponding hardware |
| 72 | * ring, and the scheduler will alternate between entities based on | 76 | * ring, and the scheduler will alternate between entities based on |
| @@ -75,6 +79,8 @@ enum drm_sched_priority { | |||
| 75 | struct drm_sched_entity { | 79 | struct drm_sched_entity { |
| 76 | struct list_head list; | 80 | struct list_head list; |
| 77 | struct drm_sched_rq *rq; | 81 | struct drm_sched_rq *rq; |
| 82 | struct drm_sched_rq **rq_list; | ||
| 83 | unsigned int num_rq_list; | ||
| 78 | spinlock_t rq_lock; | 84 | spinlock_t rq_lock; |
| 79 | 85 | ||
| 80 | struct spsc_queue job_queue; | 86 | struct spsc_queue job_queue; |
| @@ -87,6 +93,7 @@ struct drm_sched_entity { | |||
| 87 | atomic_t *guilty; | 93 | atomic_t *guilty; |
| 88 | struct dma_fence *last_scheduled; | 94 | struct dma_fence *last_scheduled; |
| 89 | struct task_struct *last_user; | 95 | struct task_struct *last_user; |
| 96 | bool stopped; | ||
| 90 | }; | 97 | }; |
| 91 | 98 | ||
| 92 | /** | 99 | /** |
| @@ -257,6 +264,7 @@ struct drm_sched_backend_ops { | |||
| 257 | * @job_list_lock: lock to protect the ring_mirror_list. | 264 | * @job_list_lock: lock to protect the ring_mirror_list. |
| 258 | * @hang_limit: once the hangs by a job crosses this limit then it is marked | 265 | * @hang_limit: once the hangs by a job crosses this limit then it is marked |
| 259 | * guilty and it will be considered for scheduling further. | 266 | * guilty and it will be considered for scheduling further. |
| 267 | * @num_jobs: the number of jobs in queue in the scheduler | ||
| 260 | * | 268 | * |
| 261 | * One scheduler is implemented for each hardware ring. | 269 | * One scheduler is implemented for each hardware ring. |
| 262 | */ | 270 | */ |
| @@ -274,6 +282,7 @@ struct drm_gpu_scheduler { | |||
| 274 | struct list_head ring_mirror_list; | 282 | struct list_head ring_mirror_list; |
| 275 | spinlock_t job_list_lock; | 283 | spinlock_t job_list_lock; |
| 276 | int hang_limit; | 284 | int hang_limit; |
| 285 | atomic_t num_jobs; | ||
| 277 | }; | 286 | }; |
| 278 | 287 | ||
| 279 | int drm_sched_init(struct drm_gpu_scheduler *sched, | 288 | int drm_sched_init(struct drm_gpu_scheduler *sched, |
| @@ -281,6 +290,21 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, | |||
| 281 | uint32_t hw_submission, unsigned hang_limit, long timeout, | 290 | uint32_t hw_submission, unsigned hang_limit, long timeout, |
| 282 | const char *name); | 291 | const char *name); |
| 283 | void drm_sched_fini(struct drm_gpu_scheduler *sched); | 292 | void drm_sched_fini(struct drm_gpu_scheduler *sched); |
| 293 | int drm_sched_job_init(struct drm_sched_job *job, | ||
| 294 | struct drm_sched_entity *entity, | ||
| 295 | void *owner); | ||
| 296 | void drm_sched_wakeup(struct drm_gpu_scheduler *sched); | ||
| 297 | void drm_sched_hw_job_reset(struct drm_gpu_scheduler *sched, | ||
| 298 | struct drm_sched_job *job); | ||
| 299 | void drm_sched_job_recovery(struct drm_gpu_scheduler *sched); | ||
| 300 | bool drm_sched_dependency_optimized(struct dma_fence* fence, | ||
| 301 | struct drm_sched_entity *entity); | ||
| 302 | void drm_sched_job_kickout(struct drm_sched_job *s_job); | ||
| 303 | |||
| 304 | void drm_sched_rq_add_entity(struct drm_sched_rq *rq, | ||
| 305 | struct drm_sched_entity *entity); | ||
| 306 | void drm_sched_rq_remove_entity(struct drm_sched_rq *rq, | ||
| 307 | struct drm_sched_entity *entity); | ||
| 284 | 308 | ||
| 285 | int drm_sched_entity_init(struct drm_sched_entity *entity, | 309 | int drm_sched_entity_init(struct drm_sched_entity *entity, |
| 286 | struct drm_sched_rq **rq_list, | 310 | struct drm_sched_rq **rq_list, |
| @@ -289,23 +313,17 @@ int drm_sched_entity_init(struct drm_sched_entity *entity, | |||
| 289 | long drm_sched_entity_flush(struct drm_sched_entity *entity, long timeout); | 313 | long drm_sched_entity_flush(struct drm_sched_entity *entity, long timeout); |
| 290 | void drm_sched_entity_fini(struct drm_sched_entity *entity); | 314 | void drm_sched_entity_fini(struct drm_sched_entity *entity); |
| 291 | void drm_sched_entity_destroy(struct drm_sched_entity *entity); | 315 | void drm_sched_entity_destroy(struct drm_sched_entity *entity); |
| 316 | void drm_sched_entity_select_rq(struct drm_sched_entity *entity); | ||
| 317 | struct drm_sched_job *drm_sched_entity_pop_job(struct drm_sched_entity *entity); | ||
| 292 | void drm_sched_entity_push_job(struct drm_sched_job *sched_job, | 318 | void drm_sched_entity_push_job(struct drm_sched_job *sched_job, |
| 293 | struct drm_sched_entity *entity); | 319 | struct drm_sched_entity *entity); |
| 294 | void drm_sched_entity_set_rq(struct drm_sched_entity *entity, | 320 | void drm_sched_entity_set_priority(struct drm_sched_entity *entity, |
| 295 | struct drm_sched_rq *rq); | 321 | enum drm_sched_priority priority); |
| 322 | bool drm_sched_entity_is_ready(struct drm_sched_entity *entity); | ||
| 296 | 323 | ||
| 297 | struct drm_sched_fence *drm_sched_fence_create( | 324 | struct drm_sched_fence *drm_sched_fence_create( |
| 298 | struct drm_sched_entity *s_entity, void *owner); | 325 | struct drm_sched_entity *s_entity, void *owner); |
| 299 | void drm_sched_fence_scheduled(struct drm_sched_fence *fence); | 326 | void drm_sched_fence_scheduled(struct drm_sched_fence *fence); |
| 300 | void drm_sched_fence_finished(struct drm_sched_fence *fence); | 327 | void drm_sched_fence_finished(struct drm_sched_fence *fence); |
| 301 | int drm_sched_job_init(struct drm_sched_job *job, | ||
| 302 | struct drm_sched_entity *entity, | ||
| 303 | void *owner); | ||
| 304 | void drm_sched_hw_job_reset(struct drm_gpu_scheduler *sched, | ||
| 305 | struct drm_sched_job *job); | ||
| 306 | void drm_sched_job_recovery(struct drm_gpu_scheduler *sched); | ||
| 307 | bool drm_sched_dependency_optimized(struct dma_fence* fence, | ||
| 308 | struct drm_sched_entity *entity); | ||
| 309 | void drm_sched_job_kickout(struct drm_sched_job *s_job); | ||
| 310 | 328 | ||
| 311 | #endif | 329 | #endif |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index a01ba2032f0e..8c19470785e2 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
| @@ -51,6 +51,8 @@ struct ttm_placement; | |||
| 51 | 51 | ||
| 52 | struct ttm_place; | 52 | struct ttm_place; |
| 53 | 53 | ||
| 54 | struct ttm_lru_bulk_move; | ||
| 55 | |||
| 54 | /** | 56 | /** |
| 55 | * struct ttm_bus_placement | 57 | * struct ttm_bus_placement |
| 56 | * | 58 | * |
| @@ -405,12 +407,24 @@ void ttm_bo_del_from_lru(struct ttm_buffer_object *bo); | |||
| 405 | * ttm_bo_move_to_lru_tail | 407 | * ttm_bo_move_to_lru_tail |
| 406 | * | 408 | * |
| 407 | * @bo: The buffer object. | 409 | * @bo: The buffer object. |
| 410 | * @bulk: optional bulk move structure to remember BO positions | ||
| 408 | * | 411 | * |
| 409 | * Move this BO to the tail of all lru lists used to lookup and reserve an | 412 | * Move this BO to the tail of all lru lists used to lookup and reserve an |
| 410 | * object. This function must be called with struct ttm_bo_global::lru_lock | 413 | * object. This function must be called with struct ttm_bo_global::lru_lock |
| 411 | * held, and is used to make a BO less likely to be considered for eviction. | 414 | * held, and is used to make a BO less likely to be considered for eviction. |
| 412 | */ | 415 | */ |
| 413 | void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo); | 416 | void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo, |
| 417 | struct ttm_lru_bulk_move *bulk); | ||
| 418 | |||
| 419 | /** | ||
| 420 | * ttm_bo_bulk_move_lru_tail | ||
| 421 | * | ||
| 422 | * @bulk: bulk move structure | ||
| 423 | * | ||
| 424 | * Bulk move BOs to the LRU tail, only valid to use when driver makes sure that | ||
| 425 | * BO order never changes. Should be called with ttm_bo_global::lru_lock held. | ||
| 426 | */ | ||
| 427 | void ttm_bo_bulk_move_lru_tail(struct ttm_lru_bulk_move *bulk); | ||
| 414 | 428 | ||
| 415 | /** | 429 | /** |
| 416 | * ttm_bo_lock_delayed_workqueue | 430 | * ttm_bo_lock_delayed_workqueue |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 3234cc322e70..e4fee8e02559 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
| @@ -491,6 +491,34 @@ struct ttm_bo_device { | |||
| 491 | }; | 491 | }; |
| 492 | 492 | ||
| 493 | /** | 493 | /** |
| 494 | * struct ttm_lru_bulk_move_pos | ||
| 495 | * | ||
| 496 | * @first: first BO in the bulk move range | ||
| 497 | * @last: last BO in the bulk move range | ||
| 498 | * | ||
| 499 | * Positions for a lru bulk move. | ||
| 500 | */ | ||
| 501 | struct ttm_lru_bulk_move_pos { | ||
| 502 | struct ttm_buffer_object *first; | ||
| 503 | struct ttm_buffer_object *last; | ||
| 504 | }; | ||
| 505 | |||
| 506 | /** | ||
| 507 | * struct ttm_lru_bulk_move | ||
| 508 | * | ||
| 509 | * @tt: first/last lru entry for BOs in the TT domain | ||
| 510 | * @vram: first/last lru entry for BOs in the VRAM domain | ||
| 511 | * @swap: first/last lru entry for BOs on the swap list | ||
| 512 | * | ||
| 513 | * Helper structure for bulk moves on the LRU list. | ||
| 514 | */ | ||
| 515 | struct ttm_lru_bulk_move { | ||
| 516 | struct ttm_lru_bulk_move_pos tt[TTM_MAX_BO_PRIORITY]; | ||
| 517 | struct ttm_lru_bulk_move_pos vram[TTM_MAX_BO_PRIORITY]; | ||
| 518 | struct ttm_lru_bulk_move_pos swap[TTM_MAX_BO_PRIORITY]; | ||
| 519 | }; | ||
| 520 | |||
| 521 | /** | ||
| 494 | * ttm_flag_masked | 522 | * ttm_flag_masked |
| 495 | * | 523 | * |
| 496 | * @old: Pointer to the result and original value. | 524 | * @old: Pointer to the result and original value. |
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h index 1ceec56de015..370e9a5536ef 100644 --- a/include/uapi/drm/amdgpu_drm.h +++ b/include/uapi/drm/amdgpu_drm.h | |||
| @@ -665,6 +665,8 @@ struct drm_amdgpu_cs_chunk_data { | |||
| 665 | #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_GPM_MEM 0x10 | 665 | #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_GPM_MEM 0x10 |
| 666 | /* Subquery id: Query GFX RLC SRLS firmware version */ | 666 | /* Subquery id: Query GFX RLC SRLS firmware version */ |
| 667 | #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_SRM_MEM 0x11 | 667 | #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_SRM_MEM 0x11 |
| 668 | /* Subquery id: Query DMCU firmware version */ | ||
| 669 | #define AMDGPU_INFO_FW_DMCU 0x12 | ||
| 668 | /* number of bytes moved for TTM migration */ | 670 | /* number of bytes moved for TTM migration */ |
| 669 | #define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f | 671 | #define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f |
| 670 | /* the used VRAM size */ | 672 | /* the used VRAM size */ |
