radeonsi: move and rename R600_ERR out of r600_pipe_common.h
authorMarek Olšák <marek.olsak@amd.com>
Sun, 1 Apr 2018 22:30:47 +0000 (18:30 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 5 Apr 2018 19:34:58 +0000 (15:34 -0400)
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeon/r600_texture.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_pm4.c
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state_shaders.c

index b643e81b02d3d95e14c79aaf920d798efeb09c05..fd94211fe6b9bd5e9e782cb96da83c35f5fc826d 100644 (file)
@@ -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
index d14f7e1e3f96483d4ec524bd0922f52accfdf1ad..163847eefcd2437c24af6268f9bcb6c8b1c9e61f 100644 (file)
@@ -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;
        }
 
@@ -1573,7 +1573,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;
@@ -1735,7 +1735,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;
                        }
@@ -1743,7 +1743,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;
                                }
@@ -1762,7 +1762,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;
                        }
@@ -1792,7 +1792,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;
                }
index e726268aa0ac54dc7ab05221b66b8284bf25e0f4..0ae28a235c901fa90eac554f58f5629724564eee 100644 (file)
@@ -1063,4 +1063,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
index fdaf9045910109ad5438295d470cff635ca55eda..b9f2a01786698de3ee2e86e294bea82f47adc7fa 100644 (file)
@@ -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;
        }
 
index d827885407aa35d7bee9b8a194d6fe934aa38e56..a085015d4dc060a936c18f48e503b3ceba7e1e7f 100644 (file)
@@ -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);
@@ -2934,7 +2934,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);
                }
index b6a618ddd592bcf91b2a058c02f321c6f434b680..eff7b810d567f963544808b5f4b273e08864c1d7 100644 (file)
@@ -1511,7 +1511,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;