diff options
author | Jack Xiao | 2015-05-07 03:07:03 -0500 |
---|---|---|
committer | Alex Deucher | 2015-08-05 12:47:49 -0500 |
commit | 7454779f9bc48827dfa6d4ce69ba88a544163fc1 (patch) | |
tree | aacce34cd9f9c70740aca0bd7589cedec630b43d /amdgpu/amdgpu_internal.h | |
parent | 14070057d8cb70a0574065b96e1f0d25f6d4c533 (diff) | |
download | external-libgbm-7454779f9bc48827dfa6d4ce69ba88a544163fc1.tar.gz external-libgbm-7454779f9bc48827dfa6d4ce69ba88a544163fc1.tar.xz external-libgbm-7454779f9bc48827dfa6d4ce69ba88a544163fc1.zip |
amdgpu: fix round down/up page size error
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Reviewed-by: Monk Liu monk.liu@amd.com
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_internal.h')
-rw-r--r-- | amdgpu/amdgpu_internal.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h index 9cb21566..cc911c5b 100644 --- a/amdgpu/amdgpu_internal.h +++ b/amdgpu/amdgpu_internal.h | |||
@@ -36,8 +36,9 @@ | |||
36 | 36 | ||
37 | #define AMDGPU_CS_MAX_RINGS 8 | 37 | #define AMDGPU_CS_MAX_RINGS 8 |
38 | /* do not use below macro if b is not power of 2 aligned value */ | 38 | /* do not use below macro if b is not power of 2 aligned value */ |
39 | #define ROUND_DOWN(a,b) ((a) & (~((b)-1))) | 39 | #define __round_mask(x, y) ((__typeof__(x))((y)-1)) |
40 | #define ROUND_UP(a,b) (((a)+((b)-1)) & (~((b)-1))) | 40 | #define ROUND_UP(x, y) ((((x)-1) | __round_mask(x, y))+1) |
41 | #define ROUND_DOWN(x, y) ((x) & ~__round_mask(x, y)) | ||
41 | 42 | ||
42 | struct amdgpu_bo_va_hole { | 43 | struct amdgpu_bo_va_hole { |
43 | struct list_head list; | 44 | struct list_head list; |