diff options
| author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2016-03-04 05:52:18 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-03-04 16:10:36 -0500 |
| commit | 166cc7136752192bb6e1f2be2e56614762292a00 (patch) | |
| tree | d6dbfc8f140dc32263fb37cd4b8d738ae136504a /drivers/gpu/drm/vmwgfx/device_include | |
| parent | 28466e0f2463a1084781c9312cd9148b2530eea7 (diff) | |
drm/vmwgfx: remove userland definition of DIV_ROUND_UP
Let's use __KERNEL_DIV_ROUND_UP, which is defined in uapi/linux/kernel.h.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/device_include')
| -rw-r--r-- | drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h b/drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h index 58704f0a4607..531d22025fec 100644 --- a/drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h +++ b/drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h | |||
| @@ -25,6 +25,8 @@ | |||
| 25 | * | 25 | * |
| 26 | **************************************************************************/ | 26 | **************************************************************************/ |
| 27 | 27 | ||
| 28 | #include <linux/kernel.h> | ||
| 29 | |||
| 28 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
| 29 | 31 | ||
| 30 | #include <drm/vmwgfx_drm.h> | 32 | #include <drm/vmwgfx_drm.h> |
| @@ -36,7 +38,6 @@ | |||
| 36 | #define ARRAY_SIZE(_A) (sizeof(_A) / sizeof((_A)[0])) | 38 | #define ARRAY_SIZE(_A) (sizeof(_A) / sizeof((_A)[0])) |
| 37 | #endif /* ARRAY_SIZE */ | 39 | #endif /* ARRAY_SIZE */ |
| 38 | 40 | ||
| 39 | #define DIV_ROUND_UP(x, y) (((x) + (y) - 1) / (y)) | ||
| 40 | #define max_t(type, x, y) ((x) > (y) ? (x) : (y)) | 41 | #define max_t(type, x, y) ((x) > (y) ? (x) : (y)) |
| 41 | #define surf_size_struct SVGA3dSize | 42 | #define surf_size_struct SVGA3dSize |
| 42 | #define u32 uint32 | 43 | #define u32 uint32 |
| @@ -987,12 +988,12 @@ svga3dsurface_get_size_in_blocks(const struct svga3d_surface_desc *desc, | |||
| 987 | const surf_size_struct *pixel_size, | 988 | const surf_size_struct *pixel_size, |
| 988 | surf_size_struct *block_size) | 989 | surf_size_struct *block_size) |
| 989 | { | 990 | { |
| 990 | block_size->width = DIV_ROUND_UP(pixel_size->width, | 991 | block_size->width = __KERNEL_DIV_ROUND_UP(pixel_size->width, |
| 991 | desc->block_size.width); | 992 | desc->block_size.width); |
| 992 | block_size->height = DIV_ROUND_UP(pixel_size->height, | 993 | block_size->height = __KERNEL_DIV_ROUND_UP(pixel_size->height, |
| 993 | desc->block_size.height); | 994 | desc->block_size.height); |
| 994 | block_size->depth = DIV_ROUND_UP(pixel_size->depth, | 995 | block_size->depth = __KERNEL_DIV_ROUND_UP(pixel_size->depth, |
| 995 | desc->block_size.depth); | 996 | desc->block_size.depth); |
| 996 | } | 997 | } |
| 997 | 998 | ||
| 998 | static inline bool | 999 | static inline bool |
| @@ -1100,8 +1101,9 @@ svga3dsurface_get_pixel_offset(SVGA3dSurfaceFormat format, | |||
| 1100 | const struct svga3d_surface_desc *desc = svga3dsurface_get_desc(format); | 1101 | const struct svga3d_surface_desc *desc = svga3dsurface_get_desc(format); |
| 1101 | const u32 bw = desc->block_size.width, bh = desc->block_size.height; | 1102 | const u32 bw = desc->block_size.width, bh = desc->block_size.height; |
| 1102 | const u32 bd = desc->block_size.depth; | 1103 | const u32 bd = desc->block_size.depth; |
| 1103 | const u32 rowstride = DIV_ROUND_UP(width, bw) * desc->bytes_per_block; | 1104 | const u32 rowstride = __KERNEL_DIV_ROUND_UP(width, bw) * |
| 1104 | const u32 imgstride = DIV_ROUND_UP(height, bh) * rowstride; | 1105 | desc->bytes_per_block; |
| 1106 | const u32 imgstride = __KERNEL_DIV_ROUND_UP(height, bh) * rowstride; | ||
| 1105 | const u32 offset = (z / bd * imgstride + | 1107 | const u32 offset = (z / bd * imgstride + |
| 1106 | y / bh * rowstride + | 1108 | y / bh * rowstride + |
| 1107 | x / bw * desc->bytes_per_block); | 1109 | x / bw * desc->bytes_per_block); |
