diff options
author | Christian König <christian.koenig@amd.com> | 2018-09-17 09:41:45 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-09-26 22:09:21 -0400 |
commit | f54b30d70bc606f7a154edba5883c7fa23838e9f (patch) | |
tree | 23cb75c552eae7e36939f580296d43ca1f1ada66 /drivers/gpu/drm/amd/amdgpu/cik_sdma.c | |
parent | 0dd1e5bbecd75b6977d47be39f85af1bda524006 (diff) |
drm/amdgpu: make function pointers mandatory
We always want those to be setup correctly.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/cik_sdma.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c index 154b1499b07e..ee9d5c92edb1 100644 --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c | |||
@@ -1370,10 +1370,8 @@ static const struct amdgpu_buffer_funcs cik_sdma_buffer_funcs = { | |||
1370 | 1370 | ||
1371 | static void cik_sdma_set_buffer_funcs(struct amdgpu_device *adev) | 1371 | static void cik_sdma_set_buffer_funcs(struct amdgpu_device *adev) |
1372 | { | 1372 | { |
1373 | if (adev->mman.buffer_funcs == NULL) { | 1373 | adev->mman.buffer_funcs = &cik_sdma_buffer_funcs; |
1374 | adev->mman.buffer_funcs = &cik_sdma_buffer_funcs; | 1374 | adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring; |
1375 | adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring; | ||
1376 | } | ||
1377 | } | 1375 | } |
1378 | 1376 | ||
1379 | static const struct amdgpu_vm_pte_funcs cik_sdma_vm_pte_funcs = { | 1377 | static const struct amdgpu_vm_pte_funcs cik_sdma_vm_pte_funcs = { |
@@ -1389,15 +1387,13 @@ static void cik_sdma_set_vm_pte_funcs(struct amdgpu_device *adev) | |||
1389 | struct drm_gpu_scheduler *sched; | 1387 | struct drm_gpu_scheduler *sched; |
1390 | unsigned i; | 1388 | unsigned i; |
1391 | 1389 | ||
1392 | if (adev->vm_manager.vm_pte_funcs == NULL) { | 1390 | adev->vm_manager.vm_pte_funcs = &cik_sdma_vm_pte_funcs; |
1393 | adev->vm_manager.vm_pte_funcs = &cik_sdma_vm_pte_funcs; | 1391 | for (i = 0; i < adev->sdma.num_instances; i++) { |
1394 | for (i = 0; i < adev->sdma.num_instances; i++) { | 1392 | sched = &adev->sdma.instance[i].ring.sched; |
1395 | sched = &adev->sdma.instance[i].ring.sched; | 1393 | adev->vm_manager.vm_pte_rqs[i] = |
1396 | adev->vm_manager.vm_pte_rqs[i] = | 1394 | &sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL]; |
1397 | &sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL]; | ||
1398 | } | ||
1399 | adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances; | ||
1400 | } | 1395 | } |
1396 | adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances; | ||
1401 | } | 1397 | } |
1402 | 1398 | ||
1403 | const struct amdgpu_ip_block_version cik_sdma_ip_block = | 1399 | const struct amdgpu_ip_block_version cik_sdma_ip_block = |