diff options
author | Christian König <christian.koenig@amd.com> | 2016-01-31 06:29:04 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-10 14:17:20 -0500 |
commit | b07c60c0652c497af0c42c1278941f7c5a187fe9 (patch) | |
tree | d19e6dfc68fe4b25032c19ceae0e5be0f7e9c25d /drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | |
parent | 9e5d53094c5366a9a14e0694e45e794902cc2c04 (diff) |
drm/amdgpu: move ring from IBs into job
We can't submit to multiple rings at the same time anyway.
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index b6737707eda2..47196ec593fc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | |||
@@ -55,10 +55,9 @@ static int amdgpu_debugfs_sa_init(struct amdgpu_device *adev); | |||
55 | * suballocator. | 55 | * suballocator. |
56 | * Returns 0 on success, error on failure. | 56 | * Returns 0 on success, error on failure. |
57 | */ | 57 | */ |
58 | int amdgpu_ib_get(struct amdgpu_ring *ring, struct amdgpu_vm *vm, | 58 | int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, |
59 | unsigned size, struct amdgpu_ib *ib) | 59 | unsigned size, struct amdgpu_ib *ib) |
60 | { | 60 | { |
61 | struct amdgpu_device *adev = ring->adev; | ||
62 | int r; | 61 | int r; |
63 | 62 | ||
64 | if (size) { | 63 | if (size) { |
@@ -77,7 +76,6 @@ int amdgpu_ib_get(struct amdgpu_ring *ring, struct amdgpu_vm *vm, | |||
77 | 76 | ||
78 | amdgpu_sync_create(&ib->sync); | 77 | amdgpu_sync_create(&ib->sync); |
79 | 78 | ||
80 | ib->ring = ring; | ||
81 | ib->vm = vm; | 79 | ib->vm = vm; |
82 | 80 | ||
83 | return 0; | 81 | return 0; |
@@ -120,11 +118,11 @@ void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib) | |||
120 | * a CONST_IB), it will be put on the ring prior to the DE IB. Prior | 118 | * a CONST_IB), it will be put on the ring prior to the DE IB. Prior |
121 | * to SI there was just a DE IB. | 119 | * to SI there was just a DE IB. |
122 | */ | 120 | */ |
123 | int amdgpu_ib_schedule(struct amdgpu_device *adev, unsigned num_ibs, | 121 | int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, |
124 | struct amdgpu_ib *ibs, void *owner) | 122 | struct amdgpu_ib *ibs, void *owner) |
125 | { | 123 | { |
124 | struct amdgpu_device *adev = ring->adev; | ||
126 | struct amdgpu_ib *ib = &ibs[0]; | 125 | struct amdgpu_ib *ib = &ibs[0]; |
127 | struct amdgpu_ring *ring; | ||
128 | struct amdgpu_ctx *ctx, *old_ctx; | 126 | struct amdgpu_ctx *ctx, *old_ctx; |
129 | struct amdgpu_vm *vm; | 127 | struct amdgpu_vm *vm; |
130 | unsigned i; | 128 | unsigned i; |
@@ -133,7 +131,6 @@ int amdgpu_ib_schedule(struct amdgpu_device *adev, unsigned num_ibs, | |||
133 | if (num_ibs == 0) | 131 | if (num_ibs == 0) |
134 | return -EINVAL; | 132 | return -EINVAL; |
135 | 133 | ||
136 | ring = ibs->ring; | ||
137 | ctx = ibs->ctx; | 134 | ctx = ibs->ctx; |
138 | vm = ibs->vm; | 135 | vm = ibs->vm; |
139 | 136 | ||
@@ -178,7 +175,7 @@ int amdgpu_ib_schedule(struct amdgpu_device *adev, unsigned num_ibs, | |||
178 | for (i = 0; i < num_ibs; ++i) { | 175 | for (i = 0; i < num_ibs; ++i) { |
179 | ib = &ibs[i]; | 176 | ib = &ibs[i]; |
180 | 177 | ||
181 | if (ib->ring != ring || ib->ctx != ctx || ib->vm != vm) { | 178 | if (ib->ctx != ctx || ib->vm != vm) { |
182 | ring->current_ctx = old_ctx; | 179 | ring->current_ctx = old_ctx; |
183 | amdgpu_ring_undo(ring); | 180 | amdgpu_ring_undo(ring); |
184 | return -EINVAL; | 181 | return -EINVAL; |