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)
2584
2584
ring -> name );
2585
2585
return r ;
2586
2586
}
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
+ }
2587
2599
}
2588
2600
2589
2601
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)
399
399
*
400
400
* @adev: amdgpu_device pointer
401
401
*
402
+ * Initialize the entity used for handle management in the kernel driver.
402
403
*/
403
- int amdgpu_uvd_entity_init (struct amdgpu_device * adev )
404
+ int amdgpu_uvd_entity_init (struct amdgpu_device * adev , struct amdgpu_ring * ring )
404
405
{
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 ;
408
409
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
+ }
416
416
}
417
417
418
418
return 0 ;
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ struct amdgpu_uvd {
73
73
74
74
int amdgpu_uvd_sw_init (struct amdgpu_device * adev );
75
75
int 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 );
77
77
int amdgpu_uvd_prepare_suspend (struct amdgpu_device * adev );
78
78
int amdgpu_uvd_suspend (struct amdgpu_device * adev );
79
79
int 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)
231
231
*
232
232
* @adev: amdgpu_device pointer
233
233
*
234
+ * Initialize the entity used for handle management in the kernel driver.
234
235
*/
235
- int amdgpu_vce_entity_init (struct amdgpu_device * adev )
236
+ int amdgpu_vce_entity_init (struct amdgpu_device * adev , struct amdgpu_ring * ring )
236
237
{
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
+ }
248
248
}
249
249
250
250
return 0 ;
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ struct amdgpu_vce {
55
55
56
56
int amdgpu_vce_sw_init (struct amdgpu_device * adev , unsigned long size );
57
57
int 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 );
59
59
int amdgpu_vce_suspend (struct amdgpu_device * adev );
60
60
int amdgpu_vce_resume (struct amdgpu_device * adev );
61
61
void 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)
577
577
ptr += ucode_len ;
578
578
memcpy (& adev -> uvd .keyselect , ptr , 4 );
579
579
580
- r = amdgpu_uvd_entity_init (adev );
581
-
582
580
return r ;
583
581
}
584
582
Original file line number Diff line number Diff line change @@ -127,8 +127,6 @@ static int uvd_v4_2_sw_init(void *handle)
127
127
if (r )
128
128
return r ;
129
129
130
- r = amdgpu_uvd_entity_init (adev );
131
-
132
130
return r ;
133
131
}
134
132
Original file line number Diff line number Diff line change @@ -125,8 +125,6 @@ static int uvd_v5_0_sw_init(void *handle)
125
125
if (r )
126
126
return r ;
127
127
128
- r = amdgpu_uvd_entity_init (adev );
129
-
130
128
return r ;
131
129
}
132
130
Original file line number Diff line number Diff line change @@ -432,8 +432,6 @@ static int uvd_v6_0_sw_init(void *handle)
432
432
}
433
433
}
434
434
435
- r = amdgpu_uvd_entity_init (adev );
436
-
437
435
return r ;
438
436
}
439
437
Original file line number Diff line number Diff line change @@ -480,10 +480,6 @@ static int uvd_v7_0_sw_init(void *handle)
480
480
if (r )
481
481
return r ;
482
482
483
- r = amdgpu_uvd_entity_init (adev );
484
- if (r )
485
- return r ;
486
-
487
483
r = amdgpu_virt_alloc_mm_table (adev );
488
484
if (r )
489
485
return r ;
Original file line number Diff line number Diff line change @@ -441,8 +441,6 @@ static int vce_v2_0_sw_init(void *handle)
441
441
return r ;
442
442
}
443
443
444
- r = amdgpu_vce_entity_init (adev );
445
-
446
444
return r ;
447
445
}
448
446
Original file line number Diff line number Diff line change @@ -450,8 +450,6 @@ static int vce_v3_0_sw_init(void *handle)
450
450
return r ;
451
451
}
452
452
453
- r = amdgpu_vce_entity_init (adev );
454
-
455
453
return r ;
456
454
}
457
455
Original file line number Diff line number Diff line change @@ -486,11 +486,6 @@ static int vce_v4_0_sw_init(void *handle)
486
486
return r ;
487
487
}
488
488
489
-
490
- r = amdgpu_vce_entity_init (adev );
491
- if (r )
492
- return r ;
493
-
494
489
r = amdgpu_virt_alloc_mm_table (adev );
495
490
if (r )
496
491
return r ;
You can’t perform that action at this time.
0 commit comments