diff options
author | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-09-19 16:42:29 -0700 |
---|---|---|
committer | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-09-19 18:25:01 -0700 |
commit | 5f5bf25af5c4abeeb2f47f46e9efeeb4f8353b28 (patch) | |
tree | b5ff3f123425fc1a648177e80a3b0c5e0d5b4c76 /src | |
parent | 8d1ec80319bad197665f42b77786b94c3e9337f1 (diff) |
r600g: Use align() instead of handrolled code.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/r600/eg_hw_states.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_hw_states.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_state2.c | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/src/gallium/drivers/r600/eg_hw_states.c b/src/gallium/drivers/r600/eg_hw_states.c index 65a5c6434b3..e8cf577c76f 100644 --- a/src/gallium/drivers/r600/eg_hw_states.c +++ b/src/gallium/drivers/r600/eg_hw_states.c @@ -559,8 +559,7 @@ static void eg_resource(struct pipe_context *ctx, struct radeon_state *rstate, rstate->placement[2] = RADEON_GEM_DOMAIN_GTT; rstate->placement[3] = RADEON_GEM_DOMAIN_GTT; - pitch = (tmp->pitch[0] / tmp->bpt); - pitch = (pitch + 0x7) & ~0x7; + pitch = align(tmp->pitch[0] / tmp->bpt, 8); /* FIXME properly handle first level != 0 */ rstate->states[EG_PS_RESOURCE__RESOURCE0_WORD0] = diff --git a/src/gallium/drivers/r600/r600_hw_states.c b/src/gallium/drivers/r600/r600_hw_states.c index 5e43085c620..627a820d59a 100644 --- a/src/gallium/drivers/r600/r600_hw_states.c +++ b/src/gallium/drivers/r600/r600_hw_states.c @@ -558,8 +558,7 @@ static void r600_resource(struct pipe_context *ctx, struct radeon_state *rstate, rstate->placement[2] = RADEON_GEM_DOMAIN_GTT; rstate->placement[3] = RADEON_GEM_DOMAIN_GTT; - pitch = (tmp->pitch[0] / tmp->bpt); - pitch = (pitch + 0x7) & ~0x7; + pitch = align(tmp->pitch[0] / tmp->bpt, 8); /* FIXME properly handle first level != 0 */ rstate->states[R600_PS_RESOURCE__RESOURCE0_WORD0] = diff --git a/src/gallium/drivers/r600/r600_state2.c b/src/gallium/drivers/r600/r600_state2.c index 86c10a877dd..38fab4bbb6d 100644 --- a/src/gallium/drivers/r600/r600_state2.c +++ b/src/gallium/drivers/r600/r600_state2.c @@ -1218,8 +1218,7 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c bo[1] = radeon_ws_bo_incref(rscreen->rw, tmp->uncompressed); #endif } - pitch = (tmp->pitch[0] / tmp->bpt); - pitch = (pitch + 0x7) & ~0x7; + pitch = align(tmp->pitch[0] / tmp->bpt, 8); /* FIXME properly handle first level != 0 */ r600_pipe_state_add_reg(rstate, R600_GROUP_RESOURCE, R_038000_RESOURCE0_WORD0, |