drm/scheduler: provide scheduler score externally
Subsystems (8)
Christian König
reviewerPATCH 1/3 drm/scheduler: provide scheduler score externally
Allow multiple schedulers to share the load balancing score.
This is useful when one engine has different hw rings.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_sched.c | 2 +- drivers/gpu/drm/lima/lima_sched.c | 2 +- drivers/gpu/drm/panfrost/panfrost_job.c | 2 +- drivers/gpu/drm/scheduler/sched_entity.c | 2 +- drivers/gpu/drm/scheduler/sched_main.c | 18 +++++++++--------- drivers/gpu/drm/v3d/v3d_sched.c | 10 +++++----- include/drm/gpu_scheduler.h | 5 +++-- 8 files changed, 22 insertions(+), 21 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +1 -1
@@ -487,7 +487,7 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, r =drm_sched_init (&ring->sched, &amdgpu_sched_ops, num_hw_submission, amdgpu_job_hang_limit, - timeout, ring->name); + timeout,NULL , ring->name);if (r) {DRM_ERROR ("Failed to create scheduler on ring %s.\n" , ring->name);
drivers/gpu/drm/etnaviv/etnaviv_sched.c +1 -1
@@ -185,7 +185,7 @@ int etnaviv_sched_init(struct etnaviv_gpu *gpu) ret =drm_sched_init (&gpu->sched, &etnaviv_sched_ops, etnaviv_hw_jobs_limit, etnaviv_job_hang_limit, -msecs_to_jiffies (500 ),dev_name (gpu->dev)); +msecs_to_jiffies (500 ),NULL ,dev_name (gpu->dev));if (ret)return ret;
drivers/gpu/drm/lima/lima_sched.c +1 -1
@@ -505,7 +505,7 @@ int lima_sched_pipe_init(struct lima_sched_pipe *pipe, const char *name)return drm_sched_init (&pipe->base, &lima_sched_ops,1 , lima_job_hang_limit,msecs_to_jiffies (timeout), - name); +NULL , name); }void lima_sched_pipe_fini (struct lima_sched_pipe *pipe)
drivers/gpu/drm/panfrost/panfrost_job.c +1 -1
@@ -520,7 +520,7 @@ int panfrost_job_init(struct panfrost_device *pfdev) ret =drm_sched_init (&js->queue[j].sched, &panfrost_sched_ops,1 ,0 ,msecs_to_jiffies (500 ), -"pan_js" ); +NULL ,"pan_js" );if (ret) {dev_err (pfdev->dev,"Failed to create scheduler: %d." , ret); goto err_sched;
drivers/gpu/drm/scheduler/sched_entity.c +1 -1
@@ -486,7 +486,7 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job,bool first;trace_drm_sched_job (sched_job, entity); -atomic_inc (&entity->rq->sched->score); +atomic_inc (entity->rq->sched->score);WRITE_ONCE (entity->last_user, current->group_leader); first =spsc_queue_push (&entity->job_queue, &sched_job->queue_node);
drivers/gpu/drm/scheduler/sched_main.c +9 -9
@@ -93,7 +93,7 @@ void drm_sched_rq_add_entity(struct drm_sched_rq *rq,if (!list_empty (&entity->list))return ;spin_lock (&rq->lock); -atomic_inc (&rq->sched->score); +atomic_inc (rq->sched->score);list_add_tail (&entity->list, &rq->entities);spin_unlock (&rq->lock); }
@@ -112,7 +112,7 @@ void drm_sched_rq_remove_entity(struct drm_sched_rq *rq,if (list_empty (&entity->list))return ;spin_lock (&rq->lock); -atomic_dec (&rq->sched->score); +atomic_dec (rq->sched->score);list_del_init (&entity->list);if (rq->current_entity == entity) rq->current_entity =NULL ;
@@ -650,7 +650,7 @@ static void drm_sched_process_job(struct dma_fence *f, struct dma_fence_cb *cb)struct drm_gpu_scheduler *sched = s_fence->sched;atomic_dec (&sched->hw_rq_count); -atomic_dec (&sched->score); +atomic_dec (sched->score);trace_drm_sched_process_job (s_fence);
@@ -726,7 +726,7 @@ drm_sched_pick_best(struct drm_gpu_scheduler **sched_list,continue ; } - num_score =atomic_read (&sched->score); + num_score =atomic_read (sched->score);if (num_score < min_score) { min_score = num_score; picked_sched = sched;
@@ -836,16 +836,15 @@ static int drm_sched_main(void *param)* @hw_submission: number of hw submissions that can be in flight * @hang_limit: number of times to allow a job to hang before dropping it * @timeout: timeout value in jiffies for the scheduler +* @score: optional score atomic shared with other schedulers * @name: name used for debugging * * Return 0 on success, otherwise error code. */ int drm_sched_init (struct drm_gpu_scheduler *sched,const struct drm_sched_backend_ops *ops, -unsigned hw_submission, -unsigned hang_limit, -long timeout, -const char *name) +unsigned hw_submission,unsigned hang_limit,long timeout, +atomic_t *score,const char *name) {int i, ret; sched->ops = ops;
@@ -853,6 +852,7 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, sched->name = name; sched->timeout = timeout; sched->hang_limit = hang_limit; + sched->score = score ? score : &sched->_score;for (i =DRM_SCHED_PRIORITY_MIN ; i <DRM_SCHED_PRIORITY_COUNT ; i++)drm_sched_rq_init (sched, &sched->sched_rq[i]);
@@ -862,7 +862,7 @@ int drm_sched_init(struct drm_gpu_scheduler *sched,spin_lock_init (&sched->job_list_lock);atomic_set (&sched->hw_rq_count,0 );INIT_DELAYED_WORK (&sched->work_tdr, drm_sched_job_timedout); -atomic_set (&sched->score,0 ); +atomic_set (&sched->_score,0 );atomic64_set (&sched->job_id_count,0 );/* Each scheduler will run on a seperate kernel thread */
drivers/gpu/drm/v3d/v3d_sched.c +5 -5
@@ -401,7 +401,7 @@ v3d_sched_init(struct v3d_dev *v3d) &v3d_bin_sched_ops, hw_jobs_limit, job_hang_limit,msecs_to_jiffies (hang_limit_ms), - "v3d_bin"); + NULL, "v3d_bin");if (ret) {dev_err (v3d->drm.dev,"Failed to create bin scheduler: %d." , ret);return ret;
@@ -411,7 +411,7 @@ v3d_sched_init(struct v3d_dev *v3d) &v3d_render_sched_ops, hw_jobs_limit, job_hang_limit,msecs_to_jiffies (hang_limit_ms), - "v3d_render"); + NULL, "v3d_render");if (ret) {dev_err (v3d->drm.dev,"Failed to create render scheduler: %d." , ret);
@@ -423,7 +423,7 @@ v3d_sched_init(struct v3d_dev *v3d) &v3d_tfu_sched_ops, hw_jobs_limit, job_hang_limit,msecs_to_jiffies (hang_limit_ms), - "v3d_tfu"); + NULL, "v3d_tfu");if (ret) {dev_err (v3d->drm.dev,"Failed to create TFU scheduler: %d." , ret);
@@ -436,7 +436,7 @@ v3d_sched_init(struct v3d_dev *v3d) &v3d_csd_sched_ops, hw_jobs_limit, job_hang_limit,msecs_to_jiffies (hang_limit_ms), - "v3d_csd"); + NULL, "v3d_csd");if (ret) {dev_err (v3d->drm.dev,"Failed to create CSD scheduler: %d." , ret);
@@ -448,7 +448,7 @@ v3d_sched_init(struct v3d_dev *v3d) &v3d_cache_clean_sched_ops, hw_jobs_limit, job_hang_limit,msecs_to_jiffies (hang_limit_ms), - "v3d_cache_clean"); + NULL, "v3d_cache_clean");if (ret) {dev_err (v3d->drm.dev,"Failed to create CACHE_CLEAN scheduler: %d." , ret);
include/drm/gpu_scheduler.h +3 -2
@@ -285,7 +285,8 @@ struct drm_gpu_scheduler {struct list_head ring_mirror_list;spinlock_t job_list_lock;int hang_limit; -atomic_t score; +atomic_t *score; +atomic_t _score;bool ready;bool free_guilty; };
@@ -293,7 +294,7 @@ struct drm_gpu_scheduler {int drm_sched_init (struct drm_gpu_scheduler *sched,const struct drm_sched_backend_ops *ops,uint32_t hw_submission,unsigned hang_limit,long timeout, -const char *name); +atomic_t *score,const char *name);void drm_sched_fini (struct drm_gpu_scheduler *sched); int drm_sched_job_init(struct drm_sched_job *job,
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
reviewerPATCH 2/3 drm/amdgpu: add the sched_score to amdgpu_ring_init
Allow separate ring to share the same scheduler score.
No functional change.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 50 ++++++++++++----------- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 5 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 6 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 6 ++- drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 5 +-- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 9 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 4 +- drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 4 +- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 6 +-- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 9 ++-- drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 3 +- drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 8 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 8 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 +- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 8 ++-- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 5 +-- drivers/gpu/drm/amd/amdgpu/si_dma.c | 5 +-- drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 2 +- drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 2 +- drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 4 +- drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 4 +- drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 5 +-- drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 4 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 4 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 4 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 4 +- 33 files changed, 93 insertions(+), 99 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +26 -24
@@ -441,7 +441,8 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring,* Helper function for amdgpu_fence_driver_init(). */ int amdgpu_fence_driver_init_ring (struct amdgpu_ring *ring, -unsigned num_hw_submission) +unsigned num_hw_submission, +atomic_t *sched_score) {struct amdgpu_device *adev = ring->adev;long timeout;
@@ -469,30 +470,31 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,return -ENOMEM ;/* No need to setup the GPU scheduler for rings that don't need it */ -if (!ring->no_scheduler) { -switch (ring->funcs->type) { -case AMDGPU_RING_TYPE_GFX : - timeout = adev->gfx_timeout; -break ; -case AMDGPU_RING_TYPE_COMPUTE : - timeout = adev->compute_timeout; -break ; -case AMDGPU_RING_TYPE_SDMA : - timeout = adev->sdma_timeout; -break ; -default : - timeout = adev->video_timeout; -break ; - } +if (ring->no_scheduler) +return 0 ; - r =drm_sched_init (&ring->sched, &amdgpu_sched_ops, - num_hw_submission, amdgpu_job_hang_limit, - timeout,NULL , ring->name); -if (r) { -DRM_ERROR ("Failed to create scheduler on ring %s.\n" , - ring->name); -return r; - } +switch (ring->funcs->type) { +case AMDGPU_RING_TYPE_GFX : + timeout = adev->gfx_timeout; +break ; +case AMDGPU_RING_TYPE_COMPUTE : + timeout = adev->compute_timeout; +break ; +case AMDGPU_RING_TYPE_SDMA : + timeout = adev->sdma_timeout; +break ; +default : + timeout = adev->video_timeout; +break ; + } + + r =drm_sched_init (&ring->sched, &amdgpu_sched_ops, + num_hw_submission, amdgpu_job_hang_limit, + timeout, sched_score, ring->name); +if (r) { +DRM_ERROR ("Failed to create scheduler on ring %s.\n" , + ring->name); +return r; }return 0 ;
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +2 -3
@@ -310,9 +310,8 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev, ring->eop_gpu_addr = kiq->eop_gpu_addr; ring->no_scheduler = true;sprintf (ring->name,"kiq_%d.%d.%d" , ring->me, ring->pipe, ring->queue); - r =amdgpu_ring_init (adev, ring,1024 , - irq,AMDGPU_CP_KIQ_IRQ_DRIVER0 , -AMDGPU_RING_PRIO_DEFAULT ); + r =amdgpu_ring_init (adev, ring,1024 , irq,AMDGPU_CP_KIQ_IRQ_DRIVER0 , +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)dev_warn (adev->dev,"(%d) failed to init kiq ring\n" , r);
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +4 -2
@@ -164,7 +164,8 @@ void amdgpu_ring_undo(struct amdgpu_ring *ring)*/ int amdgpu_ring_init (struct amdgpu_device *adev,struct amdgpu_ring *ring,unsigned int max_dw,struct amdgpu_irq_src *irq_src, -unsigned int irq_type,unsigned int hw_prio) +unsigned int irq_type,unsigned int hw_prio, +atomic_t *sched_score) {int r;int sched_hw_submission = amdgpu_sched_hw_submission;
@@ -189,7 +190,8 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, ring->adev = adev; ring->idx = adev->num_rings++; adev->rings[ring->idx] = ring; - r =amdgpu_fence_driver_init_ring (ring, sched_hw_submission); + r =amdgpu_fence_driver_init_ring (ring, sched_hw_submission, + sched_score);if (r)return r; }
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +4 -2
@@ -111,7 +111,8 @@ void amdgpu_fence_driver_fini(struct amdgpu_device *adev);void amdgpu_fence_driver_force_completion (struct amdgpu_ring *ring);int amdgpu_fence_driver_init_ring (struct amdgpu_ring *ring, -unsigned num_hw_submission); +unsigned num_hw_submission, +atomic_t *sched_score);int amdgpu_fence_driver_start_ring (struct amdgpu_ring *ring,struct amdgpu_irq_src *irq_src,unsigned irq_type);
@@ -282,7 +283,8 @@ void amdgpu_ring_commit(struct amdgpu_ring *ring);void amdgpu_ring_undo (struct amdgpu_ring *ring);int amdgpu_ring_init (struct amdgpu_device *adev,struct amdgpu_ring *ring,unsigned int ring_size,struct amdgpu_irq_src *irq_src, -unsigned int irq_type,unsigned int prio); +unsigned int irq_type,unsigned int prio, +atomic_t *sched_score);void amdgpu_ring_fini (struct amdgpu_ring *ring); void amdgpu_ring_emit_reg_write_reg_wait_helper(struct amdgpu_ring *ring, uint32_t reg0, uint32_t val0,
drivers/gpu/drm/amd/amdgpu/cik_sdma.c +2 -3
@@ -984,10 +984,9 @@ static int cik_sdma_sw_init(void *handle)sprintf (ring->name,"sdma%d" , i); r =amdgpu_ring_init (adev, ring,1024 , &adev->sdma.trap_irq, - (i ==0 ) ? -AMDGPU_SDMA_IRQ_INSTANCE0 : + (i ==0 ) ?AMDGPU_SDMA_IRQ_INSTANCE0 :AMDGPU_SDMA_IRQ_INSTANCE1 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +4 -5
@@ -4458,9 +4458,8 @@ static int gfx_v10_0_gfx_ring_init(struct amdgpu_device *adev, int ring_id,sprintf (ring->name,"gfx_%d.%d.%d" , ring->me, ring->pipe, ring->queue); irq_type =AMDGPU_CP_IRQ_GFX_ME0_PIPE0_EOP + ring->pipe; - r =amdgpu_ring_init (adev, ring,1024 , - &adev->gfx.eop_irq, irq_type, -AMDGPU_RING_PRIO_DEFAULT ); + r =amdgpu_ring_init (adev, ring,1024 , &adev->gfx.eop_irq, irq_type, +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;return 0 ;
@@ -4494,8 +4493,8 @@ static int gfx_v10_0_compute_ring_init(struct amdgpu_device *adev, int ring_id, hw_prio =amdgpu_gfx_is_high_priority_compute_queue (adev, ring) ?AMDGPU_GFX_PIPE_PRIO_HIGH :AMDGPU_GFX_PIPE_PRIO_NORMAL ;/* type-2 packets are deprecated on MEC, use type-3 instead */ - r =amdgpu_ring_init (adev, ring,1024 , - &adev->gfx.eop_irq, irq_type, hw_prio); + r =amdgpu_ring_init (adev, ring,1024 , &adev->gfx.eop_irq, irq_type, + hw_prio,NULL );if (r)return r;
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +2 -2
@@ -3114,7 +3114,7 @@ static int gfx_v6_0_sw_init(void *handle) r =amdgpu_ring_init (adev, ring,1024 , &adev->gfx.eop_irq,AMDGPU_CP_IRQ_GFX_ME0_PIPE0_EOP , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
@@ -3137,7 +3137,7 @@ static int gfx_v6_0_sw_init(void *handle) irq_type =AMDGPU_CP_IRQ_COMPUTE_MEC1_PIPE0_EOP + ring->pipe; r =amdgpu_ring_init (adev, ring,1024 , &adev->gfx.eop_irq, irq_type, -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +2 -2
@@ -4438,7 +4438,7 @@ static int gfx_v7_0_compute_ring_init(struct amdgpu_device *adev, int ring_id,/* type-2 packets are deprecated on MEC, use type-3 instead */ r =amdgpu_ring_init (adev, ring,1024 , &adev->gfx.eop_irq, irq_type, -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
@@ -4512,7 +4512,7 @@ static int gfx_v7_0_sw_init(void *handle) r =amdgpu_ring_init (adev, ring,1024 , &adev->gfx.eop_irq,AMDGPU_CP_IRQ_GFX_ME0_PIPE0_EOP , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +3 -3
@@ -1927,8 +1927,8 @@ static int gfx_v8_0_compute_ring_init(struct amdgpu_device *adev, int ring_id, hw_prio =amdgpu_gfx_is_high_priority_compute_queue (adev, ring) ?AMDGPU_GFX_PIPE_PRIO_HIGH :AMDGPU_RING_PRIO_DEFAULT ;/* type-2 packets are deprecated on MEC, use type-3 instead */ - r =amdgpu_ring_init (adev, ring,1024 , - &adev->gfx.eop_irq, irq_type, hw_prio); + r =amdgpu_ring_init (adev, ring,1024 , &adev->gfx.eop_irq, irq_type, + hw_prio,NULL );if (r)return r;
@@ -2033,7 +2033,7 @@ static int gfx_v8_0_sw_init(void *handle) r =amdgpu_ring_init (adev, ring,1024 , &adev->gfx.eop_irq,AMDGPU_CP_IRQ_GFX_ME0_PIPE0_EOP , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +4 -5
@@ -2231,8 +2231,8 @@ static int gfx_v9_0_compute_ring_init(struct amdgpu_device *adev, int ring_id, hw_prio =amdgpu_gfx_is_high_priority_compute_queue (adev, ring) ?AMDGPU_GFX_PIPE_PRIO_HIGH :AMDGPU_GFX_PIPE_PRIO_NORMAL ;/* type-2 packets are deprecated on MEC, use type-3 instead */ -return amdgpu_ring_init (adev, ring,1024 , - &adev->gfx.eop_irq, irq_type, hw_prio); +return amdgpu_ring_init (adev, ring,1024 , &adev->gfx.eop_irq, irq_type, + hw_prio,NULL ); }static int gfx_v9_0_sw_init (void *handle)
@@ -2320,10 +2320,9 @@ static int gfx_v9_0_sw_init(void *handle)sprintf (ring->name,"gfx_%d" , i); ring->use_doorbell = true; ring->doorbell_index = adev->doorbell_index.gfx_ring0 <<1 ; - r =amdgpu_ring_init (adev, ring,1024 , - &adev->gfx.eop_irq, + r =amdgpu_ring_init (adev, ring,1024 , &adev->gfx.eop_irq,AMDGPU_CP_IRQ_GFX_ME0_PIPE0_EOP , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c +1 -1
@@ -487,7 +487,7 @@ int jpeg_v1_0_sw_init(void *handle) ring = &adev->jpeg.inst->ring_dec;sprintf (ring->name,"jpeg_dec" ); r =amdgpu_ring_init (adev, ring,512 , &adev->jpeg.inst->irq, -0 ,AMDGPU_RING_PRIO_DEFAULT ); +0 ,AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c +1 -1
@@ -108,7 +108,7 @@ static int jpeg_v2_0_sw_init(void *handle) ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 <<1 ) +1 ;sprintf (ring->name,"jpeg_dec" ); r =amdgpu_ring_init (adev, ring,512 , &adev->jpeg.inst->irq, -0 ,AMDGPU_RING_PRIO_DEFAULT ); +0 ,AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c +1 -1
@@ -115,7 +115,7 @@ static int jpeg_v2_5_sw_init(void *handle) ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 <<1 ) +1 +8 * i;sprintf (ring->name,"jpeg_dec_%d" , i); r =amdgpu_ring_init (adev, ring,512 , &adev->jpeg.inst[i].irq, -0 ,AMDGPU_RING_PRIO_DEFAULT ); +0 ,AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +1 -1
@@ -94,7 +94,7 @@ static int jpeg_v3_0_sw_init(void *handle) ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 <<1 ) +1 ;sprintf (ring->name,"jpeg_dec" ); r =amdgpu_ring_init (adev, ring,512 , &adev->jpeg.inst->irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c +2 -1
@@ -848,7 +848,8 @@ static int mes_v10_1_ring_init(struct amdgpu_device *adev) ring->no_scheduler = true;sprintf (ring->name,"mes_%d.%d.%d" , ring->me, ring->pipe, ring->queue); -return amdgpu_ring_init (adev, ring,1024 ,NULL ,0 ,AMDGPU_RING_PRIO_DEFAULT ); +return amdgpu_ring_init (adev, ring,1024 ,NULL ,0 , +AMDGPU_RING_PRIO_DEFAULT ,NULL ); }static int mes_v10_1_mqd_sw_init (struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c +3 -5
@@ -876,12 +876,10 @@ static int sdma_v2_4_sw_init(void *handle) ring->ring_obj =NULL ; ring->use_doorbell = false;sprintf (ring->name,"sdma%d" , i); - r =amdgpu_ring_init (adev, ring,1024 , - &adev->sdma.trap_irq, - (i ==0 ) ? -AMDGPU_SDMA_IRQ_INSTANCE0 : + r =amdgpu_ring_init (adev, ring,1024 , &adev->sdma.trap_irq, + (i ==0 ) ?AMDGPU_SDMA_IRQ_INSTANCE0 :AMDGPU_SDMA_IRQ_INSTANCE1 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +3 -5
@@ -1160,12 +1160,10 @@ static int sdma_v3_0_sw_init(void *handle) }sprintf (ring->name,"sdma%d" , i); - r =amdgpu_ring_init (adev, ring,1024 , - &adev->sdma.trap_irq, - (i ==0 ) ? -AMDGPU_SDMA_IRQ_INSTANCE0 : + r =amdgpu_ring_init (adev, ring,1024 , &adev->sdma.trap_irq, + (i ==0 ) ?AMDGPU_SDMA_IRQ_INSTANCE0 :AMDGPU_SDMA_IRQ_INSTANCE1 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +2 -2
@@ -1909,7 +1909,7 @@ static int sdma_v4_0_sw_init(void *handle)sprintf (ring->name,"sdma%d" , i); r =amdgpu_ring_init (adev, ring,1024 , &adev->sdma.trap_irq,AMDGPU_SDMA_IRQ_INSTANCE0 + i, -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
@@ -1928,7 +1928,7 @@ static int sdma_v4_0_sw_init(void *handle) r =amdgpu_ring_init (adev, ring,1024 , &adev->sdma.trap_irq,AMDGPU_SDMA_IRQ_INSTANCE0 + i, -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +3 -5
@@ -1273,12 +1273,10 @@ static int sdma_v5_0_sw_init(void *handle) : (adev->doorbell_index.sdma_engine[1] << 1); // get DWORD offsetsprintf (ring->name,"sdma%d" , i); - r =amdgpu_ring_init (adev, ring,1024 , - &adev->sdma.trap_irq, - (i ==0 ) ? -AMDGPU_SDMA_IRQ_INSTANCE0 : + r =amdgpu_ring_init (adev, ring,1024 , &adev->sdma.trap_irq, + (i ==0 ) ?AMDGPU_SDMA_IRQ_INSTANCE0 :AMDGPU_SDMA_IRQ_INSTANCE1 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +2 -3
@@ -1283,10 +1283,9 @@ static int sdma_v5_2_sw_init(void *handle) (adev->doorbell_index.sdma_engine[i] <<1 );//get DWORD offset sprintf (ring->name,"sdma%d" , i); - r =amdgpu_ring_init (adev, ring,1024 , - &adev->sdma.trap_irq, + r =amdgpu_ring_init (adev, ring,1024 , &adev->sdma.trap_irq,AMDGPU_SDMA_IRQ_INSTANCE0 + i, -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/si_dma.c +2 -3
@@ -507,10 +507,9 @@ static int si_dma_sw_init(void *handle)sprintf (ring->name,"sdma%d" , i); r =amdgpu_ring_init (adev, ring,1024 , &adev->sdma.trap_irq, - (i ==0 ) ? -AMDGPU_SDMA_IRQ_INSTANCE0 : + (i ==0 ) ?AMDGPU_SDMA_IRQ_INSTANCE0 :AMDGPU_SDMA_IRQ_INSTANCE1 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c +1 -1
@@ -562,7 +562,7 @@ static int uvd_v3_1_sw_init(void *handle) ring = &adev->uvd.inst->ring;sprintf (ring->name,"uvd" ); r =amdgpu_ring_init (adev, ring,512 , &adev->uvd.inst->irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +1 -1
@@ -119,7 +119,7 @@ static int uvd_v4_2_sw_init(void *handle) ring = &adev->uvd.inst->ring;sprintf (ring->name,"uvd" ); r =amdgpu_ring_init (adev, ring,512 , &adev->uvd.inst->irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c +1 -1
@@ -117,7 +117,7 @@ static int uvd_v5_0_sw_init(void *handle) ring = &adev->uvd.inst->ring;sprintf (ring->name,"uvd" ); r =amdgpu_ring_init (adev, ring,512 , &adev->uvd.inst->irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +2 -2
@@ -420,7 +420,7 @@ static int uvd_v6_0_sw_init(void *handle) ring = &adev->uvd.inst->ring;sprintf (ring->name,"uvd" ); r =amdgpu_ring_init (adev, ring,512 , &adev->uvd.inst->irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
@@ -434,7 +434,7 @@ static int uvd_v6_0_sw_init(void *handle)sprintf (ring->name,"uvd_enc%d" , i); r =amdgpu_ring_init (adev, ring,512 , &adev->uvd.inst->irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c +2 -2
@@ -454,7 +454,7 @@ static int uvd_v7_0_sw_init(void *handle)sprintf (ring->name,"uvd_%d" , ring->me); r =amdgpu_ring_init (adev, ring,512 , &adev->uvd.inst[j].irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
@@ -475,7 +475,7 @@ static int uvd_v7_0_sw_init(void *handle) } r =amdgpu_ring_init (adev, ring,512 , &adev->uvd.inst[j].irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c +2 -3
@@ -433,9 +433,8 @@ static int vce_v2_0_sw_init(void *handle)for (i =0 ; i < adev->vce.num_rings; i++) { ring = &adev->vce.ring[i];sprintf (ring->name,"vce%d" , i); - r =amdgpu_ring_init (adev, ring,512 , - &adev->vce.irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); + r =amdgpu_ring_init (adev, ring,512 , &adev->vce.irq,0 , +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +1 -1
@@ -443,7 +443,7 @@ static int vce_v3_0_sw_init(void *handle) ring = &adev->vce.ring[i];sprintf (ring->name,"vce%d" , i); r =amdgpu_ring_init (adev, ring,512 , &adev->vce.irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +1 -1
@@ -477,7 +477,7 @@ static int vce_v4_0_sw_init(void *handle) ring->doorbell_index = adev->doorbell_index.uvd_vce.vce_ring2_3 *2 +1 ; } r =amdgpu_ring_init (adev, ring,512 , &adev->vce.irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2 -2
@@ -129,7 +129,7 @@ static int vcn_v1_0_sw_init(void *handle) ring = &adev->vcn.inst->ring_dec;sprintf (ring->name,"vcn_dec" ); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst->irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
@@ -148,7 +148,7 @@ static int vcn_v1_0_sw_init(void *handle) ring = &adev->vcn.inst->ring_enc[i];sprintf (ring->name,"vcn_enc%d" , i); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst->irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +2 -2
@@ -136,7 +136,7 @@ static int vcn_v2_0_sw_init(void *handle)sprintf (ring->name,"vcn_dec" ); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst->irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
@@ -167,7 +167,7 @@ static int vcn_v2_0_sw_init(void *handle) ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 <<1 ) +1 + i;sprintf (ring->name,"vcn_enc%d" , i); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst->irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +2 -2
@@ -189,7 +189,7 @@ static int vcn_v2_5_sw_init(void *handle) (amdgpu_sriov_vf (adev) ?2 *j :8 *j);sprintf (ring->name,"vcn_dec_%d" , j); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst[j].irq, -0 ,AMDGPU_RING_PRIO_DEFAULT ); +0 ,AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
@@ -203,7 +203,7 @@ static int vcn_v2_5_sw_init(void *handle)sprintf (ring->name,"vcn_enc_%d.%d" , j, i); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst[j].irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2 -2
@@ -209,7 +209,7 @@ static int vcn_v3_0_sw_init(void *handle) ring->no_scheduler = true;sprintf (ring->name,"vcn_dec_%d" , i); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst[i].irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r;
@@ -231,7 +231,7 @@ static int vcn_v3_0_sw_init(void *handle) ring->no_scheduler = true;sprintf (ring->name,"vcn_enc_%d.%d" , i, j); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst[i].irq,0 , -AMDGPU_RING_PRIO_DEFAULT ); +AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)return r; }
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Christian König
reviewerPATCH 3/3 drm/amdgpu: share scheduler score on VCN3 instances
In reply to Christian KönigThe VCN3 instances can do both decode as well as encode.
Share the scheduler load balancing score and remove fixing encode to only the second instance.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1 -0
@@ -211,6 +211,7 @@ struct amdgpu_vcn_inst {void *saved_bo;struct amdgpu_ring ring_dec;struct amdgpu_ring ring_enc[AMDGPU_VCN_MAX_ENC_RINGS ]; +atomic_t sched_score;struct amdgpu_irq_src irq;struct amdgpu_vcn_reg external;struct amdgpu_bo *dpg_sram_bo;
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +7 -4
@@ -171,6 +171,7 @@ static int vcn_v3_0_sw_init(void *handle)for (i =0 ; i < adev->vcn.num_vcn_inst; i++) {volatile struct amdgpu_fw_shared *fw_shared; +if (adev->vcn.harvest_config & (1 << i))continue ;
@@ -198,6 +199,8 @@ static int vcn_v3_0_sw_init(void *handle)if (r)return r; +atomic_set (&adev->vcn.inst[i].sched_score,0 ); + ring = &adev->vcn.inst[i].ring_dec; ring->use_doorbell = true;if (amdgpu_sriov_vf (adev)) {
@@ -209,7 +212,8 @@ static int vcn_v3_0_sw_init(void *handle) ring->no_scheduler = true;sprintf (ring->name,"vcn_dec_%d" , i); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst[i].irq,0 , -AMDGPU_RING_PRIO_DEFAULT ,NULL ); +AMDGPU_RING_PRIO_DEFAULT , + &adev->vcn.inst[i].sched_score);if (r)return r;
@@ -227,11 +231,10 @@ static int vcn_v3_0_sw_init(void *handle) }else { ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 <<1 ) +2 + j +8 * i; } -if (adev->asic_type ==CHIP_SIENNA_CICHLID && i !=1 ) - ring->no_scheduler = true;sprintf (ring->name,"vcn_enc_%d.%d" , i, j); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst[i].irq,0 , -AMDGPU_RING_PRIO_DEFAULT ,NULL ); +AMDGPU_RING_PRIO_DEFAULT , + &adev->vcn.inst[i].sched_score);if (r)return r; }
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 3/3] drm/amdgpu: share scheduler score on VCN3 instances
The series are:
Quoted 58 lines · Christian König
The VCN3 instances can do both decode as well as encode.
Share the scheduler load balancing score and remove fixing encode to only the second instance.
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -211,6 +211,7 @@ struct amdgpu_vcn_inst {void *saved_bo;struct amdgpu_ring ring_dec;struct amdgpu_ring ring_enc[AMDGPU_VCN_MAX_ENC_RINGS ]; +atomic_t sched_score;struct amdgpu_irq_src irq;struct amdgpu_vcn_reg external;struct amdgpu_bo *dpg_sram_bo;drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +5
-1@@ -171,6 +171,7 @@ static int vcn_v3_0_sw_init(void *handle)for (i =0 ; i < adev->vcn.num_vcn_inst; i++) {volatile struct amdgpu_fw_shared *fw_shared; +if (adev->vcn.harvest_config & (1 << i))continue ;@@ -198,6 +199,8 @@ static int vcn_v3_0_sw_init(void *handle)if (r)return r; +atomic_set (&adev->vcn.inst[i].sched_score,0 ); + ring = &adev->vcn.inst[i].ring_dec; ring->use_doorbell = true;if (amdgpu_sriov_vf (adev)) {@@ -209,7 +212,8 @@ static int vcn_v3_0_sw_init(void *handle) ring->no_scheduler = true;sprintf (ring->name,"vcn_dec_%d" , i); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst[i].irq,0 , -AMDGPU_RING_PRIO_DEFAULT ,NULL ); +AMDGPU_RING_PRIO_DEFAULT , + &adev->vcn.inst[i].sched_score);if (r)return r;@@ -227,11 +231,10 @@ static int vcn_v3_0_sw_init(void *handle) }else { ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 <<1 ) +2 + j +8 * i; }
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c static int vcn_v3_0_sw_init(void *handle) · line 240
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2
-3-if (adev->asic_type ==CHIP_SIENNA_CICHLID && i !=1 ) - ring->no_scheduler = true;sprintf (ring->name,"vcn_enc_%d.%d" , i, j); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst[i].irq,0 , -AMDGPU_RING_PRIO_DEFAULT ,NULL ); +AMDGPU_RING_PRIO_DEFAULT , + &adev->vcn.inst[i].sched_score);if (r)return r; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
reviewerRe: [PATCH 3/3] drm/amdgpu: share scheduler score on VCN3 instances
Alex how do we want to merge this?
I've just pushed the first patch to drm-misc-next since that needed a rebase because it touches other drivers as well.
But the rest is really AMD specific and I'm not sure if the dependent stuff is already in there as well.
So if I push it to drm-misc-next you will probably need to merge and if I push it to amd-staging-drm-next somebody else might need to merge when drm-misc-next is merged.
Ideas?
Christian.
Am 04.02.21 um 19:34 schrieb Leo Liu:
Quoted 62 lines
The series are:
Reviewed-and-Tested-by Leo Liu <[email protected]>Quoted 56 lines · Christian König
The VCN3 instances can do both decode as well as encode.
Share the scheduler load balancing score and remove fixing encode to only the second instance.
Signed-off-by Christian König <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h| 1 + drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 11 +++++++----2 files changed, 8 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -211,6 +211,7 @@ struct amdgpu_vcn_inst { void *saved_bo; struct amdgpu_ring ring_dec; struct amdgpu_ring ring_enc[AMDGPU_VCN_MAX_ENC_RINGS]; + atomic_t sched_score; struct amdgpu_irq_src irq; struct amdgpu_vcn_reg external; struct amdgpu_bo *dpg_sram_bo;drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +1
-0@@ -171,6 +171,7 @@ static int vcn_v3_0_sw_init(void *handle) for (i = 0; i < adev->vcn.num_vcn_inst; i++) { volatile struct amdgpu_fw_shared *fw_shared; + if (adev->vcn.harvest_config & (1 << i)) continue; @@ -198,6 +199,8 @@ static int vcn_v3_0_sw_init(void *handle) if (r)return r;
+atomic_set(&adev->vcn.inst[i].sched_score, 0); +
ring = &adev->vcn.inst[i].ring_dec;ring->use_doorbell= true;
if (amdgpu_sriov_vf(adev)) {drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2
-1@@ -209,7 +212,8 @@ static int vcn_v3_0_sw_init(void *handle) ring->no_scheduler = true; sprintf(ring->name, "vcn_dec_%d", i); r = amdgpu_ring_init(adev, ring, 512, &adev->vcn.inst[i].irq, 0, - AMDGPU_RING_PRIO_DEFAULT, NULL); + AMDGPU_RING_PRIO_DEFAULT, + &adev->vcn.inst[i].sched_score); if (r) return r; @@ -227,11 +231,10 @@ static int vcn_v3_0_sw_init(void *handle)} else {
ring->doorbell_index= (adev->doorbell_index.vcn.vcn_ring0_1<< 1) + 2 + j + 8 * i; }
- if (adev->asic_type==CHIP_SIENNA_CICHLID&& i != 1)
-ring->no_scheduler= true;
Quoted 8 lines
Quoted 8 lines
sprintf(ring->name, "vcn_enc_%d.%d", i, j);
r = amdgpu_ring_init(adev, ring, 512, &adev->vcn.inst[i].irq, 0, -AMDGPU_RING_PRIO_DEFAULT, NULL);
+AMDGPU_RING_PRIO_DEFAULT,
+ &adev->vcn.inst[i].sched_score);
if (r)
return r;
}
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
maintainerRe: [PATCH 3/3] drm/amdgpu: share scheduler score on VCN3 instances
[AMD Official Use Only - Internal Distribution Only]
Good question. I think push it to drm-misc-next for upstream. We can carry it internally in amd-staging-drm-next for internal testing and I can coordinate with drm-next. I think the amdgpu changes are pretty straightforward, so shouldn't be too hard keep the merge straight. I dunno.
Alex
________________________________
From: Christian König <[email protected]>
Sent: Friday, February 5, 2021 4:58 AM
To: Liu, Leo <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH 3/3] drm/amdgpu: share scheduler score on VCN3 instances
Alex how do we want to merge this?
I've just pushed the first patch to drm-misc-next since that needed a rebase because it touches other drivers as well.
But the rest is really AMD specific and I'm not sure if the dependent stuff is already in there as well.
So if I push it to drm-misc-next you will probably need to merge and if I push it to amd-staging-drm-next somebody else might need to merge when drm-misc-next is merged.
Ideas?
Christian.
Am 04.02.21 um 19:34 schrieb Leo Liu:
Quoted 67 lines
The series are:
Reviewed-and-Tested-by Leo Liu <[email protected]>Quoted 61 lines · Christian König
The VCN3 instances can do both decode as well as encode.
Share the scheduler load balancing score and remove fixing encode to only the second instance.
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -211,6 +211,7 @@ struct amdgpu_vcn_inst {void *saved_bo;struct amdgpu_ring ring_dec;struct amdgpu_ring ring_enc[AMDGPU_VCN_MAX_ENC_RINGS ]; +atomic_t sched_score;struct amdgpu_irq_src irq;struct amdgpu_vcn_reg external;struct amdgpu_bo *dpg_sram_bo;drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +1
-0@@ -171,6 +171,7 @@ static int vcn_v3_0_sw_init(void *handle)for (i =0 ; i < adev->vcn.num_vcn_inst; i++) {volatile struct amdgpu_fw_shared *fw_shared; +if (adev->vcn.harvest_config & (1 << i))continue ; @@ -198,6 +199,8 @@ static int vcn_v3_0_sw_init(void *handle) if (r)return r;+
atomic_set(&adev->vcn.inst[i].sched_score, 0);drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +3
-1+ ring = &adev->vcn.inst[i].ring_dec; ring->use_doorbell = true;if (amdgpu_sriov_vf (adev)) {@@ -209,7 +212,8 @@ static int vcn_v3_0_sw_init(void *handle) ring->no_scheduler = true;sprintf (ring->name,"vcn_dec_%d" , i); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst[i].irq,0 , -AMDGPU_RING_PRIO_DEFAULT ,NULL ); +AMDGPU_RING_PRIO_DEFAULT , + &adev->vcn.inst[i].sched_score);if (r)return r;@@ -227,11 +231,10 @@ static int
vcn_v3_0_sw_init(void *handle)} else { ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + 2 + j + 8 * i; }drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +0
-2-if (adev->asic_type ==CHIP_SIENNA_CICHLID && i !=1 ) - ring->no_scheduler = true;sprintf (ring->name,"vcn_enc_%d.%d" , i, j);
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c static int vcn_v3_0_sw_init(void *handle) · line 240
Quoted 8 lines
r = amdgpu_ring_init(adev, ring, 512,&adev->vcn.inst[i].irq, 0,
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2
-1- AMDGPU_RING_PRIO_DEFAULT, NULL); +AMDGPU_RING_PRIO_DEFAULT , + &adev->vcn.inst[i].sched_score);if (r)return r; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerRe: [PATCH 3/3] drm/amdgpu: share scheduler score on VCN3 instances
The alternative is to wait till drm-misc-next is merged into drm-next, then rebase amd-staging-drm-next on top of that (or directly drm-misc-next) and push then.
Would give us at least a clean history. Question is rather if we want it in 5.12?
Christian.
Am 05.02.21 um 15:50 schrieb Deucher, Alexander:
Quoted 97 lines
[AMD Official Use Only - Internal Distribution Only]
Good question. I think push it to drm-misc-next for upstream. We can carry it internally in amd-staging-drm-next for internal testing and I can coordinate with drm-next. I think the amdgpu changes are pretty straightforward, so shouldn't be too hard keep the merge straight. I dunno.
Alex
------------------------------------------------------------------------
*From:* Christian König <[email protected]>
*Sent:* Friday, February 5, 2021 4:58 AM
*To:* Liu, Leo <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Deucher, Alexander <[email protected]> *Subject:* Re: [PATCH 3/3] drm/amdgpu: share scheduler score on VCN3 instances
Alex how do we want to merge this?I've just pushed the first patch to drm-misc-next since that needed a rebase because it touches other drivers as well.
But the rest is really AMD specific and I'm not sure if the dependent stuff is already in there as well.
So if I push it to drm-misc-next you will probably need to merge and if I push it to amd-staging-drm-next somebody else might need to merge when drm-misc-next is merged.
Ideas?
Christian.
Am 04.02.21 um 19:34 schrieb Leo Liu:
Quoted 67 lines
The series are:
Reviewed-and-Tested-by Leo Liu <[email protected]>Quoted 61 lines · Christian König
The VCN3 instances can do both decode as well as encode.
Share the scheduler load balancing score and remove fixing encode to only the second instance.
Signed-off-by Christian König <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h| 1 + drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 11 +++++++----2 files changed, 8 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -211,6 +211,7 @@ struct amdgpu_vcn_inst { void *saved_bo; struct amdgpu_ring ring_dec; struct amdgpu_ring ring_enc[AMDGPU_VCN_MAX_ENC_RINGS]; + atomic_t sched_score; struct amdgpu_irq_src irq; struct amdgpu_vcn_reg external; struct amdgpu_bo *dpg_sram_bo;drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +1
-0@@ -171,6 +171,7 @@ static int vcn_v3_0_sw_init(void *handle) for (i = 0; i < adev->vcn.num_vcn_inst; i++) { volatile struct amdgpu_fw_shared *fw_shared; + if (adev->vcn.harvest_config & (1 << i)) continue; @@ -198,6 +199,8 @@ static int vcn_v3_0_sw_init(void *handle) if (r)return r;
+atomic_set(&adev->vcn.inst[i].sched_score, 0); +
ring = &adev->vcn.inst[i].ring_dec;ring->use_doorbell= true;
if (amdgpu_sriov_vf(adev)) {drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2
-1@@ -209,7 +212,8 @@ static int vcn_v3_0_sw_init(void *handle) ring->no_scheduler = true; sprintf(ring->name, "vcn_dec_%d", i); r = amdgpu_ring_init(adev, ring, 512, &adev->vcn.inst[i].irq,0 , - AMDGPU_RING_PRIO_DEFAULT, NULL); + AMDGPU_RING_PRIO_DEFAULT, + &adev->vcn.inst[i].sched_score); if (r) return r;@@ -227,11 +231,10 @@ static int
vcn_v3_0_sw_init(void *handle)} else {
ring->doorbell_index= (adev->doorbell_index.vcn.vcn_ring0_1<< 1) + 2 + j + 8 * i; }
- if (adev->asic_type==CHIP_SIENNA_CICHLID&& i != 1) -ring->no_scheduler= true;sprintf(ring->name, "vcn_enc_%d.%d", i, j);
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
r = amdgpu_ring_init(adev, ring, 512, &adev->vcn.inst[i].irq, 0,
-AMDGPU_RING_PRIO_DEFAULT, NULL);
+AMDGPU_RING_PRIO_DEFAULT,
+ &adev->vcn.inst[i].sched_score);
if (r)
return r;
}
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
maintainerRe: [PATCH 3/3] drm/amdgpu: share scheduler score on VCN3 instances
[AMD Official Use Only - Internal Distribution Only]
I think the virt team probably wants it in amd-staging-drm-next so they can start testing it. 5.12 is getting pretty tight. I'm not sure if there will be another drm-misc PR or not for 5.12. Rebasing amd-staging-drm-next is turning into a challenge. there are always a lot of regressions. I guess that is an argument to rebase more often so we get better internal testing of it.
Alex
________________________________
From: Koenig, Christian <[email protected]>
Sent: Friday, February 5, 2021 9:53 AM
To: Deucher, Alexander <[email protected]>; Liu, Leo <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH 3/3] drm/amdgpu: share scheduler score on VCN3 instances
The alternative is to wait till drm-misc-next is merged into drm-next, then rebase amd-staging-drm-next on top of that (or directly drm-misc-next) and push then.
Would give us at least a clean history. Question is rather if we want it in 5.12?
Christian.
Am 05.02.21 um 15:50 schrieb Deucher, Alexander:
[AMD Official Use Only - Internal Distribution Only]
Good question. I think push it to drm-misc-next for upstream. We can carry it internally in amd-staging-drm-next for internal testing and I can coordinate with drm-next. I think the amdgpu changes are pretty straightforward, so shouldn't be too hard keep the merge straight. I dunno.
Alex
________________________________
From: Christian König <[email protected]><mailto:[email protected]>
Sent: Friday, February 5, 2021 4:58 AM
To: Liu, Leo <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]> <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]> <[email protected]><mailto:[email protected]>; Deucher, Alexander <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 3/3] drm/amdgpu: share scheduler score on VCN3 instances
Alex how do we want to merge this?
I've just pushed the first patch to drm-misc-next since that needed a rebase because it touches other drivers as well.
But the rest is really AMD specific and I'm not sure if the dependent stuff is already in there as well.
So if I push it to drm-misc-next you will probably need to merge and if I push it to amd-staging-drm-next somebody else might need to merge when drm-misc-next is merged.
Ideas?
Christian.
Am 04.02.21 um 19:34 schrieb Leo Liu:
Quoted 67 lines
The series are:
Reviewed-and-Tested-by Leo Liu <[email protected]><mailto:[email protected]>Quoted 61 lines · Christian König
The VCN3 instances can do both decode as well as encode.
Share the scheduler load balancing score and remove fixing encode to only the second instance.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -211,6 +211,7 @@ struct amdgpu_vcn_inst {void *saved_bo;struct amdgpu_ring ring_dec;struct amdgpu_ring ring_enc[AMDGPU_VCN_MAX_ENC_RINGS ]; +atomic_t sched_score;struct amdgpu_irq_src irq;struct amdgpu_vcn_reg external;struct amdgpu_bo *dpg_sram_bo;drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +1
-0@@ -171,6 +171,7 @@ static int vcn_v3_0_sw_init(void *handle)for (i =0 ; i < adev->vcn.num_vcn_inst; i++) {volatile struct amdgpu_fw_shared *fw_shared; +if (adev->vcn.harvest_config & (1 << i))continue ; @@ -198,6 +199,8 @@ static int vcn_v3_0_sw_init(void *handle) if (r)return r;+
atomic_set(&adev->vcn.inst[i].sched_score, 0);drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +3
-1+ ring = &adev->vcn.inst[i].ring_dec; ring->use_doorbell = true;if (amdgpu_sriov_vf (adev)) {@@ -209,7 +212,8 @@ static int vcn_v3_0_sw_init(void *handle) ring->no_scheduler = true;sprintf (ring->name,"vcn_dec_%d" , i); r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst[i].irq,0 , -AMDGPU_RING_PRIO_DEFAULT ,NULL ); +AMDGPU_RING_PRIO_DEFAULT , + &adev->vcn.inst[i].sched_score);if (r)return r;@@ -227,11 +231,10 @@ static int
vcn_v3_0_sw_init(void *handle)} else { ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + 2 + j + 8 * i; }drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +0
-2-if (adev->asic_type ==CHIP_SIENNA_CICHLID && i !=1 ) - ring->no_scheduler = true;sprintf (ring->name,"vcn_enc_%d.%d" , i, j);
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c static int vcn_v3_0_sw_init(void *handle) · line 240
Quoted 8 lines
r = amdgpu_ring_init(adev, ring, 512,&adev->vcn.inst[i].irq, 0,
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2
-1- AMDGPU_RING_PRIO_DEFAULT, NULL); +AMDGPU_RING_PRIO_DEFAULT , + &adev->vcn.inst[i].sched_score);if (r)return r; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx