r600g: some -Wsign-compare fixes

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Konstantin Kharlamov 2017-12-29 08:32:31 +03:00 committed by Marek Olšák
parent b674a1d3b9
commit 3f8fa7716d
6 changed files with 13 additions and 14 deletions

View File

@ -78,7 +78,7 @@ static void print_named_value(FILE *file, const char *name, uint32_t value,
static void eg_dump_reg(FILE *file, unsigned offset, uint32_t value, static void eg_dump_reg(FILE *file, unsigned offset, uint32_t value,
uint32_t field_mask) uint32_t field_mask)
{ {
int r, f; unsigned r, f;
for (r = 0; r < ARRAY_SIZE(egd_reg_table); r++) { for (r = 0; r < ARRAY_SIZE(egd_reg_table); r++) {
const struct eg_reg *reg = &egd_reg_table[r]; const struct eg_reg *reg = &egd_reg_table[r];
@ -134,7 +134,7 @@ static void ac_parse_set_reg_packet(FILE *f, uint32_t *ib, unsigned count,
unsigned reg_offset) unsigned reg_offset)
{ {
unsigned reg = (ib[1] << 2) + reg_offset; unsigned reg = (ib[1] << 2) + reg_offset;
int i; unsigned i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
eg_dump_reg(f, reg + i*4, ib[2+i], ~0); eg_dump_reg(f, reg + i*4, ib[2+i], ~0);
@ -149,7 +149,7 @@ static uint32_t *ac_parse_packet3(FILE *f, uint32_t *ib, int *num_dw,
unsigned op = PKT3_IT_OPCODE_G(ib[0]); unsigned op = PKT3_IT_OPCODE_G(ib[0]);
const char *predicate = PKT3_PREDICATE(ib[0]) ? "(predicate)" : ""; const char *predicate = PKT3_PREDICATE(ib[0]) ? "(predicate)" : "";
const char *compute_mode = (ib[0] & 0x2) ? "(C)" : ""; const char *compute_mode = (ib[0] & 0x2) ? "(C)" : "";
int i; unsigned i;
/* Print the name first. */ /* Print the name first. */
for (i = 0; i < ARRAY_SIZE(packet3_table); i++) for (i = 0; i < ARRAY_SIZE(packet3_table); i++)

View File

@ -3970,7 +3970,7 @@ static void evergreen_set_hw_atomic_buffers(struct pipe_context *ctx,
{ {
struct r600_context *rctx = (struct r600_context *)ctx; struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_atomic_buffer_state *astate; struct r600_atomic_buffer_state *astate;
int i, idx; unsigned i, idx;
astate = &rctx->atomic_buffer_state; astate = &rctx->atomic_buffer_state;
@ -4006,7 +4006,7 @@ static void evergreen_set_shader_buffers(struct pipe_context *ctx,
struct r600_tex_color_info color; struct r600_tex_color_info color;
struct eg_buf_res_params buf_params; struct eg_buf_res_params buf_params;
struct r600_resource *resource; struct r600_resource *resource;
int i, idx; unsigned i, idx;
unsigned old_mask; unsigned old_mask;
if (shader != PIPE_SHADER_FRAGMENT && if (shader != PIPE_SHADER_FRAGMENT &&
@ -4100,7 +4100,7 @@ static void evergreen_set_shader_images(struct pipe_context *ctx,
const struct pipe_image_view *images) const struct pipe_image_view *images)
{ {
struct r600_context *rctx = (struct r600_context *)ctx; struct r600_context *rctx = (struct r600_context *)ctx;
int i; unsigned i;
struct r600_image_view *rview; struct r600_image_view *rview;
struct pipe_resource *image; struct pipe_resource *image;
struct r600_resource *resource; struct r600_resource *resource;

View File

@ -558,7 +558,7 @@ int r600_isa_init(struct r600_context *ctx, struct r600_isa *isa) {
for (i = 0; i < ARRAY_SIZE(r600_alu_op_table); ++i) { for (i = 0; i < ARRAY_SIZE(r600_alu_op_table); ++i) {
const struct alu_op_info *op = &r600_alu_op_table[i]; const struct alu_op_info *op = &r600_alu_op_table[i];
unsigned opc; int opc;
if (op->flags & AF_LDS || op->slots[isa->hw_class] == 0) if (op->flags & AF_LDS || op->slots[isa->hw_class] == 0)
continue; continue;
opc = op->opcode[isa->hw_class >> 1]; opc = op->opcode[isa->hw_class >> 1];
@ -571,7 +571,7 @@ int r600_isa_init(struct r600_context *ctx, struct r600_isa *isa) {
for (i = 0; i < ARRAY_SIZE(fetch_op_table); ++i) { for (i = 0; i < ARRAY_SIZE(fetch_op_table); ++i) {
const struct fetch_op_info *op = &fetch_op_table[i]; const struct fetch_op_info *op = &fetch_op_table[i];
unsigned opc = op->opcode[isa->hw_class]; int opc = op->opcode[isa->hw_class];
if ((op->flags & FF_GDS) || ((opc & 0xFF) != opc)) if ((op->flags & FF_GDS) || ((opc & 0xFF) != opc))
continue; /* ignore GDS ops and INST_MOD versions for now */ continue; /* ignore GDS ops and INST_MOD versions for now */
isa->fetch_map[opc] = i + 1; isa->fetch_map[opc] = i + 1;
@ -579,7 +579,7 @@ int r600_isa_init(struct r600_context *ctx, struct r600_isa *isa) {
for (i = 0; i < ARRAY_SIZE(cf_op_table); ++i) { for (i = 0; i < ARRAY_SIZE(cf_op_table); ++i) {
const struct cf_op_info *op = &cf_op_table[i]; const struct cf_op_info *op = &cf_op_table[i];
unsigned opc = op->opcode[isa->hw_class]; int opc = op->opcode[isa->hw_class];
if (opc == -1) if (opc == -1)
continue; continue;
/* using offset for CF_ALU_xxx opcodes because they overlap with other /* using offset for CF_ALU_xxx opcodes because they overlap with other

View File

@ -579,7 +579,7 @@ struct r600_context {
bool gs_tri_strip_adj_fix; bool gs_tri_strip_adj_fix;
boolean dual_src_blend; boolean dual_src_blend;
unsigned zwritemask; unsigned zwritemask;
int ps_iter_samples; unsigned ps_iter_samples;
/* The list of all texture buffer objects in this context. /* The list of all texture buffer objects in this context.
* This list is walked when a buffer is invalidated/reallocated and * This list is walked when a buffer is invalidated/reallocated and

View File

@ -1310,7 +1310,7 @@ void r600_update_driver_const_buffers(struct r600_context *rctx, bool compute_on
} }
static void *r600_alloc_buf_consts(struct r600_context *rctx, int shader_type, static void *r600_alloc_buf_consts(struct r600_context *rctx, int shader_type,
int array_size, uint32_t *base_offset) unsigned array_size, uint32_t *base_offset)
{ {
struct r600_shader_driver_constants_info *info = &rctx->driver_consts[shader_type]; struct r600_shader_driver_constants_info *info = &rctx->driver_consts[shader_type];
if (array_size + R600_UCP_SIZE > info->alloc_size) { if (array_size + R600_UCP_SIZE > info->alloc_size) {
@ -1433,14 +1433,13 @@ void eg_setup_buffer_constants(struct r600_context *rctx, int shader_type)
/* set sample xy locations as array of fragment shader constants */ /* set sample xy locations as array of fragment shader constants */
void r600_set_sample_locations_constant_buffer(struct r600_context *rctx) void r600_set_sample_locations_constant_buffer(struct r600_context *rctx)
{ {
int i;
struct pipe_context *ctx = &rctx->b.b; struct pipe_context *ctx = &rctx->b.b;
assert(rctx->framebuffer.nr_samples < R600_UCP_SIZE); assert(rctx->framebuffer.nr_samples < R600_UCP_SIZE);
assert(rctx->framebuffer.nr_samples <= ARRAY_SIZE(rctx->sample_positions)/4); assert(rctx->framebuffer.nr_samples <= ARRAY_SIZE(rctx->sample_positions)/4);
memset(rctx->sample_positions, 0, 4 * 4 * 16); memset(rctx->sample_positions, 0, 4 * 4 * 16);
for (i = 0; i < rctx->framebuffer.nr_samples; i++) { for (unsigned i = 0; i < rctx->framebuffer.nr_samples; i++) {
ctx->get_sample_position(ctx, rctx->framebuffer.nr_samples, i, &rctx->sample_positions[4*i]); ctx->get_sample_position(ctx, rctx->framebuffer.nr_samples, i, &rctx->sample_positions[4*i]);
/* Also fill in center-zeroed positions used for interpolateAtSample */ /* Also fill in center-zeroed positions used for interpolateAtSample */
rctx->sample_positions[4*i + 2] = rctx->sample_positions[4*i + 0] - 0.5f; rctx->sample_positions[4*i + 2] = rctx->sample_positions[4*i + 0] - 0.5f;

View File

@ -57,7 +57,7 @@ static void set_random_pixels(struct pipe_context *ctx,
{ {
struct pipe_transfer *t; struct pipe_transfer *t;
uint8_t *map; uint8_t *map;
int x,y,z; unsigned x,y,z;
map = pipe_transfer_map_3d(ctx, tex, 0, PIPE_TRANSFER_WRITE, map = pipe_transfer_map_3d(ctx, tex, 0, PIPE_TRANSFER_WRITE,
0, 0, 0, tex->width0, tex->height0, 0, 0, 0, tex->width0, tex->height0,