diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index e21e823f67a5..e30d3fda0f6d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
@@ -195,7 +195,7 @@ static int amdgpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, | |||
195 | static void amdgpu_evict_flags(struct ttm_buffer_object *bo, | 195 | static void amdgpu_evict_flags(struct ttm_buffer_object *bo, |
196 | struct ttm_placement *placement) | 196 | struct ttm_placement *placement) |
197 | { | 197 | { |
198 | struct amdgpu_bo *rbo; | 198 | struct amdgpu_bo *abo; |
199 | static struct ttm_place placements = { | 199 | static struct ttm_place placements = { |
200 | .fpfn = 0, | 200 | .fpfn = 0, |
201 | .lpfn = 0, | 201 | .lpfn = 0, |
@@ -210,43 +210,43 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, | |||
210 | placement->num_busy_placement = 1; | 210 | placement->num_busy_placement = 1; |
211 | return; | 211 | return; |
212 | } | 212 | } |
213 | rbo = container_of(bo, struct amdgpu_bo, tbo); | 213 | abo = container_of(bo, struct amdgpu_bo, tbo); |
214 | switch (bo->mem.mem_type) { | 214 | switch (bo->mem.mem_type) { |
215 | case TTM_PL_VRAM: | 215 | case TTM_PL_VRAM: |
216 | if (rbo->adev->mman.buffer_funcs_ring->ready == false) { | 216 | if (abo->adev->mman.buffer_funcs_ring->ready == false) { |
217 | amdgpu_ttm_placement_from_domain(rbo, AMDGPU_GEM_DOMAIN_CPU); | 217 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU); |
218 | } else { | 218 | } else { |
219 | amdgpu_ttm_placement_from_domain(rbo, AMDGPU_GEM_DOMAIN_GTT); | 219 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_GTT); |
220 | for (i = 0; i < rbo->placement.num_placement; ++i) { | 220 | for (i = 0; i < abo->placement.num_placement; ++i) { |
221 | if (!(rbo->placements[i].flags & | 221 | if (!(abo->placements[i].flags & |
222 | TTM_PL_FLAG_TT)) | 222 | TTM_PL_FLAG_TT)) |
223 | continue; | 223 | continue; |
224 | 224 | ||
225 | if (rbo->placements[i].lpfn) | 225 | if (abo->placements[i].lpfn) |
226 | continue; | 226 | continue; |
227 | 227 | ||
228 | /* set an upper limit to force directly | 228 | /* set an upper limit to force directly |
229 | * allocating address space for the BO. | 229 | * allocating address space for the BO. |
230 | */ | 230 | */ |
231 | rbo->placements[i].lpfn = | 231 | abo->placements[i].lpfn = |
232 | rbo->adev->mc.gtt_size >> PAGE_SHIFT; | 232 | abo->adev->mc.gtt_size >> PAGE_SHIFT; |
233 | } | 233 | } |
234 | } | 234 | } |
235 | break; | 235 | break; |
236 | case TTM_PL_TT: | 236 | case TTM_PL_TT: |
237 | default: | 237 | default: |
238 | amdgpu_ttm_placement_from_domain(rbo, AMDGPU_GEM_DOMAIN_CPU); | 238 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU); |
239 | } | 239 | } |
240 | *placement = rbo->placement; | 240 | *placement = abo->placement; |
241 | } | 241 | } |
242 | 242 | ||
243 | static int amdgpu_verify_access(struct ttm_buffer_object *bo, struct file *filp) | 243 | static int amdgpu_verify_access(struct ttm_buffer_object *bo, struct file *filp) |
244 | { | 244 | { |
245 | struct amdgpu_bo *rbo = container_of(bo, struct amdgpu_bo, tbo); | 245 | struct amdgpu_bo *abo = container_of(bo, struct amdgpu_bo, tbo); |
246 | 246 | ||
247 | if (amdgpu_ttm_tt_get_usermm(bo->ttm)) | 247 | if (amdgpu_ttm_tt_get_usermm(bo->ttm)) |
248 | return -EPERM; | 248 | return -EPERM; |
249 | return drm_vma_node_verify_access(&rbo->gem_base.vma_node, filp); | 249 | return drm_vma_node_verify_access(&abo->gem_base.vma_node, filp); |
250 | } | 250 | } |
251 | 251 | ||
252 | static void amdgpu_move_null(struct ttm_buffer_object *bo, | 252 | static void amdgpu_move_null(struct ttm_buffer_object *bo, |