diff options
author | Christian König <christian.koenig@amd.com> | 2016-01-31 06:20:55 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-10 14:17:20 -0500 |
commit | 9e5d53094c5366a9a14e0694e45e794902cc2c04 (patch) | |
tree | aa539c677510e73aaa8aa55a6e34c8a4d928f7f5 | |
parent | 4c0b242cf27094b666df6604420417e201260af9 (diff) |
drm/amdgpu: make pad_ib a ring function v3
The padding depends on the firmware version and we need that for BO moves as
well, not only for VM updates.
v2: new approach of making pad_ib a ring function
v3: fix typo in macro name
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 1 |
14 files changed, 41 insertions, 18 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 364b0d1c4566..c23eea308991 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -289,8 +289,6 @@ struct amdgpu_vm_pte_funcs { | |||
289 | uint64_t pe, | 289 | uint64_t pe, |
290 | uint64_t addr, unsigned count, | 290 | uint64_t addr, unsigned count, |
291 | uint32_t incr, uint32_t flags); | 291 | uint32_t incr, uint32_t flags); |
292 | /* pad the indirect buffer to the necessary number of dw */ | ||
293 | void (*pad_ib)(struct amdgpu_ib *ib); | ||
294 | }; | 292 | }; |
295 | 293 | ||
296 | /* provided by the gmc block */ | 294 | /* provided by the gmc block */ |
@@ -340,6 +338,8 @@ struct amdgpu_ring_funcs { | |||
340 | int (*test_ib)(struct amdgpu_ring *ring); | 338 | int (*test_ib)(struct amdgpu_ring *ring); |
341 | /* insert NOP packets */ | 339 | /* insert NOP packets */ |
342 | void (*insert_nop)(struct amdgpu_ring *ring, uint32_t count); | 340 | void (*insert_nop)(struct amdgpu_ring *ring, uint32_t count); |
341 | /* pad the indirect buffer to the necessary number of dw */ | ||
342 | void (*pad_ib)(struct amdgpu_ring *ring, struct amdgpu_ib *ib); | ||
343 | }; | 343 | }; |
344 | 344 | ||
345 | /* | 345 | /* |
@@ -1188,6 +1188,7 @@ void amdgpu_ib_pool_fini(struct amdgpu_device *adev); | |||
1188 | int amdgpu_ib_ring_tests(struct amdgpu_device *adev); | 1188 | int amdgpu_ib_ring_tests(struct amdgpu_device *adev); |
1189 | int amdgpu_ring_alloc(struct amdgpu_ring *ring, unsigned ndw); | 1189 | int amdgpu_ring_alloc(struct amdgpu_ring *ring, unsigned ndw); |
1190 | void amdgpu_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count); | 1190 | void amdgpu_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count); |
1191 | void amdgpu_ring_generic_pad_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib); | ||
1191 | void amdgpu_ring_commit(struct amdgpu_ring *ring); | 1192 | void amdgpu_ring_commit(struct amdgpu_ring *ring); |
1192 | void amdgpu_ring_undo(struct amdgpu_ring *ring); | 1193 | void amdgpu_ring_undo(struct amdgpu_ring *ring); |
1193 | unsigned amdgpu_ring_backup(struct amdgpu_ring *ring, | 1194 | unsigned amdgpu_ring_backup(struct amdgpu_ring *ring, |
@@ -2224,7 +2225,6 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring) | |||
2224 | #define amdgpu_vm_copy_pte(adev, ib, pe, src, count) ((adev)->vm_manager.vm_pte_funcs->copy_pte((ib), (pe), (src), (count))) | 2225 | #define amdgpu_vm_copy_pte(adev, ib, pe, src, count) ((adev)->vm_manager.vm_pte_funcs->copy_pte((ib), (pe), (src), (count))) |
2225 | #define amdgpu_vm_write_pte(adev, ib, pa, pe, addr, count, incr, flags) ((adev)->vm_manager.vm_pte_funcs->write_pte((ib), (pa), (pe), (addr), (count), (incr), (flags))) | 2226 | #define amdgpu_vm_write_pte(adev, ib, pa, pe, addr, count, incr, flags) ((adev)->vm_manager.vm_pte_funcs->write_pte((ib), (pa), (pe), (addr), (count), (incr), (flags))) |
2226 | #define amdgpu_vm_set_pte_pde(adev, ib, pe, addr, count, incr, flags) ((adev)->vm_manager.vm_pte_funcs->set_pte_pde((ib), (pe), (addr), (count), (incr), (flags))) | 2227 | #define amdgpu_vm_set_pte_pde(adev, ib, pe, addr, count, incr, flags) ((adev)->vm_manager.vm_pte_funcs->set_pte_pde((ib), (pe), (addr), (count), (incr), (flags))) |
2227 | #define amdgpu_vm_pad_ib(adev, ib) ((adev)->vm_manager.vm_pte_funcs->pad_ib((ib))) | ||
2228 | #define amdgpu_ring_parse_cs(r, p, ib) ((r)->funcs->parse_cs((p), (ib))) | 2228 | #define amdgpu_ring_parse_cs(r, p, ib) ((r)->funcs->parse_cs((p), (ib))) |
2229 | #define amdgpu_ring_test_ring(r) (r)->funcs->test_ring((r)) | 2229 | #define amdgpu_ring_test_ring(r) (r)->funcs->test_ring((r)) |
2230 | #define amdgpu_ring_test_ib(r) (r)->funcs->test_ib((r)) | 2230 | #define amdgpu_ring_test_ib(r) (r)->funcs->test_ib((r)) |
@@ -2236,6 +2236,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring) | |||
2236 | #define amdgpu_ring_emit_fence(r, addr, seq, flags) (r)->funcs->emit_fence((r), (addr), (seq), (flags)) | 2236 | #define amdgpu_ring_emit_fence(r, addr, seq, flags) (r)->funcs->emit_fence((r), (addr), (seq), (flags)) |
2237 | #define amdgpu_ring_emit_gds_switch(r, v, db, ds, wb, ws, ab, as) (r)->funcs->emit_gds_switch((r), (v), (db), (ds), (wb), (ws), (ab), (as)) | 2237 | #define amdgpu_ring_emit_gds_switch(r, v, db, ds, wb, ws, ab, as) (r)->funcs->emit_gds_switch((r), (v), (db), (ds), (wb), (ws), (ab), (as)) |
2238 | #define amdgpu_ring_emit_hdp_flush(r) (r)->funcs->emit_hdp_flush((r)) | 2238 | #define amdgpu_ring_emit_hdp_flush(r) (r)->funcs->emit_hdp_flush((r)) |
2239 | #define amdgpu_ring_pad_ib(r, ib) ((r)->funcs->pad_ib((r), (ib))) | ||
2239 | #define amdgpu_ih_get_wptr(adev) (adev)->irq.ih_funcs->get_wptr((adev)) | 2240 | #define amdgpu_ih_get_wptr(adev) (adev)->irq.ih_funcs->get_wptr((adev)) |
2240 | #define amdgpu_ih_decode_iv(adev, iv) (adev)->irq.ih_funcs->decode_iv((adev), (iv)) | 2241 | #define amdgpu_ih_decode_iv(adev, iv) (adev)->irq.ih_funcs->decode_iv((adev), (iv)) |
2241 | #define amdgpu_ih_set_rptr(adev) (adev)->irq.ih_funcs->set_rptr((adev)) | 2242 | #define amdgpu_ih_set_rptr(adev) (adev)->irq.ih_funcs->set_rptr((adev)) |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index 1f0db995046d..56c07e3fdb33 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | |||
@@ -90,6 +90,19 @@ void amdgpu_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count) | |||
90 | amdgpu_ring_write(ring, ring->nop); | 90 | amdgpu_ring_write(ring, ring->nop); |
91 | } | 91 | } |
92 | 92 | ||
93 | /** amdgpu_ring_generic_pad_ib - pad IB with NOP packets | ||
94 | * | ||
95 | * @ring: amdgpu_ring structure holding ring information | ||
96 | * @ib: IB to add NOP packets to | ||
97 | * | ||
98 | * This is the generic pad_ib function for rings except SDMA | ||
99 | */ | ||
100 | void amdgpu_ring_generic_pad_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib) | ||
101 | { | ||
102 | while (ib->length_dw & ring->align_mask) | ||
103 | ib->ptr[ib->length_dw++] = ring->nop; | ||
104 | } | ||
105 | |||
93 | /** | 106 | /** |
94 | * amdgpu_ring_commit - tell the GPU to execute the new | 107 | * amdgpu_ring_commit - tell the GPU to execute the new |
95 | * commands on the ring buffer | 108 | * commands on the ring buffer |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index cdb393db11a5..a7354798f087 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
@@ -1058,7 +1058,7 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, | |||
1058 | byte_count -= cur_size_in_bytes; | 1058 | byte_count -= cur_size_in_bytes; |
1059 | } | 1059 | } |
1060 | 1060 | ||
1061 | amdgpu_vm_pad_ib(adev, ib); | 1061 | amdgpu_ring_pad_ib(ring, ib); |
1062 | WARN_ON(ib->length_dw > num_dw); | 1062 | WARN_ON(ib->length_dw > num_dw); |
1063 | r = amdgpu_sched_ib_submit_kernel_helper(adev, ring, ib, 1, | 1063 | r = amdgpu_sched_ib_submit_kernel_helper(adev, ring, ib, 1, |
1064 | &amdgpu_vm_free_job, | 1064 | &amdgpu_vm_free_job, |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index f7eee81d120a..d0acc9c0fd7f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -362,7 +362,7 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev, | |||
362 | ib->length_dw = 0; | 362 | ib->length_dw = 0; |
363 | 363 | ||
364 | amdgpu_vm_update_pages(adev, NULL, 0, ib, addr, 0, entries, 0, 0); | 364 | amdgpu_vm_update_pages(adev, NULL, 0, ib, addr, 0, entries, 0, 0); |
365 | amdgpu_vm_pad_ib(adev, ib); | 365 | amdgpu_ring_pad_ib(ring, ib); |
366 | 366 | ||
367 | WARN_ON(ib->length_dw > 64); | 367 | WARN_ON(ib->length_dw > 64); |
368 | r = amdgpu_sched_ib_submit_kernel_helper(adev, ring, ib, 1, | 368 | r = amdgpu_sched_ib_submit_kernel_helper(adev, ring, ib, 1, |
@@ -492,7 +492,7 @@ int amdgpu_vm_update_page_directory(struct amdgpu_device *adev, | |||
492 | count, incr, AMDGPU_PTE_VALID); | 492 | count, incr, AMDGPU_PTE_VALID); |
493 | 493 | ||
494 | if (ib->length_dw != 0) { | 494 | if (ib->length_dw != 0) { |
495 | amdgpu_vm_pad_ib(adev, ib); | 495 | amdgpu_ring_pad_ib(ring, ib); |
496 | amdgpu_sync_resv(adev, &ib->sync, pd->tbo.resv, AMDGPU_FENCE_OWNER_VM); | 496 | amdgpu_sync_resv(adev, &ib->sync, pd->tbo.resv, AMDGPU_FENCE_OWNER_VM); |
497 | WARN_ON(ib->length_dw > ndw); | 497 | WARN_ON(ib->length_dw > ndw); |
498 | r = amdgpu_sched_ib_submit_kernel_helper(adev, ring, ib, 1, | 498 | r = amdgpu_sched_ib_submit_kernel_helper(adev, ring, ib, 1, |
@@ -755,7 +755,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, | |||
755 | amdgpu_vm_update_ptes(adev, gtt, gtt_flags, vm, ib, start, last + 1, | 755 | amdgpu_vm_update_ptes(adev, gtt, gtt_flags, vm, ib, start, last + 1, |
756 | addr, flags); | 756 | addr, flags); |
757 | 757 | ||
758 | amdgpu_vm_pad_ib(adev, ib); | 758 | amdgpu_ring_pad_ib(ring, ib); |
759 | WARN_ON(ib->length_dw > ndw); | 759 | WARN_ON(ib->length_dw > ndw); |
760 | r = amdgpu_sched_ib_submit_kernel_helper(adev, ring, ib, 1, | 760 | r = amdgpu_sched_ib_submit_kernel_helper(adev, ring, ib, 1, |
761 | &amdgpu_vm_free_job, | 761 | &amdgpu_vm_free_job, |
diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c index abfa3f2f15fa..1007a98f775b 100644 --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c | |||
@@ -796,9 +796,9 @@ static void cik_sdma_vm_set_pte_pde(struct amdgpu_ib *ib, | |||
796 | * @ib: indirect buffer to fill with padding | 796 | * @ib: indirect buffer to fill with padding |
797 | * | 797 | * |
798 | */ | 798 | */ |
799 | static void cik_sdma_vm_pad_ib(struct amdgpu_ib *ib) | 799 | static void cik_sdma_ring_pad_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib) |
800 | { | 800 | { |
801 | struct amdgpu_sdma_instance *sdma = amdgpu_get_sdma_instance(ib->ring); | 801 | struct amdgpu_sdma_instance *sdma = amdgpu_get_sdma_instance(ring); |
802 | u32 pad_count; | 802 | u32 pad_count; |
803 | int i; | 803 | int i; |
804 | 804 | ||
@@ -1271,6 +1271,7 @@ static const struct amdgpu_ring_funcs cik_sdma_ring_funcs = { | |||
1271 | .test_ring = cik_sdma_ring_test_ring, | 1271 | .test_ring = cik_sdma_ring_test_ring, |
1272 | .test_ib = cik_sdma_ring_test_ib, | 1272 | .test_ib = cik_sdma_ring_test_ib, |
1273 | .insert_nop = cik_sdma_ring_insert_nop, | 1273 | .insert_nop = cik_sdma_ring_insert_nop, |
1274 | .pad_ib = cik_sdma_ring_pad_ib, | ||
1274 | }; | 1275 | }; |
1275 | 1276 | ||
1276 | static void cik_sdma_set_ring_funcs(struct amdgpu_device *adev) | 1277 | static void cik_sdma_set_ring_funcs(struct amdgpu_device *adev) |
@@ -1367,7 +1368,6 @@ static const struct amdgpu_vm_pte_funcs cik_sdma_vm_pte_funcs = { | |||
1367 | .copy_pte = cik_sdma_vm_copy_pte, | 1368 | .copy_pte = cik_sdma_vm_copy_pte, |
1368 | .write_pte = cik_sdma_vm_write_pte, | 1369 | .write_pte = cik_sdma_vm_write_pte, |
1369 | .set_pte_pde = cik_sdma_vm_set_pte_pde, | 1370 | .set_pte_pde = cik_sdma_vm_set_pte_pde, |
1370 | .pad_ib = cik_sdma_vm_pad_ib, | ||
1371 | }; | 1371 | }; |
1372 | 1372 | ||
1373 | static void cik_sdma_set_vm_pte_funcs(struct amdgpu_device *adev) | 1373 | static void cik_sdma_set_vm_pte_funcs(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c index 4eb784dee515..40159d529e5b 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | |||
@@ -5526,6 +5526,7 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = { | |||
5526 | .test_ring = gfx_v7_0_ring_test_ring, | 5526 | .test_ring = gfx_v7_0_ring_test_ring, |
5527 | .test_ib = gfx_v7_0_ring_test_ib, | 5527 | .test_ib = gfx_v7_0_ring_test_ib, |
5528 | .insert_nop = amdgpu_ring_insert_nop, | 5528 | .insert_nop = amdgpu_ring_insert_nop, |
5529 | .pad_ib = amdgpu_ring_generic_pad_ib, | ||
5529 | }; | 5530 | }; |
5530 | 5531 | ||
5531 | static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = { | 5532 | static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = { |
@@ -5541,6 +5542,7 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = { | |||
5541 | .test_ring = gfx_v7_0_ring_test_ring, | 5542 | .test_ring = gfx_v7_0_ring_test_ring, |
5542 | .test_ib = gfx_v7_0_ring_test_ib, | 5543 | .test_ib = gfx_v7_0_ring_test_ib, |
5543 | .insert_nop = amdgpu_ring_insert_nop, | 5544 | .insert_nop = amdgpu_ring_insert_nop, |
5545 | .pad_ib = amdgpu_ring_generic_pad_ib, | ||
5544 | }; | 5546 | }; |
5545 | 5547 | ||
5546 | static void gfx_v7_0_set_ring_funcs(struct amdgpu_device *adev) | 5548 | static void gfx_v7_0_set_ring_funcs(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 3d4bed64ab88..2ca36606c2ef 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -5104,6 +5104,7 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = { | |||
5104 | .test_ring = gfx_v8_0_ring_test_ring, | 5104 | .test_ring = gfx_v8_0_ring_test_ring, |
5105 | .test_ib = gfx_v8_0_ring_test_ib, | 5105 | .test_ib = gfx_v8_0_ring_test_ib, |
5106 | .insert_nop = amdgpu_ring_insert_nop, | 5106 | .insert_nop = amdgpu_ring_insert_nop, |
5107 | .pad_ib = amdgpu_ring_generic_pad_ib, | ||
5107 | }; | 5108 | }; |
5108 | 5109 | ||
5109 | static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = { | 5110 | static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = { |
@@ -5119,6 +5120,7 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = { | |||
5119 | .test_ring = gfx_v8_0_ring_test_ring, | 5120 | .test_ring = gfx_v8_0_ring_test_ring, |
5120 | .test_ib = gfx_v8_0_ring_test_ib, | 5121 | .test_ib = gfx_v8_0_ring_test_ib, |
5121 | .insert_nop = amdgpu_ring_insert_nop, | 5122 | .insert_nop = amdgpu_ring_insert_nop, |
5123 | .pad_ib = amdgpu_ring_generic_pad_ib, | ||
5122 | }; | 5124 | }; |
5123 | 5125 | ||
5124 | static void gfx_v8_0_set_ring_funcs(struct amdgpu_device *adev) | 5126 | static void gfx_v8_0_set_ring_funcs(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c index 750231d06aa0..5dfb13c56b90 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | |||
@@ -849,14 +849,14 @@ static void sdma_v2_4_vm_set_pte_pde(struct amdgpu_ib *ib, | |||
849 | } | 849 | } |
850 | 850 | ||
851 | /** | 851 | /** |
852 | * sdma_v2_4_vm_pad_ib - pad the IB to the required number of dw | 852 | * sdma_v2_4_ring_pad_ib - pad the IB to the required number of dw |
853 | * | 853 | * |
854 | * @ib: indirect buffer to fill with padding | 854 | * @ib: indirect buffer to fill with padding |
855 | * | 855 | * |
856 | */ | 856 | */ |
857 | static void sdma_v2_4_vm_pad_ib(struct amdgpu_ib *ib) | 857 | static void sdma_v2_4_ring_pad_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib) |
858 | { | 858 | { |
859 | struct amdgpu_sdma_instance *sdma = amdgpu_get_sdma_instance(ib->ring); | 859 | struct amdgpu_sdma_instance *sdma = amdgpu_get_sdma_instance(ring); |
860 | u32 pad_count; | 860 | u32 pad_count; |
861 | int i; | 861 | int i; |
862 | 862 | ||
@@ -1275,6 +1275,7 @@ static const struct amdgpu_ring_funcs sdma_v2_4_ring_funcs = { | |||
1275 | .test_ring = sdma_v2_4_ring_test_ring, | 1275 | .test_ring = sdma_v2_4_ring_test_ring, |
1276 | .test_ib = sdma_v2_4_ring_test_ib, | 1276 | .test_ib = sdma_v2_4_ring_test_ib, |
1277 | .insert_nop = sdma_v2_4_ring_insert_nop, | 1277 | .insert_nop = sdma_v2_4_ring_insert_nop, |
1278 | .pad_ib = sdma_v2_4_ring_pad_ib, | ||
1278 | }; | 1279 | }; |
1279 | 1280 | ||
1280 | static void sdma_v2_4_set_ring_funcs(struct amdgpu_device *adev) | 1281 | static void sdma_v2_4_set_ring_funcs(struct amdgpu_device *adev) |
@@ -1372,7 +1373,6 @@ static const struct amdgpu_vm_pte_funcs sdma_v2_4_vm_pte_funcs = { | |||
1372 | .copy_pte = sdma_v2_4_vm_copy_pte, | 1373 | .copy_pte = sdma_v2_4_vm_copy_pte, |
1373 | .write_pte = sdma_v2_4_vm_write_pte, | 1374 | .write_pte = sdma_v2_4_vm_write_pte, |
1374 | .set_pte_pde = sdma_v2_4_vm_set_pte_pde, | 1375 | .set_pte_pde = sdma_v2_4_vm_set_pte_pde, |
1375 | .pad_ib = sdma_v2_4_vm_pad_ib, | ||
1376 | }; | 1376 | }; |
1377 | 1377 | ||
1378 | static void sdma_v2_4_set_vm_pte_funcs(struct amdgpu_device *adev) | 1378 | static void sdma_v2_4_set_vm_pte_funcs(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c index 7af4b57ad3d4..999a169299f0 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | |||
@@ -999,14 +999,14 @@ static void sdma_v3_0_vm_set_pte_pde(struct amdgpu_ib *ib, | |||
999 | } | 999 | } |
1000 | 1000 | ||
1001 | /** | 1001 | /** |
1002 | * sdma_v3_0_vm_pad_ib - pad the IB to the required number of dw | 1002 | * sdma_v3_0_ring_pad_ib - pad the IB to the required number of dw |
1003 | * | 1003 | * |
1004 | * @ib: indirect buffer to fill with padding | 1004 | * @ib: indirect buffer to fill with padding |
1005 | * | 1005 | * |
1006 | */ | 1006 | */ |
1007 | static void sdma_v3_0_vm_pad_ib(struct amdgpu_ib *ib) | 1007 | static void sdma_v3_0_ring_pad_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib) |
1008 | { | 1008 | { |
1009 | struct amdgpu_sdma_instance *sdma = amdgpu_get_sdma_instance(ib->ring); | 1009 | struct amdgpu_sdma_instance *sdma = amdgpu_get_sdma_instance(ring); |
1010 | u32 pad_count; | 1010 | u32 pad_count; |
1011 | int i; | 1011 | int i; |
1012 | 1012 | ||
@@ -1542,6 +1542,7 @@ static const struct amdgpu_ring_funcs sdma_v3_0_ring_funcs = { | |||
1542 | .test_ring = sdma_v3_0_ring_test_ring, | 1542 | .test_ring = sdma_v3_0_ring_test_ring, |
1543 | .test_ib = sdma_v3_0_ring_test_ib, | 1543 | .test_ib = sdma_v3_0_ring_test_ib, |
1544 | .insert_nop = sdma_v3_0_ring_insert_nop, | 1544 | .insert_nop = sdma_v3_0_ring_insert_nop, |
1545 | .pad_ib = sdma_v3_0_ring_pad_ib, | ||
1545 | }; | 1546 | }; |
1546 | 1547 | ||
1547 | static void sdma_v3_0_set_ring_funcs(struct amdgpu_device *adev) | 1548 | static void sdma_v3_0_set_ring_funcs(struct amdgpu_device *adev) |
@@ -1639,7 +1640,6 @@ static const struct amdgpu_vm_pte_funcs sdma_v3_0_vm_pte_funcs = { | |||
1639 | .copy_pte = sdma_v3_0_vm_copy_pte, | 1640 | .copy_pte = sdma_v3_0_vm_copy_pte, |
1640 | .write_pte = sdma_v3_0_vm_write_pte, | 1641 | .write_pte = sdma_v3_0_vm_write_pte, |
1641 | .set_pte_pde = sdma_v3_0_vm_set_pte_pde, | 1642 | .set_pte_pde = sdma_v3_0_vm_set_pte_pde, |
1642 | .pad_ib = sdma_v3_0_vm_pad_ib, | ||
1643 | }; | 1643 | }; |
1644 | 1644 | ||
1645 | static void sdma_v3_0_set_vm_pte_funcs(struct amdgpu_device *adev) | 1645 | static void sdma_v3_0_set_vm_pte_funcs(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c index e7a141c75467..d50679222b65 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | |||
@@ -858,6 +858,7 @@ static const struct amdgpu_ring_funcs uvd_v4_2_ring_funcs = { | |||
858 | .test_ring = uvd_v4_2_ring_test_ring, | 858 | .test_ring = uvd_v4_2_ring_test_ring, |
859 | .test_ib = uvd_v4_2_ring_test_ib, | 859 | .test_ib = uvd_v4_2_ring_test_ib, |
860 | .insert_nop = amdgpu_ring_insert_nop, | 860 | .insert_nop = amdgpu_ring_insert_nop, |
861 | .pad_ib = amdgpu_ring_generic_pad_ib, | ||
861 | }; | 862 | }; |
862 | 863 | ||
863 | static void uvd_v4_2_set_ring_funcs(struct amdgpu_device *adev) | 864 | static void uvd_v4_2_set_ring_funcs(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c index 3775f7756cf2..e3e7136dfd78 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | |||
@@ -797,6 +797,7 @@ static const struct amdgpu_ring_funcs uvd_v5_0_ring_funcs = { | |||
797 | .test_ring = uvd_v5_0_ring_test_ring, | 797 | .test_ring = uvd_v5_0_ring_test_ring, |
798 | .test_ib = uvd_v5_0_ring_test_ib, | 798 | .test_ib = uvd_v5_0_ring_test_ib, |
799 | .insert_nop = amdgpu_ring_insert_nop, | 799 | .insert_nop = amdgpu_ring_insert_nop, |
800 | .pad_ib = amdgpu_ring_generic_pad_ib, | ||
800 | }; | 801 | }; |
801 | 802 | ||
802 | static void uvd_v5_0_set_ring_funcs(struct amdgpu_device *adev) | 803 | static void uvd_v5_0_set_ring_funcs(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c index 0b2fccad8e9a..aa536076e695 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | |||
@@ -1038,6 +1038,7 @@ static const struct amdgpu_ring_funcs uvd_v6_0_ring_funcs = { | |||
1038 | .test_ring = uvd_v6_0_ring_test_ring, | 1038 | .test_ring = uvd_v6_0_ring_test_ring, |
1039 | .test_ib = uvd_v6_0_ring_test_ib, | 1039 | .test_ib = uvd_v6_0_ring_test_ib, |
1040 | .insert_nop = amdgpu_ring_insert_nop, | 1040 | .insert_nop = amdgpu_ring_insert_nop, |
1041 | .pad_ib = amdgpu_ring_generic_pad_ib, | ||
1041 | }; | 1042 | }; |
1042 | 1043 | ||
1043 | static void uvd_v6_0_set_ring_funcs(struct amdgpu_device *adev) | 1044 | static void uvd_v6_0_set_ring_funcs(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c index 45084458a23e..9c804f436974 100644 --- a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | |||
@@ -642,6 +642,7 @@ static const struct amdgpu_ring_funcs vce_v2_0_ring_funcs = { | |||
642 | .test_ring = amdgpu_vce_ring_test_ring, | 642 | .test_ring = amdgpu_vce_ring_test_ring, |
643 | .test_ib = amdgpu_vce_ring_test_ib, | 643 | .test_ib = amdgpu_vce_ring_test_ib, |
644 | .insert_nop = amdgpu_ring_insert_nop, | 644 | .insert_nop = amdgpu_ring_insert_nop, |
645 | .pad_ib = amdgpu_ring_generic_pad_ib, | ||
645 | }; | 646 | }; |
646 | 647 | ||
647 | static void vce_v2_0_set_ring_funcs(struct amdgpu_device *adev) | 648 | static void vce_v2_0_set_ring_funcs(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c index e2e6cff811d5..8f8d479061f8 100644 --- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | |||
@@ -762,6 +762,7 @@ static const struct amdgpu_ring_funcs vce_v3_0_ring_funcs = { | |||
762 | .test_ring = amdgpu_vce_ring_test_ring, | 762 | .test_ring = amdgpu_vce_ring_test_ring, |
763 | .test_ib = amdgpu_vce_ring_test_ib, | 763 | .test_ib = amdgpu_vce_ring_test_ib, |
764 | .insert_nop = amdgpu_ring_insert_nop, | 764 | .insert_nop = amdgpu_ring_insert_nop, |
765 | .pad_ib = amdgpu_ring_generic_pad_ib, | ||
765 | }; | 766 | }; |
766 | 767 | ||
767 | static void vce_v3_0_set_ring_funcs(struct amdgpu_device *adev) | 768 | static void vce_v3_0_set_ring_funcs(struct amdgpu_device *adev) |