etnaviv: remove etna_align_up() function

It does the same thing as align() from u_math.h, no need to
have a etnaviv specific version.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17695>
This commit is contained in:
Lucas Stach 2022-07-21 21:50:37 +02:00 committed by Marge Bot
parent 89f77144d7
commit 00955a644e
2 changed files with 2 additions and 8 deletions

View File

@ -33,6 +33,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#include "util/u_inlines.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "hw/common.xml.h"
@ -170,7 +171,7 @@ etna_create_surface(struct pipe_context *pctx, struct pipe_resource *prsc,
.dest_tiling = ETNA_LAYOUT_TILED,
.dither = {0xffffffff, 0xffffffff},
.width = 16,
.height = etna_align_up(surf->surf.ts_size / 0x40, 4),
.height = align(surf->surf.ts_size / 0x40, 4),
.clear_value = {screen->specs.ts_clear_value},
.clear_mode = VIVS_RS_CLEAR_CONTROL_MODE_ENABLED1,
.clear_bits = 0xffff

View File

@ -30,13 +30,6 @@
/* for conditionally setting boolean flag(s): */
#define COND(bool, val) ((bool) ? (val) : 0)
/* align to a value divisable by granularity >= value, works only for powers of two */
static inline uint32_t
etna_align_up(uint32_t value, uint32_t granularity)
{
return (value + (granularity - 1)) & (~(granularity - 1));
}
/* clamped float [0.0 .. 1.0] -> [0 .. 255] */
static inline uint8_t
etna_cfloat_to_uint8(float f)