diff options
author | Chunming Zhou <david1.zhou@amd.com> | 2018-04-16 06:27:50 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-15 14:43:28 -0400 |
commit | 3216c6b71d1e6a7dce2fd29c531e8c99c1b88c95 (patch) | |
tree | 5c073e948136a4be7a70c64da3d97968747d9aa1 /drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | |
parent | a906dbb1e20f5791d728c7d9e2366b8acb4f1bb2 (diff) |
drm/amdgpu: use amdgpu_bo_param for amdgpu_bo_create v2
After that, we can easily add new parameter when need.
v2:
a) rebase.
b) Initialize struct amdgpu_bo_param, future new
member could only be used in some one case, but all member
should have its own initial value.
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com> (v1)
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Cc: christian.koenig@amd.com
Cc: Felix.Kuehling@amd.com
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c index 02b849be083b..19cfff31f2e1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | |||
@@ -75,13 +75,20 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size, | |||
75 | { | 75 | { |
76 | struct amdgpu_bo *dobj = NULL; | 76 | struct amdgpu_bo *dobj = NULL; |
77 | struct amdgpu_bo *sobj = NULL; | 77 | struct amdgpu_bo *sobj = NULL; |
78 | struct amdgpu_bo_param bp; | ||
78 | uint64_t saddr, daddr; | 79 | uint64_t saddr, daddr; |
79 | int r, n; | 80 | int r, n; |
80 | int time; | 81 | int time; |
81 | 82 | ||
83 | memset(&bp, 0, sizeof(bp)); | ||
84 | bp.size = size; | ||
85 | bp.byte_align = PAGE_SIZE; | ||
86 | bp.domain = sdomain; | ||
87 | bp.flags = 0; | ||
88 | bp.type = ttm_bo_type_kernel; | ||
89 | bp.resv = NULL; | ||
82 | n = AMDGPU_BENCHMARK_ITERATIONS; | 90 | n = AMDGPU_BENCHMARK_ITERATIONS; |
83 | r = amdgpu_bo_create(adev, size, PAGE_SIZE,sdomain, 0, | 91 | r = amdgpu_bo_create(adev, &bp, &sobj); |
84 | ttm_bo_type_kernel, NULL, &sobj); | ||
85 | if (r) { | 92 | if (r) { |
86 | goto out_cleanup; | 93 | goto out_cleanup; |
87 | } | 94 | } |
@@ -93,8 +100,8 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size, | |||
93 | if (r) { | 100 | if (r) { |
94 | goto out_cleanup; | 101 | goto out_cleanup; |
95 | } | 102 | } |
96 | r = amdgpu_bo_create(adev, size, PAGE_SIZE, ddomain, 0, | 103 | bp.domain = ddomain; |
97 | ttm_bo_type_kernel, NULL, &dobj); | 104 | r = amdgpu_bo_create(adev, &bp, &dobj); |
98 | if (r) { | 105 | if (r) { |
99 | goto out_cleanup; | 106 | goto out_cleanup; |
100 | } | 107 | } |