diff options
author | Christian König <christian.koenig@amd.com> | 2018-07-18 05:16:35 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-07-25 16:06:13 -0400 |
commit | bf314ca3f10d4ba4335808dc678631908881db8b (patch) | |
tree | 36e66a47cb29c7f379430b6221657f71bb402cb6 /drivers/gpu/drm/amd/amdgpu | |
parent | c704ab18e0a26a5dc7e947af6e8e01585380518b (diff) |
drm/amdgpu: reduce the number of placements for a BO
Make struct amdgpu_bo a bit smaller.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 7b3398c337f1..21bfa2d8039e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -216,6 +216,8 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain) | |||
216 | c++; | 216 | c++; |
217 | } | 217 | } |
218 | 218 | ||
219 | BUG_ON(c >= AMDGPU_BO_MAX_PLACEMENTS); | ||
220 | |||
219 | placement->num_placement = c; | 221 | placement->num_placement = c; |
220 | placement->placement = places; | 222 | placement->placement = places; |
221 | 223 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h index 345fcd176992..18945dd6982d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "amdgpu.h" | 32 | #include "amdgpu.h" |
33 | 33 | ||
34 | #define AMDGPU_BO_INVALID_OFFSET LONG_MAX | 34 | #define AMDGPU_BO_INVALID_OFFSET LONG_MAX |
35 | #define AMDGPU_BO_MAX_PLACEMENTS 3 | ||
35 | 36 | ||
36 | struct amdgpu_bo_param { | 37 | struct amdgpu_bo_param { |
37 | unsigned long size; | 38 | unsigned long size; |
@@ -77,7 +78,7 @@ struct amdgpu_bo { | |||
77 | /* Protected by tbo.reserved */ | 78 | /* Protected by tbo.reserved */ |
78 | u32 preferred_domains; | 79 | u32 preferred_domains; |
79 | u32 allowed_domains; | 80 | u32 allowed_domains; |
80 | struct ttm_place placements[AMDGPU_GEM_DOMAIN_MAX + 1]; | 81 | struct ttm_place placements[AMDGPU_BO_MAX_PLACEMENTS]; |
81 | struct ttm_placement placement; | 82 | struct ttm_placement placement; |
82 | struct ttm_buffer_object tbo; | 83 | struct ttm_buffer_object tbo; |
83 | struct ttm_bo_kmap_obj kmap; | 84 | struct ttm_bo_kmap_obj kmap; |