diff --git a/src/broadcom/common/v3d_debug.c b/src/broadcom/common/v3d_debug.c index b6b32bc72ad..e55ff4a3d58 100644 --- a/src/broadcom/common/v3d_debug.c +++ b/src/broadcom/common/v3d_debug.c @@ -82,8 +82,6 @@ static const struct debug_named_value debug_control[] = { "Precompiles shader variant at shader state creation time (v3d only)" }, { "ra", V3D_DEBUG_RA, "Dump register allocation failures" }, - { "dump_spirv", V3D_DEBUG_DUMP_SPIRV, - "Dump SPIR-V code (v3dv only)" }, { "tmu32", V3D_DEBUG_TMU_32BIT, "Force 32-bit precision on all TMU operations" }, /* This can lead to incorrect behavior for applications that do diff --git a/src/broadcom/common/v3d_debug.h b/src/broadcom/common/v3d_debug.h index 67112ebf361..4b05bd300e0 100644 --- a/src/broadcom/common/v3d_debug.h +++ b/src/broadcom/common/v3d_debug.h @@ -60,7 +60,6 @@ extern uint32_t v3d_mesa_debug; #define V3D_DEBUG_CLIF (1 << 14) #define V3D_DEBUG_PRECOMPILE (1 << 15) #define V3D_DEBUG_RA (1 << 16) -#define V3D_DEBUG_DUMP_SPIRV (1 << 17) #define V3D_DEBUG_TMU_32BIT (1 << 18) #define V3D_DEBUG_TMU_16BIT (1 << 19) #define V3D_DEBUG_NO_LOOP_UNROLL (1 << 20) diff --git a/src/broadcom/vulkan/meson.build b/src/broadcom/vulkan/meson.build index 17cd81e9fc8..46ab70ecbf9 100644 --- a/src/broadcom/vulkan/meson.build +++ b/src/broadcom/vulkan/meson.build @@ -19,7 +19,6 @@ libv3dv_files = files( 'v3dv_bo.c', 'v3dv_cl.c', 'v3dv_cmd_buffer.c', - 'v3dv_debug.c', 'v3dv_debug.h', 'v3dv_descriptor_set.c', 'v3dv_device.c', diff --git a/src/broadcom/vulkan/v3dv_debug.c b/src/broadcom/vulkan/v3dv_debug.c deleted file mode 100644 index 065e8f66026..00000000000 --- a/src/broadcom/vulkan/v3dv_debug.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright © 2019 Raspberry Pi Ltd - * - * based in part on radv_debug.h which is: - * Copyright © 2017 Google. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ -#include "v3dv_debug.h" -#include "unistd.h" - -#include "v3dv_debug.h" -#include - -void -v3dv_print_spirv(const char *data, uint32_t size, FILE *fp) -{ - char path[] = "/tmp/fileXXXXXX"; - char line[2048], command[128]; - FILE *p; - int fd; - - /* Dump the binary into a temporary file. */ - fd = mkstemp(path); - if (fd < 0) - return; - - if (write(fd, data, size) == -1) - goto fail; - - sprintf(command, "spirv-dis %s", path); - - /* Disassemble using spirv-dis if installed. */ - p = popen(command, "r"); - if (p) { - while (fgets(line, sizeof(line), p)) - fprintf(fp, "%s", line); - pclose(p); - } - - fail: - close(fd); - unlink(path); -} diff --git a/src/broadcom/vulkan/v3dv_debug.h b/src/broadcom/vulkan/v3dv_debug.h index bab21eef2b8..26814550a51 100644 --- a/src/broadcom/vulkan/v3dv_debug.h +++ b/src/broadcom/vulkan/v3dv_debug.h @@ -29,10 +29,6 @@ #include "v3dv_private.h" -/* FIXME: C&P from radv, perhaps a common place?*/ -void -v3dv_print_spirv(const char *data, uint32_t size, FILE *fp); - void v3dv_print_v3d_key(struct v3d_key *key, uint32_t v3d_key_size); diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index 249191c0da4..534a3c47baf 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -353,21 +353,6 @@ shader_module_compile_to_nir(struct v3dv_device *device, gl_shader_stage gl_stage = broadcom_shader_stage_to_gl(stage->stage); - if (V3D_DBG(DUMP_SPIRV)) { - char *spirv_data = NULL; - uint32_t spirv_size = 0; - if (stage->module != NULL && !stage->module->nir) { - spirv_data = (char *) stage->module->data; - spirv_size = stage->module->size; - } else if (stage->module_info) { - spirv_data = (char *) stage->module_info->pCode; - spirv_size = stage->module_info->codeSize; - } - - if (spirv_data) - v3dv_print_spirv(spirv_data, spirv_size, stderr); - } - const VkPipelineShaderStageCreateInfo stage_info = { .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, .pNext = !stage->module ? stage->module_info : NULL,