aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-01-24 13:55:32 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-02-19 14:18:54 -0500
commit8febe617d8d9a3562895cb9bcb52fd1d0467fdef (patch)
tree31b44fe9e4b2c841be39dec1567291c27c90eca1 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parent4c77edbf742540216898a7acb3d46a69ed4508a1 (diff)
drm/amdgpu: revert "Add a parameter to amdgpu_bo_create()"
This reverts commit 2046d46db9166bddc84778f0b3477f6d1e9068ea. Not needed any more. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index f0a685340cd4..512612ec3557 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -190,7 +190,7 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
190 r = amdgpu_bo_create(adev, size, align, true, domain, 190 r = amdgpu_bo_create(adev, size, align, true, domain,
191 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED | 191 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
192 AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS, 192 AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS,
193 NULL, NULL, 0, bo_ptr); 193 NULL, NULL, bo_ptr);
194 if (r) { 194 if (r) {
195 dev_err(adev->dev, "(%d) failed to allocate kernel bo\n", 195 dev_err(adev->dev, "(%d) failed to allocate kernel bo\n",
196 r); 196 r);
@@ -336,7 +336,6 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
336 bool kernel, u32 domain, u64 flags, 336 bool kernel, u32 domain, u64 flags,
337 struct sg_table *sg, 337 struct sg_table *sg,
338 struct reservation_object *resv, 338 struct reservation_object *resv,
339 uint64_t init_value,
340 struct amdgpu_bo **bo_ptr) 339 struct amdgpu_bo **bo_ptr)
341{ 340{
342 struct ttm_operation_ctx ctx = { 341 struct ttm_operation_ctx ctx = {
@@ -443,7 +442,7 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
443 bo->tbo.mem.placement & TTM_PL_FLAG_VRAM) { 442 bo->tbo.mem.placement & TTM_PL_FLAG_VRAM) {
444 struct dma_fence *fence; 443 struct dma_fence *fence;
445 444
446 r = amdgpu_fill_buffer(bo, init_value, bo->tbo.resv, &fence); 445 r = amdgpu_fill_buffer(bo, 0, bo->tbo.resv, &fence);
447 if (unlikely(r)) 446 if (unlikely(r))
448 goto fail_unreserve; 447 goto fail_unreserve;
449 448
@@ -484,7 +483,7 @@ static int amdgpu_bo_create_shadow(struct amdgpu_device *adev,
484 AMDGPU_GEM_DOMAIN_GTT, 483 AMDGPU_GEM_DOMAIN_GTT,
485 AMDGPU_GEM_CREATE_CPU_GTT_USWC | 484 AMDGPU_GEM_CREATE_CPU_GTT_USWC |
486 AMDGPU_GEM_CREATE_SHADOW, 485 AMDGPU_GEM_CREATE_SHADOW,
487 NULL, bo->tbo.resv, 0, 486 NULL, bo->tbo.resv,
488 &bo->shadow); 487 &bo->shadow);
489 if (!r) { 488 if (!r) {
490 bo->shadow->parent = amdgpu_bo_ref(bo); 489 bo->shadow->parent = amdgpu_bo_ref(bo);
@@ -496,22 +495,18 @@ static int amdgpu_bo_create_shadow(struct amdgpu_device *adev,
496 return r; 495 return r;
497} 496}
498 497
499/* init_value will only take effect when flags contains
500 * AMDGPU_GEM_CREATE_VRAM_CLEARED.
501 */
502int amdgpu_bo_create(struct amdgpu_device *adev, 498int amdgpu_bo_create(struct amdgpu_device *adev,
503 unsigned long size, int byte_align, 499 unsigned long size, int byte_align,
504 bool kernel, u32 domain, u64 flags, 500 bool kernel, u32 domain, u64 flags,
505 struct sg_table *sg, 501 struct sg_table *sg,
506 struct reservation_object *resv, 502 struct reservation_object *resv,
507 uint64_t init_value,
508 struct amdgpu_bo **bo_ptr) 503 struct amdgpu_bo **bo_ptr)
509{ 504{
510 uint64_t parent_flags = flags & ~AMDGPU_GEM_CREATE_SHADOW; 505 uint64_t parent_flags = flags & ~AMDGPU_GEM_CREATE_SHADOW;
511 int r; 506 int r;
512 507
513 r = amdgpu_bo_do_create(adev, size, byte_align, kernel, domain, 508 r = amdgpu_bo_do_create(adev, size, byte_align, kernel, domain,
514 parent_flags, sg, resv, init_value, bo_ptr); 509 parent_flags, sg, resv, bo_ptr);
515 if (r) 510 if (r)
516 return r; 511 return r;
517 512