intel: fix -Wunused-(but-set-)variable warnings
diff --git a/icd/intel/cmd_pipeline.c b/icd/intel/cmd_pipeline.c
index fd70805..42ac706 100644
--- a/icd/intel/cmd_pipeline.c
+++ b/icd/intel/cmd_pipeline.c
@@ -3055,7 +3055,7 @@
uint32_t vertex_base)
{
const struct intel_pipeline *p = cmd->bind.pipeline.graphics;
- const uint32_t surface_writer_used =
+ const uint32_t surface_writer_used U_ASSERT_ONLY =
cmd->writers[INTEL_CMD_WRITER_SURFACE].used;
cmd_adjust_state_base_address(cmd);
diff --git a/icd/intel/kmd/winsys_drm.c b/icd/intel/kmd/winsys_drm.c
index 769c44d..359fdc2 100644
--- a/icd/intel/kmd/winsys_drm.c
+++ b/icd/intel/kmd/winsys_drm.c
@@ -39,6 +39,7 @@
#include <intel_bufmgr.h>
#include "icd-alloc.h"
+#include "icd-utils.h"
#include "winsys.h"
struct intel_winsys {
@@ -489,7 +490,7 @@
void
intel_bo_unmap(struct intel_bo *bo)
{
- int err;
+ int err U_ASSERT_ONLY;
err = drm_intel_bo_unmap(gem_bo(bo));
assert(!err);
diff --git a/icd/intel/layout.h b/icd/intel/layout.h
index f081e37..fc86155 100644
--- a/icd/intel/layout.h
+++ b/icd/intel/layout.h
@@ -165,7 +165,8 @@
intel_layout_mem_to_raw(const struct intel_layout *layout,
unsigned mem_x, unsigned mem_y)
{
- unsigned tile_w, tile_h;
+ unsigned tile_w U_ASSERT_ONLY;
+ unsigned tile_h;
switch (layout->tiling) {
case INTEL_TILING_NONE:
diff --git a/icd/intel/view.c b/icd/intel/view.c
index 3e5299f..98d3410 100644
--- a/icd/intel/view.c
+++ b/icd/intel/view.c
@@ -353,7 +353,7 @@
*/
if (img->layout.tiling == INTEL_TILING_NONE) {
if (is_rt) {
- const int elem_size = icd_format_get_size(format);
+ const int elem_size U_ASSERT_ONLY = icd_format_get_size(format);
assert(pitch % elem_size == 0);
}
}
@@ -689,7 +689,7 @@
*/
if (img->layout.tiling == INTEL_TILING_NONE) {
if (is_rt) {
- const int elem_size = icd_format_get_size(format);
+ const int elem_size U_ASSERT_ONLY = icd_format_get_size(format);
assert(pitch % elem_size == 0);
}
}
@@ -902,8 +902,10 @@
XGL_FORMAT format, unsigned level,
unsigned first_layer, unsigned num_layers)
{
- const int max_2d_size = (intel_gpu_gen(gpu) >= INTEL_GEN(7)) ? 16384 : 8192;
- const int max_array_size = (intel_gpu_gen(gpu) >= INTEL_GEN(7)) ? 2048 : 512;
+ const int max_2d_size U_ASSERT_ONLY =
+ (intel_gpu_gen(gpu) >= INTEL_GEN(7)) ? 16384 : 8192;
+ const int max_array_size U_ASSERT_ONLY =
+ (intel_gpu_gen(gpu) >= INTEL_GEN(7)) ? 2048 : 512;
struct ds_surface_info info;
uint32_t dw1, dw2, dw3, dw4, dw5, dw6;
uint32_t *dw;