summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-05-29 16:35:57 -0700
committerEric Anholt <eric@anholt.net>2015-06-04 14:15:39 -0700
commita7b0de93b1ecec6219e675a2c43cfb70800f2efd (patch)
tree032c0b8d1ab5c018db2371af4e3f57a6067c3fbc
parentca280a9022d3932fbd301a220e04517024f6af5d (diff)
downloadlinux-a7b0de93b1ecec6219e675a2c43cfb70800f2efd.tar.gz
drm/vc4: Use the power-of-two divider round_up instead of roundup.
This avoids generating a uidiv, and saves us another ~.6% in check_tex_size as a result of loadstore_tile_buffer_general. Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r--drivers/gpu/drm/vc4/vc4_validate.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c
index 73c4c686498f..04e7d67f8f27 100644
--- a/drivers/gpu/drm/vc4/vc4_validate.c
+++ b/drivers/gpu/drm/vc4/vc4_validate.c
@@ -170,16 +170,16 @@ check_tex_size(struct vc4_exec_info *exec, struct drm_gem_cma_object *fbo,
switch (tiling_format) {
case VC4_TILING_FORMAT_LINEAR:
- aligned_width = roundup(width, utile_w);
+ aligned_width = round_up(width, utile_w);
aligned_height = height;
break;
case VC4_TILING_FORMAT_T:
- aligned_width = roundup(width, utile_w * 8);
- aligned_height = roundup(height, utile_h * 8);
+ aligned_width = round_up(width, utile_w * 8);
+ aligned_height = round_up(height, utile_h * 8);
break;
case VC4_TILING_FORMAT_LT:
- aligned_width = roundup(width, utile_w);
- aligned_height = roundup(height, utile_h);
+ aligned_width = round_up(width, utile_w);
+ aligned_height = round_up(height, utile_h);
break;
default:
DRM_ERROR("buffer tiling %d unsupported\n", tiling_format);
@@ -927,15 +927,15 @@ reloc_tex(struct vc4_exec_info *exec,
switch (tiling_format) {
case VC4_TILING_FORMAT_T:
- aligned_width = roundup(level_width, utile_w * 8);
- aligned_height = roundup(level_height, utile_h * 8);
+ aligned_width = round_up(level_width, utile_w * 8);
+ aligned_height = round_up(level_height, utile_h * 8);
break;
case VC4_TILING_FORMAT_LT:
- aligned_width = roundup(level_width, utile_w);
- aligned_height = roundup(level_height, utile_h);
+ aligned_width = round_up(level_width, utile_w);
+ aligned_height = round_up(level_height, utile_h);
break;
default:
- aligned_width = roundup(level_width, utile_w);
+ aligned_width = round_up(level_width, utile_w);
aligned_height = level_height;
break;
}