summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-07-10 17:00:34 -0700
committerEric Anholt <eric@anholt.net>2015-07-14 11:39:28 -0700
commitcd7dd45bfec9ad68719c5e4e04b66ea4bcc1a2c1 (patch)
tree4f36da58f8ce43869330dd5b4759070d90482fe7 /src
parent1e80c9fab98d7de216937a47f8e231f3beb78403 (diff)
vc4: Fix compiler warnings on release builds.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c2
-rw-r--r--src/gallium/drivers/vc4/vc4_qpu_emit.c1
-rw-r--r--src/gallium/drivers/vc4/vc4_qpu_validate.c7
-rw-r--r--src/gallium/drivers/vc4/vc4_tiling.c11
4 files changed, 14 insertions, 7 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index e61ea2170f..df440f627e 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -1748,6 +1748,7 @@ ntq_setup_inputs(struct vc4_compile *c)
unsigned loc = var->data.driver_location;
assert(array_len == 1);
+ (void)array_len;
resize_qreg_array(c, &c->inputs, &c->inputs_array_size,
(loc + 1) * 4);
@@ -1782,6 +1783,7 @@ ntq_setup_outputs(struct vc4_compile *c)
unsigned loc = var->data.driver_location * 4;
assert(array_len == 1);
+ (void)array_len;
/* NIR hack to pass through
* TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS */
diff --git a/src/gallium/drivers/vc4/vc4_qpu_emit.c b/src/gallium/drivers/vc4/vc4_qpu_emit.c
index 99afe4b879..e1b3f3ce99 100644
--- a/src/gallium/drivers/vc4/vc4_qpu_emit.c
+++ b/src/gallium/drivers/vc4/vc4_qpu_emit.c
@@ -234,6 +234,7 @@ vc4_generate_code(struct vc4_context *vc4, struct vc4_compile *c)
case QFILE_VPM:
assert((int)qinst->src[i].index >=
last_vpm_read_index);
+ (void)last_vpm_read_index;
last_vpm_read_index = qinst->src[i].index;
src[i] = qpu_ra(QPU_R_VPM);
break;
diff --git a/src/gallium/drivers/vc4/vc4_qpu_validate.c b/src/gallium/drivers/vc4/vc4_qpu_validate.c
index 8471edbf62..9cf6841f41 100644
--- a/src/gallium/drivers/vc4/vc4_qpu_validate.c
+++ b/src/gallium/drivers/vc4/vc4_qpu_validate.c
@@ -23,6 +23,13 @@
#include "vc4_qpu.h"
+#ifdef NDEBUG
+/* Since most of our code is used in assert()s, don't warn about dead code. */
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+#endif
+
static bool
writes_reg(uint64_t inst, uint32_t w)
{
diff --git a/src/gallium/drivers/vc4/vc4_tiling.c b/src/gallium/drivers/vc4/vc4_tiling.c
index f9801c9cef..cf86eb0fa3 100644
--- a/src/gallium/drivers/vc4/vc4_tiling.c
+++ b/src/gallium/drivers/vc4/vc4_tiling.c
@@ -127,13 +127,10 @@ vc4_store_utile(void *dst, void *src, uint32_t src_stride, uint32_t cpp)
static void
check_box_utile_alignment(const struct pipe_box *box, int cpp)
{
- uint32_t utile_w = vc4_utile_width(cpp);
- uint32_t utile_h = vc4_utile_height(cpp);
-
- assert(!(box->x & (utile_w - 1)));
- assert(!(box->y & (utile_h - 1)));
- assert(!(box->width & (utile_w - 1)));
- assert(!(box->height & (utile_h - 1)));
+ assert(!(box->x & (vc4_utile_width(cpp) - 1)));
+ assert(!(box->y & (vc4_utile_height(cpp) - 1)));
+ assert(!(box->width & (vc4_utile_width(cpp) - 1)));
+ assert(!(box->height & (vc4_utile_height(cpp) - 1)));
}
static void