summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmma Anholt <emma@anholt.net>2021-06-27 14:47:02 -0700
committerEmma Anholt <emma@anholt.net>2021-06-28 15:01:37 -0700
commitec646fdd45ca24638d61299982ff6ed6f9bda02f (patch)
tree1f6bd063e010847c679910fb8642ffdf272b30dc /src
parent247cee92df0eb12fe47881a50b58c892f9b1e8b8 (diff)
i915g: Use stdbool.h instead of custom bools.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/i915/i915_batchbuffer.h6
-rw-r--r--src/gallium/drivers/i915/i915_context.c4
-rw-r--r--src/gallium/drivers/i915/i915_debug.c74
-rw-r--r--src/gallium/drivers/i915/i915_fpc.h6
-rw-r--r--src/gallium/drivers/i915/i915_fpc_optimize.c36
-rw-r--r--src/gallium/drivers/i915/i915_fpc_translate.c4
-rw-r--r--src/gallium/drivers/i915/i915_prim_vbuf.c12
-rw-r--r--src/gallium/drivers/i915/i915_resource.c4
-rw-r--r--src/gallium/drivers/i915/i915_resource.h4
-rw-r--r--src/gallium/drivers/i915/i915_resource_buffer.c4
-rw-r--r--src/gallium/drivers/i915/i915_resource_texture.c50
-rw-r--r--src/gallium/drivers/i915/i915_screen.c4
-rw-r--r--src/gallium/drivers/i915/i915_screen.h8
-rw-r--r--src/gallium/drivers/i915/i915_state.c4
-rw-r--r--src/gallium/drivers/i915/i915_state_derived.c16
-rw-r--r--src/gallium/drivers/i915/i915_state_emit.c8
-rw-r--r--src/gallium/drivers/i915/i915_state_inlines.h4
-rw-r--r--src/gallium/drivers/i915/i915_surface.c2
-rw-r--r--src/gallium/drivers/i915/i915_winsys.h20
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c8
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_buffer.c24
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_winsys.c4
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_winsys.h6
23 files changed, 156 insertions, 156 deletions
diff --git a/src/gallium/drivers/i915/i915_batchbuffer.h b/src/gallium/drivers/i915/i915_batchbuffer.h
index a96ca1f2531..4bf2b703f0a 100644
--- a/src/gallium/drivers/i915/i915_batchbuffer.h
+++ b/src/gallium/drivers/i915/i915_batchbuffer.h
@@ -39,7 +39,7 @@ i915_winsys_batchbuffer_space(struct i915_winsys_batchbuffer *batch)
return batch->size - (batch->ptr - batch->map);
}
-static inline boolean
+static inline bool
i915_winsys_batchbuffer_check(struct i915_winsys_batchbuffer *batch,
size_t dwords)
{
@@ -84,7 +84,7 @@ i915_winsys_batchbuffer_write(struct i915_winsys_batchbuffer *batch, void *data,
batch->ptr += size;
}
-static inline boolean
+static inline bool
i915_winsys_validate_buffers(struct i915_winsys_batchbuffer *batch,
struct i915_winsys_buffer **buffers,
int num_of_buffers)
@@ -96,7 +96,7 @@ static inline int
i915_winsys_batchbuffer_reloc(struct i915_winsys_batchbuffer *batch,
struct i915_winsys_buffer *buffer,
enum i915_winsys_buffer_usage usage,
- size_t offset, boolean fenced)
+ size_t offset, bool fenced)
{
return batch->iws->batchbuffer_reloc(batch, buffer, usage, offset, fenced);
}
diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c
index 3ad6720e2e3..709cfd029e5 100644
--- a/src/gallium/drivers/i915/i915_context.c
+++ b/src/gallium/drivers/i915/i915_context.c
@@ -42,7 +42,7 @@
#include "util/u_prim.h"
#include "util/u_upload_mgr.h"
-DEBUG_GET_ONCE_BOOL_OPTION(i915_no_vbuf, "I915_NO_VBUF", FALSE)
+DEBUG_GET_ONCE_BOOL_OPTION(i915_no_vbuf, "I915_NO_VBUF", false)
/*
* Draw functions
@@ -226,7 +226,7 @@ i915_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
draw_install_aaline_stage(i915->draw, &i915->base);
draw_install_aapoint_stage(i915->draw, &i915->base);
- draw_enable_point_sprites(i915->draw, TRUE);
+ draw_enable_point_sprites(i915->draw, true);
i915->dirty = ~0;
i915->hardware_dirty = ~0;
diff --git a/src/gallium/drivers/i915/i915_debug.c b/src/gallium/drivers/i915/i915_debug.c
index 47d0f3cf55f..10cc10aec86 100644
--- a/src/gallium/drivers/i915/i915_debug.c
+++ b/src/gallium/drivers/i915/i915_debug.c
@@ -48,9 +48,9 @@ static const struct debug_named_value i915_debug_options[] = {
unsigned i915_debug = 0;
DEBUG_GET_ONCE_FLAGS_OPTION(i915_debug, "I915_DEBUG", i915_debug_options, 0)
-DEBUG_GET_ONCE_BOOL_OPTION(i915_no_tiling, "I915_NO_TILING", FALSE)
-DEBUG_GET_ONCE_BOOL_OPTION(i915_lie, "I915_LIE", TRUE)
-DEBUG_GET_ONCE_BOOL_OPTION(i915_use_blitter, "I915_USE_BLITTER", TRUE)
+DEBUG_GET_ONCE_BOOL_OPTION(i915_no_tiling, "I915_NO_TILING", false)
+DEBUG_GET_ONCE_BOOL_OPTION(i915_lie, "I915_LIE", true)
+DEBUG_GET_ONCE_BOOL_OPTION(i915_use_blitter, "I915_USE_BLITTER", true)
void
i915_debug_init(struct i915_screen *is)
@@ -65,7 +65,7 @@ i915_debug_init(struct i915_screen *is)
* Batchbuffer dumping
*/
-static boolean
+static bool
debug(struct debug_stream *stream, const char *name, unsigned len)
{
unsigned i;
@@ -74,7 +74,7 @@ debug(struct debug_stream *stream, const char *name, unsigned len)
if (len == 0) {
mesa_logi("Error - zero length packet (0x%08x)", stream->ptr[0]);
assert(0);
- return FALSE;
+ return false;
}
if (stream->print_addresses)
@@ -87,7 +87,7 @@ debug(struct debug_stream *stream, const char *name, unsigned len)
stream->offset += len * sizeof(unsigned);
- return TRUE;
+ return true;
}
static const char *
@@ -136,8 +136,8 @@ get_prim_name(unsigned val)
}
}
-static boolean
-debug_prim(struct debug_stream *stream, const char *name, boolean dump_floats,
+static bool
+debug_prim(struct debug_stream *stream, const char *name, bool dump_floats,
unsigned len)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -157,10 +157,10 @@ debug_prim(struct debug_stream *stream, const char *name, boolean dump_floats,
stream->offset += len * sizeof(unsigned);
- return TRUE;
+ return true;
}
-static boolean
+static bool
debug_program(struct debug_stream *stream, const char *name, unsigned len)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -168,7 +168,7 @@ debug_program(struct debug_stream *stream, const char *name, unsigned len)
if (len == 0) {
mesa_logi("Error - zero length packet (0x%08x)", stream->ptr[0]);
assert(0);
- return FALSE;
+ return false;
}
if (stream->print_addresses)
@@ -178,10 +178,10 @@ debug_program(struct debug_stream *stream, const char *name, unsigned len)
i915_disassemble_program(ptr, len);
stream->offset += len * sizeof(unsigned);
- return TRUE;
+ return true;
}
-static boolean
+static bool
debug_chain(struct debug_stream *stream, const char *name, unsigned len)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -201,10 +201,10 @@ debug_chain(struct debug_stream *stream, const char *name, unsigned len)
mesa_logi("... skipping from 0x%x --> 0x%x ...", old_offset,
stream->offset);
- return TRUE;
+ return true;
}
-static boolean
+static bool
debug_variable_length_prim(struct debug_stream *stream)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -224,7 +224,7 @@ debug_variable_length_prim(struct debug_stream *stream)
mesa_logi("%s", "");
stream->offset += len * sizeof(unsigned);
- return TRUE;
+ return true;
}
static void
@@ -268,7 +268,7 @@ FLAG(struct debug_stream *stream, unsigned dw, unsigned bit, const char *fmt,
}
}
-static boolean
+static bool
debug_load_immediate(struct debug_stream *stream, const char *name,
unsigned len)
{
@@ -369,10 +369,10 @@ debug_load_immediate(struct debug_stream *stream, const char *name,
stream->offset += len * sizeof(unsigned);
- return TRUE;
+ return true;
}
-static boolean
+static bool
debug_load_indirect(struct debug_stream *stream, const char *name, unsigned len)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -431,7 +431,7 @@ debug_load_indirect(struct debug_stream *stream, const char *name, unsigned len)
stream->offset += len * sizeof(unsigned);
- return TRUE;
+ return true;
}
static void
@@ -493,7 +493,7 @@ BR16(struct debug_stream *stream, unsigned val)
mesa_logi("\t0x%08x -- color", val);
}
-static boolean
+static bool
debug_copy_blit(struct debug_stream *stream, const char *name, unsigned len)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -512,10 +512,10 @@ debug_copy_blit(struct debug_stream *stream, const char *name, unsigned len)
stream->offset += len * sizeof(unsigned);
assert(j == len);
- return TRUE;
+ return true;
}
-static boolean
+static bool
debug_color_blit(struct debug_stream *stream, const char *name, unsigned len)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -532,10 +532,10 @@ debug_color_blit(struct debug_stream *stream, const char *name, unsigned len)
stream->offset += len * sizeof(unsigned);
assert(j == len);
- return TRUE;
+ return true;
}
-static boolean
+static bool
debug_modes4(struct debug_stream *stream, const char *name, unsigned len)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -552,10 +552,10 @@ debug_modes4(struct debug_stream *stream, const char *name, unsigned len)
stream->offset += len * sizeof(unsigned);
assert(j == len);
- return TRUE;
+ return true;
}
-static boolean
+static bool
debug_map_state(struct debug_stream *stream, const char *name, unsigned len)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -603,10 +603,10 @@ debug_map_state(struct debug_stream *stream, const char *name, unsigned len)
stream->offset += len * sizeof(unsigned);
assert(j == len);
- return TRUE;
+ return true;
}
-static boolean
+static bool
debug_sampler_state(struct debug_stream *stream, const char *name, unsigned len)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -662,10 +662,10 @@ debug_sampler_state(struct debug_stream *stream, const char *name, unsigned len)
stream->offset += len * sizeof(unsigned);
assert(j == len);
- return TRUE;
+ return true;
}
-static boolean
+static bool
debug_dest_vars(struct debug_stream *stream, const char *name, unsigned len)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -696,10 +696,10 @@ debug_dest_vars(struct debug_stream *stream, const char *name, unsigned len)
stream->offset += len * sizeof(unsigned);
assert(j == len);
- return TRUE;
+ return true;
}
-static boolean
+static bool
debug_buf_info(struct debug_stream *stream, const char *name, unsigned len)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -725,10 +725,10 @@ debug_buf_info(struct debug_stream *stream, const char *name, unsigned len)
stream->offset += len * sizeof(unsigned);
assert(j == len);
- return TRUE;
+ return true;
}
-static boolean
+static bool
i915_debug_packet(struct debug_stream *stream)
{
unsigned *ptr = (unsigned *)(stream->ptr + stream->offset);
@@ -745,7 +745,7 @@ i915_debug_packet(struct debug_stream *stream)
return debug(stream, "MI_FLUSH", 1);
case 0xA:
debug(stream, "MI_BATCH_BUFFER_END", 1);
- return FALSE;
+ return false;
case 0x22:
return debug(stream, "MI_LOAD_REGISTER_IMM", 3);
case 0x31:
@@ -900,7 +900,7 @@ i915_dump_batchbuffer(struct i915_winsys_batchbuffer *batch)
unsigned *start = (unsigned *)batch->map;
unsigned *end = (unsigned *)batch->ptr;
unsigned long bytes = (unsigned long)(end - start) * 4;
- boolean done = FALSE;
+ bool done = false;
stream.offset = 0;
stream.ptr = (char *)start;
diff --git a/src/gallium/drivers/i915/i915_fpc.h b/src/gallium/drivers/i915/i915_fpc.h
index 5a70fe55c23..6ff372d503b 100644
--- a/src/gallium/drivers/i915/i915_fpc.h
+++ b/src/gallium/drivers/i915/i915_fpc.h
@@ -47,14 +47,14 @@
struct i915_fp_compile {
struct i915_fragment_shader *shader; /* the shader we're compiling */
- boolean used_constants[I915_MAX_CONSTANT];
+ bool used_constants[I915_MAX_CONSTANT];
/** maps TGSI immediate index to constant slot */
uint32_t num_immediates;
uint32_t immediates_map[I915_MAX_CONSTANT];
float immediates[I915_MAX_CONSTANT][4];
- boolean first_instruction;
+ bool first_instruction;
uint32_t declarations[I915_PROGRAM_SIZE];
uint32_t program[I915_PROGRAM_SIZE];
@@ -76,7 +76,7 @@ struct i915_fp_compile {
uint32_t nr_decl_insn;
bool log_program_errors;
- boolean error; /**< Set if i915_program_error() is called */
+ bool error; /**< Set if i915_program_error() is called */
uint32_t NumNativeInstructions;
uint32_t NumNativeAluInstructions;
uint32_t NumNativeTexInstructions;
diff --git a/src/gallium/drivers/i915/i915_fpc_optimize.c b/src/gallium/drivers/i915/i915_fpc_optimize.c
index ad2ecbfbf38..9dd7bdfb5a9 100644
--- a/src/gallium/drivers/i915/i915_fpc_optimize.c
+++ b/src/gallium/drivers/i915/i915_fpc_optimize.c
@@ -42,7 +42,7 @@ struct i915_optimize_context {
int last_read[TGSI_EXEC_NUM_TEMPS];
};
-static boolean
+static bool
same_src_dst_reg(struct i915_full_src_register *s1,
struct i915_full_dst_register *d1)
{
@@ -52,7 +52,7 @@ same_src_dst_reg(struct i915_full_src_register *s1,
s1->Register.Index == d1->Register.Index);
}
-static boolean
+static bool
same_dst_reg(struct i915_full_dst_register *d1,
struct i915_full_dst_register *d2)
{
@@ -62,7 +62,7 @@ same_dst_reg(struct i915_full_dst_register *d1,
d1->Register.Index == d2->Register.Index);
}
-static boolean
+static bool
same_src_reg(struct i915_full_src_register *d1,
struct i915_full_src_register *d2)
{
@@ -75,8 +75,8 @@ same_src_reg(struct i915_full_src_register *d1,
}
static const struct {
- boolean is_texture;
- boolean commutes;
+ bool is_texture;
+ bool commutes;
unsigned neutral_element;
unsigned num_dst;
unsigned num_src;
@@ -124,7 +124,7 @@ static const struct {
[TGSI_OPCODE_TXP] = {true, false, 0, 1, 2},
};
-static boolean
+static bool
op_has_dst(unsigned opcode)
{
return (op_table[opcode].num_dst > 0);
@@ -142,7 +142,7 @@ op_num_src(unsigned opcode)
return op_table[opcode].num_src;
}
-static boolean
+static bool
op_commutes(unsigned opcode)
{
return op_table[opcode].commutes;
@@ -168,21 +168,21 @@ mask_for_unswizzled(int num_components)
return mask;
}
-static boolean
+static bool
is_unswizzled(struct i915_full_src_register *r, unsigned write_mask)
{
if (write_mask & TGSI_WRITEMASK_X && r->Register.SwizzleX != TGSI_SWIZZLE_X)
- return FALSE;
+ return false;
if (write_mask & TGSI_WRITEMASK_Y && r->Register.SwizzleY != TGSI_SWIZZLE_Y)
- return FALSE;
+ return false;
if (write_mask & TGSI_WRITEMASK_Z && r->Register.SwizzleZ != TGSI_SWIZZLE_Z)
- return FALSE;
+ return false;
if (write_mask & TGSI_WRITEMASK_W && r->Register.SwizzleW != TGSI_SWIZZLE_W)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
-static boolean
+static bool
op_is_texture(unsigned opcode)
{
return op_table[opcode].is_texture;
@@ -398,7 +398,7 @@ i915_tex_mask(union i915_full_token *instr)
return mask;
}
-static boolean
+static bool
target_is_texture2d(uint32_t tex)
{
switch (tex) {
@@ -585,7 +585,7 @@ i915_fpc_optimize_mov_after_alu(union i915_full_token *current,
* into:
* NOP
*/
-static boolean
+static bool
i915_fpc_useless_mov(union tgsi_full_token *tgsi_current)
{
union i915_full_token current;
@@ -600,9 +600,9 @@ i915_fpc_useless_mov(union tgsi_full_token *tgsi_current)
current.FullInstruction.Dst[0].Register.WriteMask) &&
same_src_dst_reg(&current.FullInstruction.Src[0],
&current.FullInstruction.Dst[0])) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*
diff --git a/src/gallium/drivers/i915/i915_fpc_translate.c b/src/gallium/drivers/i915/i915_fpc_translate.c
index 6e0f6265c40..4976823251f 100644
--- a/src/gallium/drivers/i915/i915_fpc_translate.c
+++ b/src/gallium/drivers/i915/i915_fpc_translate.c
@@ -896,7 +896,7 @@ i915_translate_token(struct i915_fp_compile *p,
}
}
- p->first_instruction = FALSE;
+ p->first_instruction = false;
}
i915_translate_instruction(p, &token->FullInstruction, fs);
@@ -947,7 +947,7 @@ i915_init_compile(struct i915_context *i915, struct i915_fragment_shader *ifs)
p->log_program_errors = !i915->no_log_program_errors;
- p->first_instruction = TRUE;
+ p->first_instruction = true;
p->nr_tex_indirect = 1; /* correct? */
p->nr_tex_insn = 0;
diff --git a/src/gallium/drivers/i915/i915_prim_vbuf.c b/src/gallium/drivers/i915/i915_prim_vbuf.c
index 2d6ef0f0944..9dba054f786 100644
--- a/src/gallium/drivers/i915/i915_prim_vbuf.c
+++ b/src/gallium/drivers/i915/i915_prim_vbuf.c
@@ -149,18 +149,18 @@ i915_vbuf_render_get_vertex_info(struct vbuf_render *render)
* Side effects:
* None.
*/
-static boolean
+static bool
i915_vbuf_render_reserve(struct i915_vbuf_render *i915_render, size_t size)
{
struct i915_context *i915 = i915_render->i915;
if (i915_render->vbo_size < size + i915_render->vbo_sw_offset)
- return FALSE;
+ return false;
if (i915->vbo_flushed)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
/**
@@ -206,7 +206,7 @@ i915_vbuf_render_new_buf(struct i915_vbuf_render *i915_render, size_t size)
i915_render->vbo =
iws->buffer_create(iws, i915_render->vbo_size, I915_NEW_VERTEX);
- i915_render->vbo_ptr = iws->buffer_map(iws, i915_render->vbo, TRUE);
+ i915_render->vbo_ptr = iws->buffer_map(iws, i915_render->vbo, true);
}
/**
@@ -715,7 +715,7 @@ i915_vbuf_render_create(struct i915_context *i915)
i915_render->vbo_alloc_size = i915_render->base.max_vertex_buffer_bytes * 4;
#ifdef VBUF_USE_POOL
- i915_render->pool_used = FALSE;
+ i915_render->pool_used = false;
i915_render->pool_buffer_size = i915_render->vbo_alloc_size;
i915_render->pool_fifo = u_fifo_create(6);
for (i = 0; i < 6; i++)
diff --git a/src/gallium/drivers/i915/i915_resource.c b/src/gallium/drivers/i915/i915_resource.c
index 858f5448f83..da05f0a483a 100644
--- a/src/gallium/drivers/i915/i915_resource.c
+++ b/src/gallium/drivers/i915/i915_resource.c
@@ -12,9 +12,9 @@ i915_resource_create(struct pipe_screen *screen,
return i915_buffer_create(screen, template);
else {
if (!(template->bind & PIPE_BIND_LINEAR))
- return i915_texture_create(screen, template, FALSE);
+ return i915_texture_create(screen, template, false);
else
- return i915_texture_create(screen, template, TRUE);
+ return i915_texture_create(screen, template, true);
}
}
diff --git a/src/gallium/drivers/i915/i915_resource.h b/src/gallium/drivers/i915/i915_resource.h
index 583fc80fe5e..1e1fa921fcf 100644
--- a/src/gallium/drivers/i915/i915_resource.h
+++ b/src/gallium/drivers/i915/i915_resource.h
@@ -40,7 +40,7 @@ struct i915_screen;
struct i915_buffer {
struct pipe_resource b;
uint8_t *data;
- boolean free_on_destroy;
+ bool free_on_destroy;
};
/* Texture transfer. */
@@ -104,7 +104,7 @@ i915_buffer(struct pipe_resource *resource)
struct pipe_resource *i915_texture_create(struct pipe_screen *screen,
const struct pipe_resource *template,
- boolean force_untiled);
+ bool force_untiled);
bool i915_resource_get_handle(struct pipe_screen *screen,
struct pipe_context *context,
diff --git a/src/gallium/drivers/i915/i915_resource_buffer.c b/src/gallium/drivers/i915/i915_resource_buffer.c
index f42394a9383..c7981d7d8f9 100644
--- a/src/gallium/drivers/i915/i915_resource_buffer.c
+++ b/src/gallium/drivers/i915/i915_resource_buffer.c
@@ -117,7 +117,7 @@ i915_buffer_create(struct pipe_screen *screen,
pipe_reference_init(&buf->b.reference, 1);
buf->b.screen = screen;
buf->data = align_malloc(template->width0, 64);
- buf->free_on_destroy = TRUE;
+ buf->free_on_destroy = true;
if (!buf->data)
goto err;
@@ -150,7 +150,7 @@ i915_user_buffer_create(struct pipe_screen *screen, void *ptr, unsigned bytes,
buf->b.array_size = 1;
buf->data = ptr;
- buf->free_on_destroy = FALSE;
+ buf->free_on_destroy = false;
return &buf->b;
}
diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c
index 0c0e15e9ca3..ee88b178c78 100644
--- a/src/gallium/drivers/i915/i915_resource_texture.c
+++ b/src/gallium/drivers/i915/i915_resource_texture.c
@@ -107,7 +107,7 @@ get_tiling_string(enum i915_winsys_buffer_tile tile)
case I915_TILE_Y:
return "y";
default:
- assert(FALSE);
+ assert(false);
return "?";
}
}
@@ -185,13 +185,13 @@ i915_texture_tiling(struct i915_screen *is, struct i915_texture *tex)
/**
* Special case to deal with scanout textures.
*/
-static boolean
+static bool
i9x5_scanout_layout(struct i915_texture *tex)
{
struct pipe_resource *pt = &tex->b;
if (pt->last_level > 0 || util_format_get_blocksize(pt->format) != 4)
- return FALSE;
+ return false;
i915_texture_set_level_info(tex, 0, 1);
i915_texture_set_image_offset(tex, 0, 0, 0, 0);
@@ -205,7 +205,7 @@ i9x5_scanout_layout(struct i915_texture *tex)
tex->stride = get_pot_stride(pt->format, pt->width0);
tex->total_nblocksy = align_nblocksy(pt->format, pt->height0, 8);
} else {
- return FALSE;
+ return false;
}
#if DEBUG_TEXTURE
@@ -215,23 +215,23 @@ i9x5_scanout_layout(struct i915_texture *tex)
tex->stride * tex->total_nblocksy);
#endif
- return TRUE;
+ return true;
}
/**
* Special case to deal with shared textures.
*/
-static boolean
+static bool
i9x5_display_target_layout(struct i915_texture *tex)
{
struct pipe_resource *pt = &tex->b;
if (pt->last_level > 0 || util_format_get_blocksize(pt->format) != 4)
- return FALSE;
+ return false;
/* fallback to normal textures for small textures */
if (pt->width0 < 240)
- return FALSE;
+ return false;
i915_texture_set_level_info(tex, 0, 1);
i915_texture_set_image_offset(tex, 0, 0, 0, 0);
@@ -247,13 +247,13 @@ i9x5_display_target_layout(struct i915_texture *tex)
tex->stride * tex->total_nblocksy);
#endif
- return TRUE;
+ return true;
}
/**
* Helper function for special layouts
*/
-static boolean
+static bool
i9x5_special_layout(struct i915_texture *tex)
{
struct pipe_resource *pt = &tex->b;
@@ -261,7 +261,7 @@ i9x5_special_layout(struct i915_texture *tex)
/* Scanouts needs special care */
if (pt->bind & PIPE_BIND_SCANOUT)
if (i9x5_scanout_layout(tex))
- return TRUE;
+ return true;
/* Shared buffers needs to be compatible with X servers
*
@@ -271,9 +271,9 @@ i9x5_special_layout(struct i915_texture *tex)
*/
if (pt->bind & (PIPE_BIND_SHARED | PIPE_BIND_DISPLAY_TARGET))
if (i9x5_display_target_layout(tex))
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
/**
@@ -388,7 +388,7 @@ i915_texture_layout_3d(struct i915_texture *tex)
tex->total_nblocksy = stack_nblocksy * util_next_power_of_two(pt->depth0);
}
-static boolean
+static bool
i915_texture_layout(struct i915_texture *tex)
{
switch (tex->b.target) {
@@ -406,10 +406,10 @@ i915_texture_layout(struct i915_texture *tex)
break;
default:
assert(0);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*
@@ -633,7 +633,7 @@ i945_texture_layout_cube(struct i915_texture *tex)
}
}
-static boolean
+static bool
i945_texture_layout(struct i915_texture *tex)
{
switch (tex->b.target) {
@@ -654,10 +654,10 @@ i945_texture_layout(struct i915_texture *tex)
break;
default:
assert(0);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*
@@ -689,7 +689,7 @@ i915_texture_transfer_map(struct pipe_context *pipe,
struct i915_context *i915 = i915_context(pipe);
struct i915_texture *tex = i915_texture(resource);
struct i915_transfer *transfer = slab_alloc_st(&i915->texture_transfer_pool);
- boolean use_staging_texture = FALSE;
+ bool use_staging_texture = false;
struct i915_winsys *iws = i915_screen(pipe->screen)->iws;
enum pipe_format format = resource->format;
unsigned offset;
@@ -714,9 +714,9 @@ i915_texture_transfer_map(struct pipe_context *pipe,
(usage & PIPE_MAP_WRITE) &&
!(usage &
(PIPE_MAP_READ | PIPE_MAP_DONTBLOCK | PIPE_MAP_UNSYNCHRONIZED)))
- use_staging_texture = TRUE;
+ use_staging_texture = true;
- use_staging_texture = FALSE;
+ use_staging_texture = false;
if (use_staging_texture) {
/*
@@ -725,7 +725,7 @@ i915_texture_transfer_map(struct pipe_context *pipe,
* to a map()
*/
transfer->staging_texture =
- i915_texture_create(pipe->screen, resource, TRUE);
+ i915_texture_create(pipe->screen, resource, true);
}
if (resource->target != PIPE_TEXTURE_3D &&
@@ -743,7 +743,7 @@ i915_texture_transfer_map(struct pipe_context *pipe,
offset = i915_texture_offset(tex, transfer->b.level, box->z);
map = iws->buffer_map(iws, tex->buffer,
- (transfer->b.usage & PIPE_MAP_WRITE) ? TRUE : FALSE);
+ (transfer->b.usage & PIPE_MAP_WRITE) ? true : false);
if (!map) {
pipe_resource_reference(&transfer->staging_texture, NULL);
FREE(transfer);
@@ -878,7 +878,7 @@ out:
struct pipe_resource *
i915_texture_create(struct pipe_screen *screen,
- const struct pipe_resource *template, boolean force_untiled)
+ const struct pipe_resource *template, bool force_untiled)
{
struct i915_screen *is = i915_screen(screen);
struct i915_winsys *iws = is->iws;
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index 4278fb3d80a..b9e00f8a3b6 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -561,7 +561,7 @@ i915_screen_create(struct i915_winsys *iws)
switch (iws->pci_id) {
case PCI_CHIP_I915_G:
case PCI_CHIP_I915_GM:
- is->is_i945 = FALSE;
+ is->is_i945 = false;
break;
case PCI_CHIP_I945_G:
@@ -572,7 +572,7 @@ i915_screen_create(struct i915_winsys *iws)
case PCI_CHIP_Q35_G:
case PCI_CHIP_PINEVIEW_G:
case PCI_CHIP_PINEVIEW_M:
- is->is_i945 = TRUE;
+ is->is_i945 = true;
break;
default:
diff --git a/src/gallium/drivers/i915/i915_screen.h b/src/gallium/drivers/i915/i915_screen.h
index f4505acfd5f..0cee824e2da 100644
--- a/src/gallium/drivers/i915/i915_screen.h
+++ b/src/gallium/drivers/i915/i915_screen.h
@@ -41,12 +41,12 @@ struct i915_screen {
struct i915_winsys *iws;
- boolean is_i945;
+ bool is_i945;
struct {
- boolean tiling;
- boolean lie;
- boolean use_blitter;
+ bool tiling;
+ bool lie;
+ bool use_blitter;
} debug;
};
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c
index 9db8668da9c..ffc5c5332be 100644
--- a/src/gallium/drivers/i915/i915_state.c
+++ b/src/gallium/drivers/i915/i915_state.c
@@ -620,7 +620,7 @@ i915_set_constant_buffer(struct pipe_context *pipe,
struct i915_context *i915 = i915_context(pipe);
struct pipe_resource *buf = cb ? cb->buffer : NULL;
unsigned new_num = 0;
- boolean diff = TRUE;
+ bool diff = true;
/* XXX don't support geom shaders now */
if (shader == PIPE_SHADER_GEOMETRY)
@@ -642,7 +642,7 @@ i915_set_constant_buffer(struct pipe_context *pipe,
if (old_num == new_num) {
if (old_num == 0)
- diff = FALSE;
+ diff = false;
#if 0
/* XXX no point in running this code since st/mesa only uses user buffers */
/* Can't compare the buffer data since they are userbuffers */
diff --git a/src/gallium/drivers/i915/i915_state_derived.c b/src/gallium/drivers/i915/i915_state_derived.c
index d46433f20aa..b2615f308d3 100644
--- a/src/gallium/drivers/i915/i915_state_derived.c
+++ b/src/gallium/drivers/i915/i915_state_derived.c
@@ -56,12 +56,12 @@ calculate_vertex_layout(struct i915_context *i915)
{
const struct i915_fragment_shader *fs = i915->fs;
struct vertex_info vinfo;
- boolean texCoords[I915_TEX_UNITS], colors[2], fog, needW, face;
+ bool texCoords[I915_TEX_UNITS], colors[2], fog, needW, face;
uint32_t i;
int src;
memset(texCoords, 0, sizeof(texCoords));
- colors[0] = colors[1] = fog = needW = face = FALSE;
+ colors[0] = colors[1] = fog = needW = face = false;
memset(&vinfo, 0, sizeof(vinfo));
/* Determine which fragment program inputs are needed. Setup HW vertex
@@ -71,24 +71,24 @@ calculate_vertex_layout(struct i915_context *i915)
switch (fs->info.input_semantic_name[i]) {
case TGSI_SEMANTIC_POSITION: {
uint32_t unit = I915_SEMANTIC_POS;
- texCoords[find_mapping(fs, unit)] = TRUE;
+ texCoords[find_mapping(fs, unit)] = true;
} break;
case TGSI_SEMANTIC_COLOR:
assert(fs->info.input_semantic_index[i] < 2);
- colors[fs->info.input_semantic_index[i]] = TRUE;
+ colors[fs->info.input_semantic_index[i]] = true;
break;
case TGSI_SEMANTIC_GENERIC: {
/* texcoords/varyings/other generic */
uint32_t unit = fs->info.input_semantic_index[i];
- texCoords[find_mapping(fs, unit)] = TRUE;
- needW = TRUE;
+ texCoords[find_mapping(fs, unit)] = true;
+ needW = true;
} break;
case TGSI_SEMANTIC_FOG:
- fog = TRUE;
+ fog = true;
break;
case TGSI_SEMANTIC_FACE:
- face = TRUE;
+ face = true;
break;
default:
debug_printf("Unknown input type %d\n",
diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c
index 98c70a476b0..5190a47bfaa 100644
--- a/src/gallium/drivers/i915/i915_state_emit.c
+++ b/src/gallium/drivers/i915/i915_state_emit.c
@@ -415,7 +415,7 @@ emit_draw_rect(struct i915_context *i915)
}
}
-static boolean
+static bool
i915_validate_state(struct i915_context *i915, unsigned *batch_space)
{
unsigned tmp;
@@ -456,13 +456,13 @@ static int counter_total = 0;
#undef VALIDATE_ATOM
if (i915->num_validation_buffers == 0)
- return TRUE;
+ return true;
if (!i915_winsys_validate_buffers(i915->batch, i915->validation_buffers,
i915->num_validation_buffers))
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
/* Push the state into the sarea and/or texture memory.
diff --git a/src/gallium/drivers/i915/i915_state_inlines.h b/src/gallium/drivers/i915/i915_state_inlines.h
index 500ffa7e302..8d7885ec6d3 100644
--- a/src/gallium/drivers/i915/i915_state_inlines.h
+++ b/src/gallium/drivers/i915/i915_state_inlines.h
@@ -207,10 +207,10 @@ i915_translate_logic_op(unsigned opcode)
}
}
-static inline boolean
+static inline bool
i915_validate_vertices(unsigned hw_prim, unsigned nr)
{
- boolean ok;
+ bool ok;
switch (hw_prim) {
case PRIM3D_POINTLIST:
diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c
index 49c3d2e9e2f..43723dd996a 100644
--- a/src/gallium/drivers/i915/i915_surface.c
+++ b/src/gallium/drivers/i915/i915_surface.c
@@ -118,7 +118,7 @@ i915_surface_copy_render(struct pipe_context *pipe, struct pipe_resource *dst,
util_blitter_blit_generic(i915->blitter, dst_view, &dstbox, src_view,
src_box, src_width0, src_height0, PIPE_MASK_RGBAZS,
- PIPE_TEX_FILTER_NEAREST, NULL, FALSE);
+ PIPE_TEX_FILTER_NEAREST, NULL, false);
return;
fallback:
diff --git a/src/gallium/drivers/i915/i915_winsys.h b/src/gallium/drivers/i915/i915_winsys.h
index f14ffe57991..1c7a501ecf0 100644
--- a/src/gallium/drivers/i915/i915_winsys.h
+++ b/src/gallium/drivers/i915/i915_winsys.h
@@ -99,9 +99,9 @@ struct i915_winsys {
* @buffers array to buffers to validate
* @num_of_buffers size of the passed array
*/
- boolean (*validate_buffers)(struct i915_winsys_batchbuffer *batch,
- struct i915_winsys_buffer **buffers,
- int num_of_buffers);
+ bool (*validate_buffers)(struct i915_winsys_batchbuffer *batch,
+ struct i915_winsys_buffer **buffers,
+ int num_of_buffers);
/**
* Emit a relocation to a buffer.
@@ -117,7 +117,7 @@ struct i915_winsys {
int (*batchbuffer_reloc)(struct i915_winsys_batchbuffer *batch,
struct i915_winsys_buffer *reloc,
enum i915_winsys_buffer_usage usage,
- unsigned offset, boolean fenced);
+ unsigned offset, bool fenced);
/**
* Flush a bufferbatch.
@@ -169,15 +169,15 @@ struct i915_winsys {
* Used to implement pipe_screen::resource_get_handle.
* The winsys might need the stride information.
*/
- boolean (*buffer_get_handle)(struct i915_winsys *iws,
- struct i915_winsys_buffer *buffer,
- struct winsys_handle *whandle, unsigned stride);
+ bool (*buffer_get_handle)(struct i915_winsys *iws,
+ struct i915_winsys_buffer *buffer,
+ struct winsys_handle *whandle, unsigned stride);
/**
* Map a buffer.
*/
void *(*buffer_map)(struct i915_winsys *iws,
- struct i915_winsys_buffer *buffer, boolean write);
+ struct i915_winsys_buffer *buffer, bool write);
/**
* Unmap a buffer.
@@ -199,8 +199,8 @@ struct i915_winsys {
/**
* Check if a buffer is busy.
*/
- boolean (*buffer_is_busy)(struct i915_winsys *iws,
- struct i915_winsys_buffer *buffer);
+ bool (*buffer_is_busy)(struct i915_winsys *iws,
+ struct i915_winsys_buffer *buffer);
/*@}*/
/**
diff --git a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
index 62dc890eb13..2add5367c9f 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
@@ -71,7 +71,7 @@ i915_drm_batchbuffer_create(struct i915_winsys *iws)
return &batch->base;
}
-static boolean
+static bool
i915_drm_batchbuffer_validate_buffers(struct i915_winsys_batchbuffer *batch,
struct i915_winsys_buffer **buffer,
int num_of_buffers)
@@ -86,16 +86,16 @@ i915_drm_batchbuffer_validate_buffers(struct i915_winsys_batchbuffer *batch,
ret = drm_intel_bufmgr_check_aperture_space(bos, num_of_buffers);
if (ret != 0)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
static int
i915_drm_batchbuffer_reloc(struct i915_winsys_batchbuffer *ibatch,
struct i915_winsys_buffer *buffer,
enum i915_winsys_buffer_usage usage,
- unsigned pre_add, boolean fenced)
+ unsigned pre_add, bool fenced)
{
struct i915_drm_batchbuffer *batch = i915_drm_batchbuffer(ibatch);
unsigned write_domain = 0;
diff --git a/src/gallium/winsys/i915/drm/i915_drm_buffer.c b/src/gallium/winsys/i915/drm/i915_drm_buffer.c
index 3d24b64e679..de8f0a8ccd8 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_buffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_buffer.c
@@ -34,7 +34,7 @@ i915_drm_buffer_create(struct i915_winsys *iws,
return NULL;
buf->magic = 0xDEAD1337;
- buf->flinked = FALSE;
+ buf->flinked = false;
buf->flink = 0;
buf->bo = drm_intel_bo_alloc(idws->gem_manager,
@@ -66,7 +66,7 @@ i915_drm_buffer_create_tiled(struct i915_winsys *iws,
return NULL;
buf->magic = 0xDEAD1337;
- buf->flinked = FALSE;
+ buf->flinked = false;
buf->flink = 0;
buf->bo = drm_intel_bo_alloc_tiled(idws->gem_manager,
@@ -117,7 +117,7 @@ i915_drm_buffer_from_handle(struct i915_winsys *iws,
buf->bo = drm_intel_bo_gem_create_from_prime(idws->gem_manager, fd, height * whandle->stride);
}
- buf->flinked = TRUE;
+ buf->flinked = true;
buf->flink = whandle->handle;
if (!buf->bo)
@@ -135,7 +135,7 @@ err:
return NULL;
}
-static boolean
+static bool
i915_drm_buffer_get_handle(struct i915_winsys *iws,
struct i915_winsys_buffer *buffer,
struct winsys_handle *whandle,
@@ -146,8 +146,8 @@ i915_drm_buffer_get_handle(struct i915_winsys *iws,
if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
if (!buf->flinked) {
if (drm_intel_bo_flink(buf->bo, &buf->flink))
- return FALSE;
- buf->flinked = TRUE;
+ return false;
+ buf->flinked = true;
}
whandle->handle = buf->flink;
@@ -157,21 +157,21 @@ i915_drm_buffer_get_handle(struct i915_winsys *iws,
int fd;
if (drm_intel_bo_gem_export_to_prime(buf->bo, &fd))
- return FALSE;
+ return false;
whandle->handle = fd;
} else {
assert(!"unknown usage");
- return FALSE;
+ return false;
}
whandle->stride = stride;
- return TRUE;
+ return true;
}
static void *
i915_drm_buffer_map(struct i915_winsys *iws,
struct i915_winsys_buffer *buffer,
- boolean write)
+ bool write)
{
struct i915_drm_buffer *buf = i915_drm_buffer(buffer);
drm_intel_bo *bo = intel_bo(buffer);
@@ -233,13 +233,13 @@ i915_drm_buffer_destroy(struct i915_winsys *iws,
FREE(buffer);
}
-static boolean
+static bool
i915_drm_buffer_is_busy(struct i915_winsys *iws,
struct i915_winsys_buffer *buffer)
{
struct i915_drm_buffer* i915_buffer = i915_drm_buffer(buffer);
if (!i915_buffer)
- return FALSE;
+ return false;
return drm_intel_bo_busy(i915_buffer->bo);
}
diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.c b/src/gallium/winsys/i915/drm/i915_drm_winsys.c
index add8ff83e2b..3baccb48989 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_winsys.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.c
@@ -76,9 +76,9 @@ i915_drm_winsys_create(int drmFD)
drm_intel_bufmgr_gem_enable_reuse(idws->gem_manager);
drm_intel_bufmgr_gem_enable_fenced_relocs(idws->gem_manager);
- idws->dump_cmd = debug_get_bool_option("I915_DUMP_CMD", FALSE);
+ idws->dump_cmd = debug_get_bool_option("I915_DUMP_CMD", false);
idws->dump_raw_file = debug_get_option("I915_DUMP_RAW_FILE", NULL);
- idws->send_cmd = !debug_get_bool_option("I915_NO_HW", FALSE);
+ idws->send_cmd = !debug_get_bool_option("I915_NO_HW", false);
return &idws->base;
}
diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.h b/src/gallium/winsys/i915/drm/i915_drm_winsys.h
index d02e3c278ab..a7b809c3402 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_winsys.h
+++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.h
@@ -17,9 +17,9 @@ struct i915_drm_winsys
{
struct i915_winsys base;
- boolean dump_cmd;
+ bool dump_cmd;
const char *dump_raw_file;
- boolean send_cmd;
+ bool send_cmd;
int fd; /**< Drm file discriptor */
@@ -54,7 +54,7 @@ struct i915_drm_buffer {
void *ptr;
unsigned map_count;
- boolean flinked;
+ bool flinked;
unsigned flink;
};