diff options
author | Jammy Zhou <Jammy.Zhou@amd.com> | 2015-05-11 11:41:41 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-06-03 21:03:30 -0400 |
commit | de807f818b953f11b9a132a2d1997711a79bbfa3 (patch) | |
tree | 819e5dbdf62a407a56b456a0fddee04acafbc70d /drivers/gpu/drm | |
parent | 72efa7ebdea084b96f25021d0ba9c29074c2906f (diff) |
drm/amdgpu: add flags for amdgpu_ib structure
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 4 | ||||
-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 |
5 files changed, 7 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index a88302c0c93a..aaa62f33870f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -892,13 +892,12 @@ struct amdgpu_ib { | |||
892 | struct amdgpu_fence *fence; | 892 | struct amdgpu_fence *fence; |
893 | struct amdgpu_user_fence *user; | 893 | struct amdgpu_user_fence *user; |
894 | struct amdgpu_vm *vm; | 894 | struct amdgpu_vm *vm; |
895 | bool is_const_ib; | ||
896 | bool flush_hdp_writefifo; | 895 | bool flush_hdp_writefifo; |
897 | struct amdgpu_sync sync; | 896 | struct amdgpu_sync sync; |
898 | bool gds_needed; | ||
899 | uint32_t gds_base, gds_size; | 897 | uint32_t gds_base, gds_size; |
900 | uint32_t gws_base, gws_size; | 898 | uint32_t gws_base, gws_size; |
901 | uint32_t oa_base, oa_size; | 899 | uint32_t oa_base, oa_size; |
900 | uint32_t flags; | ||
902 | }; | 901 | }; |
903 | 902 | ||
904 | enum amdgpu_ring_type { | 903 | enum amdgpu_ring_type { |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 1035e443700f..de17f845a84b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -638,10 +638,8 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev, | |||
638 | } | 638 | } |
639 | ib->length_dw = chunk_ib->ib_bytes / 4; | 639 | ib->length_dw = chunk_ib->ib_bytes / 4; |
640 | 640 | ||
641 | if (chunk_ib->flags & AMDGPU_IB_FLAG_CE) | 641 | ib->flags = chunk_ib->flags; |
642 | ib->is_const_ib = true; | 642 | |
643 | if (chunk_ib->flags & AMDGPU_IB_FLAG_GDS) | ||
644 | ib->gds_needed = true; | ||
645 | if ((ib->ring->current_filp != parser->filp) || | 643 | if ((ib->ring->current_filp != parser->filp) || |
646 | (ib->ring->current_ctx != parser->ctx_id)) { | 644 | (ib->ring->current_ctx != parser->ctx_id)) { |
647 | ib->ring->need_ctx_switch = true; | 645 | ib->ring->need_ctx_switch = true; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 847cab2b3fff..a83ff03ffc80 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | |||
@@ -88,13 +88,13 @@ int amdgpu_ib_get(struct amdgpu_ring *ring, struct amdgpu_vm *vm, | |||
88 | ib->fence = NULL; | 88 | ib->fence = NULL; |
89 | ib->user = NULL; | 89 | ib->user = NULL; |
90 | ib->vm = vm; | 90 | ib->vm = vm; |
91 | ib->is_const_ib = false; | ||
92 | ib->gds_base = 0; | 91 | ib->gds_base = 0; |
93 | ib->gds_size = 0; | 92 | ib->gds_size = 0; |
94 | ib->gws_base = 0; | 93 | ib->gws_base = 0; |
95 | ib->gws_size = 0; | 94 | ib->gws_size = 0; |
96 | ib->oa_base = 0; | 95 | ib->oa_base = 0; |
97 | ib->oa_size = 0; | 96 | ib->oa_size = 0; |
97 | ib->flags = 0; | ||
98 | 98 | ||
99 | return 0; | 99 | return 0; |
100 | } | 100 | } |
@@ -179,7 +179,7 @@ int amdgpu_ib_schedule(struct amdgpu_device *adev, unsigned num_ibs, | |||
179 | amdgpu_vm_flush(ring, vm, ib->sync.last_vm_update); | 179 | amdgpu_vm_flush(ring, vm, ib->sync.last_vm_update); |
180 | } | 180 | } |
181 | 181 | ||
182 | if (ring->funcs->emit_gds_switch && ib->vm && ib->gds_needed) | 182 | if (ring->funcs->emit_gds_switch && ib->vm && (ib->flags & AMDGPU_IB_FLAG_GDS)) |
183 | amdgpu_ring_emit_gds_switch(ring, ib->vm->ids[ring->idx].id, | 183 | amdgpu_ring_emit_gds_switch(ring, ib->vm->ids[ring->idx].id, |
184 | ib->gds_base, ib->gds_size, | 184 | ib->gds_base, ib->gds_size, |
185 | ib->gws_base, ib->gws_size, | 185 | ib->gws_base, ib->gws_size, |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c index 26df23eaf09e..7428c4305418 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | |||
@@ -2544,7 +2544,7 @@ static void gfx_v7_0_ring_emit_ib(struct amdgpu_ring *ring, | |||
2544 | ring->need_ctx_switch = false; | 2544 | ring->need_ctx_switch = false; |
2545 | } | 2545 | } |
2546 | 2546 | ||
2547 | if (ib->is_const_ib) | 2547 | if (ib->flags & AMDGPU_IB_FLAG_CE) |
2548 | header = PACKET3(PACKET3_INDIRECT_BUFFER_CONST, 2); | 2548 | header = PACKET3(PACKET3_INDIRECT_BUFFER_CONST, 2); |
2549 | else | 2549 | else |
2550 | header = PACKET3(PACKET3_INDIRECT_BUFFER, 2); | 2550 | header = PACKET3(PACKET3_INDIRECT_BUFFER, 2); |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 3762998df351..48de9204ff5e 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -3673,7 +3673,7 @@ static void gfx_v8_0_ring_emit_ib(struct amdgpu_ring *ring, | |||
3673 | ring->need_ctx_switch = false; | 3673 | ring->need_ctx_switch = false; |
3674 | } | 3674 | } |
3675 | 3675 | ||
3676 | if (ib->is_const_ib) | 3676 | if (ib->flags & AMDGPU_IB_FLAG_CE) |
3677 | header = PACKET3(PACKET3_INDIRECT_BUFFER_CONST, 2); | 3677 | header = PACKET3(PACKET3_INDIRECT_BUFFER_CONST, 2); |
3678 | else | 3678 | else |
3679 | header = PACKET3(PACKET3_INDIRECT_BUFFER, 2); | 3679 | header = PACKET3(PACKET3_INDIRECT_BUFFER, 2); |