[Mesa-dev] [PATCH 43/55] radeonsi: move and rename R600_ERR out of r600_pipe_common.h

Marek Olšák maraeo at gmail.com
Mon Apr 2 04:08:36 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeon/r600_pipe_common.h   |  3 ---
 src/gallium/drivers/radeon/r600_texture.c       | 14 +++++++-------
 src/gallium/drivers/radeonsi/si_pipe.h          |  3 +++
 src/gallium/drivers/radeonsi/si_pm4.c           |  2 +-
 src/gallium/drivers/radeonsi/si_state.c         | 14 +++++++-------
 src/gallium/drivers/radeonsi/si_state_shaders.c |  2 +-
 6 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index b643e81..fd94211 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -521,7 +521,4 @@ vi_dcc_enabled(struct r600_texture *tex, unsigned level)
 	return tex->dcc_offset && level < tex->surface.num_dcc_levels;
 }
 
-#define R600_ERR(fmt, args...) \
-	fprintf(stderr, "EE %s:%d %s - " fmt, __FILE__, __LINE__, __func__, ##args)
-
 #endif
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index d769b9f..9142d56 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -868,13 +868,13 @@ void si_texture_get_fmask_info(struct si_screen *sscreen,
 		bpe = 4;
 		break;
 	default:
-		R600_ERR("Invalid sample count for FMASK allocation.\n");
+		PRINT_ERR("Invalid sample count for FMASK allocation.\n");
 		return;
 	}
 
 	if (sscreen->ws->surface_init(sscreen->ws, &templ, flags, bpe,
 				      RADEON_SURF_MODE_2D, &fmask)) {
-		R600_ERR("Got error in surface_init while allocating FMASK.\n");
+		PRINT_ERR("Got error in surface_init while allocating FMASK.\n");
 		return;
 	}
 
@@ -1572,7 +1572,7 @@ bool si_init_flushed_depth_texture(struct pipe_context *ctx,
 
 	*flushed_depth_texture = (struct r600_texture *)ctx->screen->resource_create(ctx->screen, &resource);
 	if (*flushed_depth_texture == NULL) {
-		R600_ERR("failed to create temporary texture to hold flushed depth\n");
+		PRINT_ERR("failed to create temporary texture to hold flushed depth\n");
 		return false;
 	}
 	return true;
@@ -1734,7 +1734,7 @@ static void *si_texture_transfer_map(struct pipe_context *ctx,
 			si_init_temp_resource_from_box(&resource, texture, box, level, 0);
 
 			if (!si_init_flushed_depth_texture(ctx, &resource, &staging_depth)) {
-				R600_ERR("failed to create temporary texture to hold untiled copy\n");
+				PRINT_ERR("failed to create temporary texture to hold untiled copy\n");
 				FREE(trans);
 				return NULL;
 			}
@@ -1742,7 +1742,7 @@ static void *si_texture_transfer_map(struct pipe_context *ctx,
 			if (usage & PIPE_TRANSFER_READ) {
 				struct pipe_resource *temp = ctx->screen->resource_create(ctx->screen, &resource);
 				if (!temp) {
-					R600_ERR("failed to create a temporary depth texture\n");
+					PRINT_ERR("failed to create a temporary depth texture\n");
 					FREE(trans);
 					return NULL;
 				}
@@ -1761,7 +1761,7 @@ static void *si_texture_transfer_map(struct pipe_context *ctx,
 			/* XXX: only readback the rectangle which is being mapped? */
 			/* XXX: when discard is true, no need to read back from depth texture */
 			if (!si_init_flushed_depth_texture(ctx, texture, &staging_depth)) {
-				R600_ERR("failed to create temporary texture to hold untiled copy\n");
+				PRINT_ERR("failed to create temporary texture to hold untiled copy\n");
 				FREE(trans);
 				return NULL;
 			}
@@ -1791,7 +1791,7 @@ static void *si_texture_transfer_map(struct pipe_context *ctx,
 		/* Create the temporary texture. */
 		staging = (struct r600_texture*)ctx->screen->resource_create(ctx->screen, &resource);
 		if (!staging) {
-			R600_ERR("failed to create temporary texture to hold untiled copy\n");
+			PRINT_ERR("failed to create temporary texture to hold untiled copy\n");
 			FREE(trans);
 			return NULL;
 		}
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 9d239cd..5087390 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -1052,4 +1052,7 @@ static inline unsigned si_get_total_colormask(struct si_context *sctx)
 	return colormask;
 }
 
+#define PRINT_ERR(fmt, args...) \
+	fprintf(stderr, "EE %s:%d %s - " fmt, __FILE__, __LINE__, __func__, ##args)
+
 #endif
diff --git a/src/gallium/drivers/radeonsi/si_pm4.c b/src/gallium/drivers/radeonsi/si_pm4.c
index fdaf904..b9f2a01 100644
--- a/src/gallium/drivers/radeonsi/si_pm4.c
+++ b/src/gallium/drivers/radeonsi/si_pm4.c
@@ -69,7 +69,7 @@ void si_pm4_set_reg(struct si_pm4_state *state, unsigned reg, uint32_t val)
 		reg -= CIK_UCONFIG_REG_OFFSET;
 
 	} else {
-		R600_ERR("Invalid register offset %08x!\n", reg);
+		PRINT_ERR("Invalid register offset %08x!\n", reg);
 		return;
 	}
 
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 9e94bff..76ba62c 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -293,7 +293,7 @@ static uint32_t si_translate_blend_function(int blend_func)
 	case PIPE_BLEND_MAX:
 		return V_028780_COMB_MAX_DST_SRC;
 	default:
-		R600_ERR("Unknown blend function %d\n", blend_func);
+		PRINT_ERR("Unknown blend function %d\n", blend_func);
 		assert(0);
 		break;
 	}
@@ -342,7 +342,7 @@ static uint32_t si_translate_blend_factor(int blend_fact)
 	case PIPE_BLENDFACTOR_INV_SRC1_ALPHA:
 		return V_028780_BLEND_INV_SRC1_ALPHA;
 	default:
-		R600_ERR("Bad blend factor %d not supported!\n", blend_fact);
+		PRINT_ERR("Bad blend factor %d not supported!\n", blend_fact);
 		assert(0);
 		break;
 	}
@@ -1133,7 +1133,7 @@ static uint32_t si_translate_stencil_op(int s_op)
 	case PIPE_STENCIL_OP_INVERT:
 		return V_02842C_STENCIL_INVERT;
 	default:
-		R600_ERR("Unknown stencil op %d", s_op);
+		PRINT_ERR("Unknown stencil op %d", s_op);
 		assert(0);
 		break;
 	}
@@ -2143,7 +2143,7 @@ static boolean si_is_format_supported(struct pipe_screen *screen,
 	unsigned retval = 0;
 
 	if (target >= PIPE_MAX_TEXTURE_TYPES) {
-		R600_ERR("r600: unsupported texture type %d\n", target);
+		PRINT_ERR("r600: unsupported texture type %d\n", target);
 		return false;
 	}
 
@@ -2381,7 +2381,7 @@ static void si_initialize_color_surface(struct si_context *sctx,
 
 	format = si_translate_colorformat(surf->base.format);
 	if (format == V_028C70_COLOR_INVALID) {
-		R600_ERR("Invalid CB format: %d, disabling CB.\n", surf->base.format);
+		PRINT_ERR("Invalid CB format: %d, disabling CB.\n", surf->base.format);
 	}
 	assert(format != V_028C70_COLOR_INVALID);
 	swap = si_translate_colorswap(surf->base.format, false);
@@ -2513,7 +2513,7 @@ static void si_init_depth_surface(struct si_context *sctx,
 
 	assert(format != V_028040_Z_INVALID);
 	if (format == V_028040_Z_INVALID)
-		R600_ERR("Invalid DB format: %d, disabling DB.\n", rtex->resource.b.b.format);
+		PRINT_ERR("Invalid DB format: %d, disabling DB.\n", rtex->resource.b.b.format);
 
 	surf->db_depth_view = S_028008_SLICE_START(surf->base.u.tex.first_layer) |
 			      S_028008_SLICE_MAX(surf->base.u.tex.last_layer);
@@ -2932,7 +2932,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
 			constbuf.user_buffer = sctx->sample_locations_16x;
 			break;
 		default:
-			R600_ERR("Requested an invalid number of samples %i.\n",
+			PRINT_ERR("Requested an invalid number of samples %i.\n",
 				 sctx->framebuffer.nr_samples);
 			assert(0);
 		}
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 52f2d8f..581b83b 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1494,7 +1494,7 @@ static void si_build_shader_variant(struct si_shader *shader,
 
 	r = si_shader_create(sscreen, tm, shader, debug);
 	if (unlikely(r)) {
-		R600_ERR("Failed to build shader variant (type=%u) %d\n",
+		PRINT_ERR("Failed to build shader variant (type=%u) %d\n",
 			 sel->type, r);
 		shader->compilation_failed = true;
 		return;
-- 
2.7.4



More information about the mesa-dev mailing list