File tree Expand file tree Collapse file tree 13 files changed +37
-46
lines changed
drivers/gpu/drm/amd/amdgpu Expand file tree Collapse file tree 13 files changed +37
-46
lines changed Original file line number Diff line number Diff line change @@ -2584,6 +2584,18 @@ static int amdgpu_device_init_schedulers(struct amdgpu_device *adev)
25842584 ring -> name );
25852585 return r ;
25862586 }
2587+ r = amdgpu_uvd_entity_init (adev , ring );
2588+ if (r ) {
2589+ DRM_ERROR ("Failed to create UVD scheduling entity on ring %s.\n" ,
2590+ ring -> name );
2591+ return r ;
2592+ }
2593+ r = amdgpu_vce_entity_init (adev , ring );
2594+ if (r ) {
2595+ DRM_ERROR ("Failed to create VCE scheduling entity on ring %s.\n" ,
2596+ ring -> name );
2597+ return r ;
2598+ }
25872599 }
25882600
25892601 amdgpu_xcp_update_partition_sched_list (adev );
Original file line number Diff line number Diff line change @@ -399,20 +399,20 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)
399399 *
400400 * @adev: amdgpu_device pointer
401401 *
402+ * Initialize the entity used for handle management in the kernel driver.
402403 */
403- int amdgpu_uvd_entity_init (struct amdgpu_device * adev )
404+ int amdgpu_uvd_entity_init (struct amdgpu_device * adev , struct amdgpu_ring * ring )
404405{
405- struct amdgpu_ring * ring ;
406- struct drm_gpu_scheduler * sched ;
407- int r ;
406+ if ( ring == & adev -> uvd . inst [ 0 ]. ring ) {
407+ struct drm_gpu_scheduler * sched = & ring -> sched ;
408+ int r ;
408409
409- ring = & adev -> uvd .inst [0 ].ring ;
410- sched = & ring -> sched ;
411- r = drm_sched_entity_init (& adev -> uvd .entity , DRM_SCHED_PRIORITY_NORMAL ,
412- & sched , 1 , NULL );
413- if (r ) {
414- DRM_ERROR ("Failed setting up UVD kernel entity.\n" );
415- return r ;
410+ r = drm_sched_entity_init (& adev -> uvd .entity , DRM_SCHED_PRIORITY_NORMAL ,
411+ & sched , 1 , NULL );
412+ if (r ) {
413+ DRM_ERROR ("Failed setting up UVD kernel entity.\n" );
414+ return r ;
415+ }
416416 }
417417
418418 return 0 ;
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ struct amdgpu_uvd {
7373
7474int amdgpu_uvd_sw_init (struct amdgpu_device * adev );
7575int amdgpu_uvd_sw_fini (struct amdgpu_device * adev );
76- int amdgpu_uvd_entity_init (struct amdgpu_device * adev );
76+ int amdgpu_uvd_entity_init (struct amdgpu_device * adev , struct amdgpu_ring * ring );
7777int amdgpu_uvd_prepare_suspend (struct amdgpu_device * adev );
7878int amdgpu_uvd_suspend (struct amdgpu_device * adev );
7979int amdgpu_uvd_resume (struct amdgpu_device * adev );
Original file line number Diff line number Diff line change @@ -231,20 +231,20 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev)
231231 *
232232 * @adev: amdgpu_device pointer
233233 *
234+ * Initialize the entity used for handle management in the kernel driver.
234235 */
235- int amdgpu_vce_entity_init (struct amdgpu_device * adev )
236+ int amdgpu_vce_entity_init (struct amdgpu_device * adev , struct amdgpu_ring * ring )
236237{
237- struct amdgpu_ring * ring ;
238- struct drm_gpu_scheduler * sched ;
239- int r ;
240-
241- ring = & adev -> vce .ring [0 ];
242- sched = & ring -> sched ;
243- r = drm_sched_entity_init (& adev -> vce .entity , DRM_SCHED_PRIORITY_NORMAL ,
244- & sched , 1 , NULL );
245- if (r != 0 ) {
246- DRM_ERROR ("Failed setting up VCE run queue.\n" );
247- return r ;
238+ if (ring == & adev -> vce .ring [0 ]) {
239+ struct drm_gpu_scheduler * sched = & ring -> sched ;
240+ int r ;
241+
242+ r = drm_sched_entity_init (& adev -> vce .entity , DRM_SCHED_PRIORITY_NORMAL ,
243+ & sched , 1 , NULL );
244+ if (r != 0 ) {
245+ DRM_ERROR ("Failed setting up VCE run queue.\n" );
246+ return r ;
247+ }
248248 }
249249
250250 return 0 ;
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ struct amdgpu_vce {
5555
5656int amdgpu_vce_sw_init (struct amdgpu_device * adev , unsigned long size );
5757int amdgpu_vce_sw_fini (struct amdgpu_device * adev );
58- int amdgpu_vce_entity_init (struct amdgpu_device * adev );
58+ int amdgpu_vce_entity_init (struct amdgpu_device * adev , struct amdgpu_ring * ring );
5959int amdgpu_vce_suspend (struct amdgpu_device * adev );
6060int amdgpu_vce_resume (struct amdgpu_device * adev );
6161void amdgpu_vce_free_handles (struct amdgpu_device * adev , struct drm_file * filp );
Original file line number Diff line number Diff line change @@ -577,8 +577,6 @@ static int uvd_v3_1_sw_init(void *handle)
577577 ptr += ucode_len ;
578578 memcpy (& adev -> uvd .keyselect , ptr , 4 );
579579
580- r = amdgpu_uvd_entity_init (adev );
581-
582580 return r ;
583581}
584582
Original file line number Diff line number Diff line change @@ -127,8 +127,6 @@ static int uvd_v4_2_sw_init(void *handle)
127127 if (r )
128128 return r ;
129129
130- r = amdgpu_uvd_entity_init (adev );
131-
132130 return r ;
133131}
134132
Original file line number Diff line number Diff line change @@ -125,8 +125,6 @@ static int uvd_v5_0_sw_init(void *handle)
125125 if (r )
126126 return r ;
127127
128- r = amdgpu_uvd_entity_init (adev );
129-
130128 return r ;
131129}
132130
Original file line number Diff line number Diff line change @@ -432,8 +432,6 @@ static int uvd_v6_0_sw_init(void *handle)
432432 }
433433 }
434434
435- r = amdgpu_uvd_entity_init (adev );
436-
437435 return r ;
438436}
439437
Original file line number Diff line number Diff line change @@ -480,10 +480,6 @@ static int uvd_v7_0_sw_init(void *handle)
480480 if (r )
481481 return r ;
482482
483- r = amdgpu_uvd_entity_init (adev );
484- if (r )
485- return r ;
486-
487483 r = amdgpu_virt_alloc_mm_table (adev );
488484 if (r )
489485 return r ;
You can’t perform that action at this time.
0 commit comments