Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eab3de23 authored by Christian König's avatar Christian König Committed by Alex Deucher
Browse files

drm/amdgpu: explicit give BO type to amdgpu_bo_create



Drop the "kernel" and sg parameter and give the BO type to create
explicit to amdgpu_bo_create instead of figuring it out from the
parameters.

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarRoger He <Hongbo.He@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e3364dfc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -441,7 +441,7 @@ struct amdgpu_sa_bo {
void amdgpu_gem_force_release(struct amdgpu_device *adev);
int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size,
			     int alignment, u32 initial_domain,
			     u64 flags, bool kernel,
			     u64 flags, enum ttm_bo_type type,
			     struct reservation_object *resv,
			     struct drm_gem_object **obj);

+3 −2
Original line number Diff line number Diff line
@@ -221,8 +221,9 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
	uint64_t gpu_addr_tmp = 0;
	void *cpu_ptr_tmp = NULL;

	r = amdgpu_bo_create(adev, size, PAGE_SIZE, true, AMDGPU_GEM_DOMAIN_GTT,
			AMDGPU_GEM_CREATE_CPU_GTT_USWC, NULL, NULL, &bo);
	r = amdgpu_bo_create(adev, size, PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,
			     AMDGPU_GEM_CREATE_CPU_GTT_USWC, ttm_bo_type_kernel,
			     NULL, &bo);
	if (r) {
		dev_err(adev->dev,
			"failed to allocate BO for amdkfd (%d)\n", r);
+2 −2
Original line number Diff line number Diff line
@@ -997,8 +997,8 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
	pr_debug("\tcreate BO VA 0x%llx size 0x%llx domain %s\n",
			va, size, domain_string(alloc_domain));

	ret = amdgpu_bo_create(adev, size, byte_align, false,
				alloc_domain, alloc_flags, NULL, NULL, &bo);
	ret = amdgpu_bo_create(adev, size, byte_align,
				alloc_domain, alloc_flags, ttm_bo_type_device, NULL, &bo);
	if (ret) {
		pr_debug("Failed to create BO on domain %s. ret %d\n",
				domain_string(alloc_domain), ret);
+4 −4
Original line number Diff line number Diff line
@@ -80,8 +80,8 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
	int time;

	n = AMDGPU_BENCHMARK_ITERATIONS;
	r = amdgpu_bo_create(adev, size, PAGE_SIZE, true, sdomain, 0, NULL,
			     NULL, &sobj);
	r = amdgpu_bo_create(adev, size, PAGE_SIZE,sdomain, 0,
			     ttm_bo_type_kernel, NULL, &sobj);
	if (r) {
		goto out_cleanup;
	}
@@ -93,8 +93,8 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
	if (r) {
		goto out_cleanup;
	}
	r = amdgpu_bo_create(adev, size, PAGE_SIZE, true, ddomain, 0, NULL,
			     NULL, &dobj);
	r = amdgpu_bo_create(adev, size, PAGE_SIZE, ddomain, 0,
			     ttm_bo_type_kernel, NULL, &dobj);
	if (r) {
		goto out_cleanup;
	}
+4 −3
Original line number Diff line number Diff line
@@ -113,11 +113,12 @@ int amdgpu_gart_table_vram_alloc(struct amdgpu_device *adev)
	int r;

	if (adev->gart.robj == NULL) {
		r = amdgpu_bo_create(adev, adev->gart.table_size,
				     PAGE_SIZE, true, AMDGPU_GEM_DOMAIN_VRAM,
		r = amdgpu_bo_create(adev, adev->gart.table_size, PAGE_SIZE,
				     AMDGPU_GEM_DOMAIN_VRAM,
				     AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
				     AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS,
				     NULL, NULL, &adev->gart.robj);
				     ttm_bo_type_kernel, NULL,
				     &adev->gart.robj);
		if (r) {
			return r;
		}
Loading