diff options
author | Ian Romanick <[email protected]> | 2017-11-13 11:17:41 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2018-03-29 14:09:23 -0700 |
commit | d76c204d0564701b4b8b6a2bdda50e2939683e66 (patch) | |
tree | edcf51df711640ffd89326079f10b1dcf65f311b /src/gallium/drivers/etnaviv | |
parent | a3a16d4aa7e5a22816226d8e7417138164b10525 (diff) |
util: Move util_is_power_of_two to bitscan.h and rename to util_is_power_of_two_or_zero
The new name make the zero-input behavior more obvious. The next
patch adds a new function with different zero-input behavior.
Signed-off-by: Ian Romanick <[email protected]>
Suggested-by: Matt Turner <[email protected]>
Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_blt.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_texture_state.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_blt.c b/src/gallium/drivers/etnaviv/etnaviv_blt.c index 5d783a4ad9c..c30c11ab61e 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_blt.c +++ b/src/gallium/drivers/etnaviv/etnaviv_blt.c @@ -178,7 +178,7 @@ emit_blt_copyimage(struct etna_cmd_stream *stream, const struct blt_imgcopy_op * static void emit_blt_inplace(struct etna_cmd_stream *stream, const struct blt_inplace_op *op) { - assert(op->bpp > 0 && util_is_power_of_two(op->bpp)); + assert(op->bpp > 0 && util_is_power_of_two_or_zero(op->bpp)); etna_cmd_stream_reserve(stream, 64*2); /* Never allow BLT sequences to be broken up */ etna_set_state(stream, VIVS_BLT_ENABLE, 0x00000001); etna_set_state(stream, VIVS_BLT_CONFIG, diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture_state.c b/src/gallium/drivers/etnaviv/etnaviv_texture_state.c index faa073a71af..7100865f925 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_texture_state.c +++ b/src/gallium/drivers/etnaviv/etnaviv_texture_state.c @@ -158,7 +158,8 @@ etna_create_sampler_view_state(struct pipe_context *pctx, struct pipe_resource * /* Workaround for npot textures -- it appears that only CLAMP_TO_EDGE is * supported when the appropriate capability is not set. */ if (!ctx->specs.npot_tex_any_wrap && - (!util_is_power_of_two(res->base.width0) || !util_is_power_of_two(res->base.height0))) { + (!util_is_power_of_two_or_zero(res->base.width0) || + !util_is_power_of_two_or_zero(res->base.height0))) { sv->TE_SAMPLER_CONFIG0_MASK = ~(VIVS_TE_SAMPLER_CONFIG0_UWRAP__MASK | VIVS_TE_SAMPLER_CONFIG0_VWRAP__MASK); sv->TE_SAMPLER_CONFIG0 |= |