[Mesa-dev] [PATCH 1/5] panfrost: Remove if 0'd dead code

Alyssa Rosenzweig alyssa at rosenzweig.io
Sat Feb 9 01:21:41 UTC 2019


Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
---
 .../drivers/panfrost/midgard/cmdline.c        | 11 ------
 src/gallium/drivers/panfrost/pan_assemble.c   | 14 -------
 .../drivers/panfrost/pan_blend_shaders.c      | 16 --------
 src/gallium/drivers/panfrost/pan_context.c    |  5 ---
 src/gallium/drivers/panfrost/pan_swizzle.c    | 37 -------------------
 5 files changed, 83 deletions(-)

diff --git a/src/gallium/drivers/panfrost/midgard/cmdline.c b/src/gallium/drivers/panfrost/midgard/cmdline.c
index 15d2bbde16a..1aa0323bb0d 100644
--- a/src/gallium/drivers/panfrost/midgard/cmdline.c
+++ b/src/gallium/drivers/panfrost/midgard/cmdline.c
@@ -86,17 +86,6 @@ compile_blend(char **argv)
         prog = standalone_compile_shader(&options, 1, argv);
         prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program->info.stage = MESA_SHADER_FRAGMENT;
 
-#if 0
-
-        for (unsigned i = 0; i < MESA_SHADER_STAGES; ++i) {
-                if (prog->_LinkedShaders[i] == NULL)
-                        continue;
-
-                c_do_mat_op_to_vec(prog->_LinkedShaders[i]->ir);
-        }
-
-#endif
-
         midgard_program program;
         nir = glsl_to_nir(prog, MESA_SHADER_FRAGMENT, &midgard_nir_options);
         midgard_compile_shader_nir(nir, &program, true);
diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c
index 91cde49f0d2..44136acc18a 100644
--- a/src/gallium/drivers/panfrost/pan_assemble.c
+++ b/src/gallium/drivers/panfrost/pan_assemble.c
@@ -73,20 +73,6 @@ panfrost_shader_compile(struct panfrost_context *ctx, struct mali_shader_meta *m
         int size = program.compiled.size;
         dst = program.compiled.data;
 
-        /* Inject an external shader */
-#if 0
-        char buf[4096];
-
-        if (type != JOB_TYPE_VERTEX) {
-                FILE *fp = fopen("/home/alyssa/panfrost/midgard/good.bin", "rb");
-                fread(buf, 1, 2816, fp);
-                fclose(fp);
-                dst = buf;
-                size = 2816;
-        }
-
-#endif
-
         /* Upload the shader. The lookahead tag is ORed on as a tagged pointer.
          * I bet someone just thought that would be a cute pun. At least,
          * that's how I'd do it. */
diff --git a/src/gallium/drivers/panfrost/pan_blend_shaders.c b/src/gallium/drivers/panfrost/pan_blend_shaders.c
index 566c6652fda..648e84b0350 100644
--- a/src/gallium/drivers/panfrost/pan_blend_shaders.c
+++ b/src/gallium/drivers/panfrost/pan_blend_shaders.c
@@ -143,22 +143,6 @@ panfrost_make_blend_shader(struct panfrost_context *ctx, struct panfrost_blend_s
         int size = program.compiled.size;
         uint8_t *dst = program.compiled.data;
 
-#if 0
-        midgard_program program = {
-                .work_register_count = 3,
-                .first_tag = 9,
-                //.blend_patch_offset = 16
-                .blend_patch_offset = -1,
-        };
-
-        char dst[4096];
-
-        FILE *fp = fopen("/home/alyssa/panfrost/midgard/blend.bin", "rb");
-        fread(dst, 1, 2816, fp);
-        fclose(fp);
-        int size = 2816;
-#endif
-
         /* Hot patch in constant color */
 
         if (program.blend_patch_offset >= 0) {
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index fb4130362e0..b60d67da9b4 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2276,11 +2276,6 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
         /* Force a clear XXX wrong? */
         if (ctx->last_clear.color)
                 panfrost_clear(&ctx->base, ctx->last_clear.buffers, ctx->last_clear.color, ctx->last_clear.depth, ctx->last_clear.stencil);
-
-#if 0
-        /* Don't consider the buffer dirty */
-        ctx->dirty &= ~PAN_DIRTY_CLEAR;
-#endif
 }
 
 static void *
diff --git a/src/gallium/drivers/panfrost/pan_swizzle.c b/src/gallium/drivers/panfrost/pan_swizzle.c
index c021843846d..0fe8b3cfa21 100644
--- a/src/gallium/drivers/panfrost/pan_swizzle.c
+++ b/src/gallium/drivers/panfrost/pan_swizzle.c
@@ -195,40 +195,3 @@ panfrost_swizzled_size(int width, int height, int bytes_per_pixel)
 
         return sz;
 }
-
-#if 0
-#include <stdio.h>
-#include <stdlib.h>
-#include <memory.h>
-#define TW 1920
-#define TH 1080
-void
-main()
-{
-        panfrost_generate_space_filler_indices();
-
-        uint8_t in[TW * TH * 4];
-
-        for (int i = 0; i < TW * TH * 4; ++i) in[i] = i;
-
-        uint8_t *out = malloc(TW * TH * 4 * 2);
-
-        for (int i = 0; i < 60; ++i) {
-                //swizzle_bpp4_align16(TW, TH, TW*4, TW>>4, (uint32_t *) in, (uint32_t *) out);
-                //panfrost_texture_swizzle_bpp4(TW, TH, TW*4, (uint32_t *) in, (uint32_t *) out);
-                //panfrost_texture_swizzle(TW, TH, 4, TW*4, (uint32_t *) in, (uint32_t *) out);
-
-                int block_pitch = ALIGN(TW, 16) >> 4;
-                swizzle_bpp1_align16(TW, TH, TW, (block_pitch * 256 >> 4), in, (uint8_t *) out);
-        }
-
-#if 0
-        uint8_t *reference = malloc(TW * TH * 4 * 2);
-        panfrost_texture_swizzle(TW, TH, 1, TW, (uint8_t *) in, (uint8_t *) reference);
-
-        if (memcmp(reference, out, TW * TH * 4)) printf("XXX\n");
-
-#endif
-        printf("ref %X\n", out[0]);
-}
-#endif
-- 
2.20.1



More information about the mesa-dev mailing list