summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_gmem.c
diff options
context:
space:
mode:
authorRob Clark <Rob Clark [email protected]>2013-04-22 13:55:14 -0400
committerRob Clark <[email protected]>2013-04-24 21:09:46 -0400
commiteec37f1cdc1651588a4fcd5e87b57d85a57e431f (patch)
tree7bddf5398cb89a8c7d508cefe6d036bb7b183445 /src/gallium/drivers/freedreno/freedreno_gmem.c
parent38d8b02eba9aea5b1ce61e8fc949163debda5cd7 (diff)
freedreno: use u_math macros/helpers more
Get rid of a few self-defined macros: ALIGN() -> align() min() -> MIN2() max() -> MAX2() Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_gmem.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_gmem.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c
index 42eac72f372..a6925a55731 100644
--- a/src/gallium/drivers/freedreno/freedreno_gmem.c
+++ b/src/gallium/drivers/freedreno/freedreno_gmem.c
@@ -370,22 +370,22 @@ calculate_tiles(struct fd_context *ctx)
max_width = 256;
// }
- bin_w = ALIGN(width, 32);
- bin_h = ALIGN(height, 32);
+ bin_w = align(width, 32);
+ bin_h = align(height, 32);
/* first, find a bin width that satisfies the maximum width
* restrictions:
*/
while (bin_w > max_width) {
nbins_x++;
- bin_w = ALIGN(width / nbins_x, 32);
+ bin_w = align(width / nbins_x, 32);
}
/* then find a bin height that satisfies the memory constraints:
*/
while ((bin_w * bin_h * cpp) > gmem_size) {
nbins_y++;
- bin_h = ALIGN(height / nbins_y, 32);
+ bin_h = align(height / nbins_y, 32);
}
DBG("using %d bins of size %dx%d", nbins_x*nbins_y, bin_w, bin_h);
@@ -431,7 +431,7 @@ fd_gmem_render_tiles(struct pipe_context *pctx)
OUT_RING(ring, gmem->bin_w); /* RB_SURFACE_INFO */
OUT_RING(ring, A2XX_RB_COLOR_INFO_SWAP(1) | /* RB_COLOR_INFO */
A2XX_RB_COLOR_INFO_FORMAT(colorformatx));
- reg = A2XX_RB_DEPTH_INFO_DEPTH_BASE(ALIGN(gmem->bin_w * gmem->bin_h, 4));
+ reg = A2XX_RB_DEPTH_INFO_DEPTH_BASE(align(gmem->bin_w * gmem->bin_h, 4));
if (pfb->zsbuf)
reg |= A2XX_RB_DEPTH_INFO_DEPTH_FORMAT(fd_pipe2depth(pfb->zsbuf->format));
OUT_RING(ring, reg); /* RB_DEPTH_INFO */
@@ -442,13 +442,13 @@ fd_gmem_render_tiles(struct pipe_context *pctx)
uint32_t bh = gmem->bin_h;
/* clip bin height: */
- bh = min(bh, gmem->height - yoff);
+ bh = MIN2(bh, gmem->height - yoff);
for (j = 0; j < gmem->nbins_x; j++) {
uint32_t bw = gmem->bin_w;
/* clip bin width: */
- bw = min(bw, gmem->width - xoff);
+ bw = MIN2(bw, gmem->width - xoff);
DBG("bin_h=%d, yoff=%d, bin_w=%d, xoff=%d",
bh, yoff, bw, xoff);