diff --git a/src/gallium/drivers/panfrost/pan_blend_cso.c b/src/gallium/drivers/panfrost/pan_blend_cso.c index b937a64a164..ecc9b92cc77 100644 --- a/src/gallium/drivers/panfrost/pan_blend_cso.c +++ b/src/gallium/drivers/panfrost/pan_blend_cso.c @@ -9,7 +9,7 @@ #include "compiler/nir/nir.h" #include "compiler/nir/nir_builder.h" #include "pan_shader.h" -#include "panfrost/util/pan_lower_framebuffer.h" +#include "panfrost/compiler/pan_nir_lower_framebuffer.h" #include "pan_context.h" #ifndef PAN_ARCH diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 9264477fd5e..fc79370fa97 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -51,7 +51,6 @@ #include "clc/pan_compile.h" #include "compiler/nir/nir_serialize.h" -#include "util/pan_lower_framebuffer.h" #include "decode.h" #include "pan_device.h" #include "pan_fence.h" diff --git a/src/gallium/drivers/panfrost/pan_device.h b/src/gallium/drivers/panfrost/pan_device.h index 02bcd9e092c..cf18b0b33a1 100644 --- a/src/gallium/drivers/panfrost/pan_device.h +++ b/src/gallium/drivers/panfrost/pan_device.h @@ -38,7 +38,7 @@ #include "util/timespec.h" #include "util/u_dynarray.h" -#include "panfrost/util/pan_ir.h" +#include "panfrost/compiler/pan_ir.h" #include "pan_blend_cso.h" #include "pan_fb_preload.h" #include "pan_pool.h" diff --git a/src/gallium/drivers/panfrost/pan_mod_conv_cso.h b/src/gallium/drivers/panfrost/pan_mod_conv_cso.h index 5f1fffe1fed..7531cad44a8 100644 --- a/src/gallium/drivers/panfrost/pan_mod_conv_cso.h +++ b/src/gallium/drivers/panfrost/pan_mod_conv_cso.h @@ -26,7 +26,7 @@ #include "util/hash_table.h" -#include "panfrost/util/pan_ir.h" +#include "panfrost/compiler/pan_ir.h" #include "drm-uapi/drm_fourcc.h" diff --git a/src/panfrost/clc/pan_compile.c b/src/panfrost/clc/pan_compile.c index f89b01405c2..1fda131f9a2 100644 --- a/src/panfrost/clc/pan_compile.c +++ b/src/panfrost/clc/pan_compile.c @@ -24,7 +24,7 @@ #include #include #include -#include "panfrost/util/pan_ir.h" +#include "panfrost/compiler/pan_ir.h" #include "util/macros.h" #include "util/u_dynarray.h" #include "util/u_printf.h" diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.c b/src/panfrost/compiler/bifrost/bifrost_compile.c index 4139f472f62..d0db87ca609 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost/bifrost_compile.c @@ -30,7 +30,7 @@ #include "compiler/glsl_types.h" #include "compiler/nir/nir_builder.h" #include "compiler/nir/nir_deref.h" -#include "panfrost/util/pan_ir.h" +#include "panfrost/compiler/pan_ir.h" #include "util/perf/cpu_trace.h" #include "util/u_debug.h" #include "util/u_qsort.h" diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.h b/src/panfrost/compiler/bifrost/bifrost_compile.h index 9998063e2bc..56ac939cb63 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.h +++ b/src/panfrost/compiler/bifrost/bifrost_compile.h @@ -27,7 +27,7 @@ #include #include #include "compiler/nir/nir.h" -#include "panfrost/util/pan_ir.h" +#include "panfrost/compiler/pan_ir.h" #include "util/u_dynarray.h" struct bifrost_precompiled_kernel_sysvals { diff --git a/src/panfrost/compiler/bifrost/compiler.h b/src/panfrost/compiler/bifrost/compiler.h index b7861ede390..c337bf1b7d5 100644 --- a/src/panfrost/compiler/bifrost/compiler.h +++ b/src/panfrost/compiler/bifrost/compiler.h @@ -28,7 +28,7 @@ #define __BIFROST_COMPILER_H #include "compiler/nir/nir.h" -#include "panfrost/util/pan_ir.h" +#include "panfrost/compiler/pan_ir.h" #include "util/half_float.h" #include "util/shader_stats.h" #include "util/u_math.h" diff --git a/src/panfrost/compiler/meson.build b/src/panfrost/compiler/meson.build index fe78be0e4df..ee27bda3926 100644 --- a/src/panfrost/compiler/meson.build +++ b/src/panfrost/compiler/meson.build @@ -1,5 +1,32 @@ # Copyright © 2025 Collabora, Ltd. # SPDX-License-Identifier: MIT +libpanfrost_util_files = files( + 'pan_ir.c', + 'pan_ir.h', + 'pan_nir_collect_varyings.c', + 'pan_nir_lower_frag_coord_zw.c', + 'pan_nir_lower_framebuffer.c', + 'pan_nir_lower_helper_invocation.c', + 'pan_nir_lower_image_index.c', + 'pan_nir_lower_image_ms.c', + 'pan_nir_lower_noperspective.c', + 'pan_nir_lower_sample_position.c', + 'pan_nir_lower_store_component.c', + 'pan_nir_lower_vertex_id.c', + 'pan_nir_lower_writeout.c', + 'pan_nir_lower_xfb.c', +) + +libpanfrost_util = static_library( + 'panfrost_util', + [libpanfrost_util_files], + include_directories : [inc_include, inc_src], + dependencies: [idep_nir, idep_mesautil], + c_args : [no_override_init_args], + gnu_symbol_visibility : 'hidden', + build_by_default : false, +) + subdir('bifrost') subdir('midgard') diff --git a/src/panfrost/compiler/midgard/compiler.h b/src/panfrost/compiler/midgard/compiler.h index f68162a89be..b936539ffdb 100644 --- a/src/panfrost/compiler/midgard/compiler.h +++ b/src/panfrost/compiler/midgard/compiler.h @@ -38,7 +38,7 @@ #include "compiler/glsl_types.h" #include "compiler/nir/nir.h" -#include "panfrost/util/pan_ir.h" +#include "panfrost/compiler/pan_ir.h" /* Forward declare */ struct midgard_block; diff --git a/src/panfrost/compiler/midgard/midgard_compile.h b/src/panfrost/compiler/midgard/midgard_compile.h index 825665d6c2e..f03ce69abc5 100644 --- a/src/panfrost/compiler/midgard/midgard_compile.h +++ b/src/panfrost/compiler/midgard/midgard_compile.h @@ -26,7 +26,7 @@ #define __MIDGARD_H_ #include "compiler/nir/nir.h" -#include "panfrost/util/pan_ir.h" +#include "panfrost/compiler/pan_ir.h" #include "util/u_dynarray.h" void midgard_preprocess_nir(nir_shader *nir, unsigned gpu_id); diff --git a/src/panfrost/compiler/midgard/midgard_liveness.c b/src/panfrost/compiler/midgard/midgard_liveness.c index abd0df89191..cf272c5416a 100644 --- a/src/panfrost/compiler/midgard/midgard_liveness.c +++ b/src/panfrost/compiler/midgard/midgard_liveness.c @@ -22,7 +22,6 @@ * SOFTWARE. */ -#include "panfrost/util/pan_ir.h" #include "compiler.h" /* Routines for liveness analysis. Liveness is tracked per byte per node. Per diff --git a/src/panfrost/compiler/midgard/nir_fuse_io_16.c b/src/panfrost/compiler/midgard/nir_fuse_io_16.c index 8b80bd87375..d7186187eec 100644 --- a/src/panfrost/compiler/midgard/nir_fuse_io_16.c +++ b/src/panfrost/compiler/midgard/nir_fuse_io_16.c @@ -28,7 +28,6 @@ #include "compiler/nir/nir.h" #include "compiler/nir/nir_builder.h" -#include "panfrost/util/pan_ir.h" bool nir_fuse_io_16(nir_shader *shader); diff --git a/src/panfrost/util/pan_ir.c b/src/panfrost/compiler/pan_ir.c similarity index 100% rename from src/panfrost/util/pan_ir.c rename to src/panfrost/compiler/pan_ir.c diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/compiler/pan_ir.h similarity index 100% rename from src/panfrost/util/pan_ir.h rename to src/panfrost/compiler/pan_ir.h diff --git a/src/panfrost/util/pan_collect_varyings.c b/src/panfrost/compiler/pan_nir_collect_varyings.c similarity index 100% rename from src/panfrost/util/pan_collect_varyings.c rename to src/panfrost/compiler/pan_nir_collect_varyings.c diff --git a/src/panfrost/util/pan_lower_frag_coord_zw.c b/src/panfrost/compiler/pan_nir_lower_frag_coord_zw.c similarity index 100% rename from src/panfrost/util/pan_lower_frag_coord_zw.c rename to src/panfrost/compiler/pan_nir_lower_frag_coord_zw.c diff --git a/src/panfrost/util/pan_lower_framebuffer.c b/src/panfrost/compiler/pan_nir_lower_framebuffer.c similarity index 99% rename from src/panfrost/util/pan_lower_framebuffer.c rename to src/panfrost/compiler/pan_nir_lower_framebuffer.c index eb424f6d469..461bf4a9b5b 100644 --- a/src/panfrost/util/pan_lower_framebuffer.c +++ b/src/panfrost/compiler/pan_nir_lower_framebuffer.c @@ -47,7 +47,7 @@ * smallest precision necessary to store the pixel losslessly. */ -#include "pan_lower_framebuffer.h" +#include "pan_nir_lower_framebuffer.h" #include "compiler/nir/nir.h" #include "compiler/nir/nir_builder.h" #include "compiler/nir/nir_format_convert.h" diff --git a/src/panfrost/util/pan_lower_framebuffer.h b/src/panfrost/compiler/pan_nir_lower_framebuffer.h similarity index 100% rename from src/panfrost/util/pan_lower_framebuffer.h rename to src/panfrost/compiler/pan_nir_lower_framebuffer.h diff --git a/src/panfrost/util/pan_lower_helper_invocation.c b/src/panfrost/compiler/pan_nir_lower_helper_invocation.c similarity index 100% rename from src/panfrost/util/pan_lower_helper_invocation.c rename to src/panfrost/compiler/pan_nir_lower_helper_invocation.c diff --git a/src/panfrost/util/pan_lower_image_index.c b/src/panfrost/compiler/pan_nir_lower_image_index.c similarity index 100% rename from src/panfrost/util/pan_lower_image_index.c rename to src/panfrost/compiler/pan_nir_lower_image_index.c diff --git a/src/panfrost/util/pan_lower_image_ms.c b/src/panfrost/compiler/pan_nir_lower_image_ms.c similarity index 100% rename from src/panfrost/util/pan_lower_image_ms.c rename to src/panfrost/compiler/pan_nir_lower_image_ms.c diff --git a/src/panfrost/util/pan_lower_noperspective.c b/src/panfrost/compiler/pan_nir_lower_noperspective.c similarity index 100% rename from src/panfrost/util/pan_lower_noperspective.c rename to src/panfrost/compiler/pan_nir_lower_noperspective.c diff --git a/src/panfrost/util/pan_lower_sample_position.c b/src/panfrost/compiler/pan_nir_lower_sample_position.c similarity index 100% rename from src/panfrost/util/pan_lower_sample_position.c rename to src/panfrost/compiler/pan_nir_lower_sample_position.c diff --git a/src/panfrost/util/pan_lower_store_component.c b/src/panfrost/compiler/pan_nir_lower_store_component.c similarity index 100% rename from src/panfrost/util/pan_lower_store_component.c rename to src/panfrost/compiler/pan_nir_lower_store_component.c diff --git a/src/panfrost/util/pan_lower_vertex_id.c b/src/panfrost/compiler/pan_nir_lower_vertex_id.c similarity index 100% rename from src/panfrost/util/pan_lower_vertex_id.c rename to src/panfrost/compiler/pan_nir_lower_vertex_id.c diff --git a/src/panfrost/util/pan_lower_writeout.c b/src/panfrost/compiler/pan_nir_lower_writeout.c similarity index 100% rename from src/panfrost/util/pan_lower_writeout.c rename to src/panfrost/compiler/pan_nir_lower_writeout.c diff --git a/src/panfrost/util/pan_lower_xfb.c b/src/panfrost/compiler/pan_nir_lower_xfb.c similarity index 100% rename from src/panfrost/util/pan_lower_xfb.c rename to src/panfrost/compiler/pan_nir_lower_xfb.c diff --git a/src/panfrost/lib/pan_blend.h b/src/panfrost/lib/pan_blend.h index 9e3aececda6..037235bf0f5 100644 --- a/src/panfrost/lib/pan_blend.h +++ b/src/panfrost/lib/pan_blend.h @@ -31,8 +31,6 @@ #include "util/blend.h" #include "util/format/u_format.h" -#include "panfrost/util/pan_ir.h" - struct MALI_BLEND_EQUATION; struct pan_blend_equation { diff --git a/src/panfrost/lib/pan_earlyzs.c b/src/panfrost/lib/pan_earlyzs.c index 6a5c467d216..9f55bc22661 100644 --- a/src/panfrost/lib/pan_earlyzs.c +++ b/src/panfrost/lib/pan_earlyzs.c @@ -24,7 +24,7 @@ #include "genxml/gen_macros.h" #include "pan_earlyzs.h" -#include "panfrost/util/pan_ir.h" +#include "panfrost/compiler/pan_ir.h" /* diff --git a/src/panfrost/lib/pan_props.c b/src/panfrost/lib/pan_props.c index 49697f881d7..800239f6b65 100644 --- a/src/panfrost/lib/pan_props.c +++ b/src/panfrost/lib/pan_props.c @@ -27,7 +27,6 @@ #include "util/macros.h" #include "kmod/pan_kmod.h" -#include "panfrost/util/pan_ir.h" #include "pan_props.h" #include diff --git a/src/panfrost/lib/pan_shader.h b/src/panfrost/lib/pan_shader.h index e497dbcc977..c8d08a6f478 100644 --- a/src/panfrost/lib/pan_shader.h +++ b/src/panfrost/lib/pan_shader.h @@ -31,8 +31,8 @@ #include "panfrost/compiler/bifrost/valhall/disassemble.h" #include "panfrost/compiler/midgard/disassemble.h" #include "panfrost/lib/pan_props.h" -#include "panfrost/util/pan_ir.h" -#include "panfrost/util/pan_lower_framebuffer.h" +#include "panfrost/compiler/pan_ir.h" +#include "panfrost/compiler/pan_nir_lower_framebuffer.h" void bifrost_preprocess_nir(nir_shader *nir, unsigned gpu_id); void bifrost_optimize_nir(nir_shader *nir, unsigned gpu_id); diff --git a/src/panfrost/lib/tests/test-earlyzs.cpp b/src/panfrost/lib/tests/test-earlyzs.cpp index 55b667b4696..2295a43aadd 100644 --- a/src/panfrost/lib/tests/test-earlyzs.cpp +++ b/src/panfrost/lib/tests/test-earlyzs.cpp @@ -21,7 +21,7 @@ * SOFTWARE. */ -#include "util/pan_ir.h" +#include "compiler/pan_ir.h" #include "pan_earlyzs.h" #include "genxml/gen_macros.h" diff --git a/src/panfrost/meson.build b/src/panfrost/meson.build index e669d3e10dc..ec92e7718a8 100644 --- a/src/panfrost/meson.build +++ b/src/panfrost/meson.build @@ -11,7 +11,6 @@ compile_args_panfrost = [ ] subdir('shared') -subdir('util') subdir('model') subdir('compiler') diff --git a/src/panfrost/util/meson.build b/src/panfrost/util/meson.build deleted file mode 100644 index 73167062c09..00000000000 --- a/src/panfrost/util/meson.build +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright © 2018 Rob Clark -# Copyright © 2019 Collabora -# SPDX-License-Identifier: MIT - -libpanfrost_util_files = files( - 'pan_collect_varyings.c', - 'pan_ir.c', - 'pan_ir.h', - 'pan_lower_frag_coord_zw.c', - 'pan_lower_framebuffer.c', - 'pan_lower_helper_invocation.c', - 'pan_lower_image_index.c', - 'pan_lower_image_ms.c', - 'pan_lower_noperspective.c', - 'pan_lower_sample_position.c', - 'pan_lower_store_component.c', - 'pan_lower_vertex_id.c', - 'pan_lower_writeout.c', - 'pan_lower_xfb.c', -) - -libpanfrost_util = static_library( - 'panfrost_util', - [libpanfrost_util_files], - include_directories : [inc_include, inc_src], - dependencies: [idep_nir, idep_mesautil], - c_args : [no_override_init_args], - gnu_symbol_visibility : 'hidden', - build_by_default : false, -) diff --git a/src/panfrost/vulkan/panvk_device.h b/src/panfrost/vulkan/panvk_device.h index b2d99e3b6c3..e796407fb96 100644 --- a/src/panfrost/vulkan/panvk_device.h +++ b/src/panfrost/vulkan/panvk_device.h @@ -20,7 +20,6 @@ #include "panvk_utrace_perfetto.h" #include "kmod/pan_kmod.h" -#include "util/pan_ir.h" #include "util/perf/u_trace.h" #include "util/simple_mtx.h" diff --git a/src/panfrost/vulkan/panvk_shader.h b/src/panfrost/vulkan/panvk_shader.h index a498446600f..f3bf6c83e0c 100644 --- a/src/panfrost/vulkan/panvk_shader.h +++ b/src/panfrost/vulkan/panvk_shader.h @@ -10,7 +10,7 @@ #error "PAN_ARCH must be defined" #endif -#include "util/pan_ir.h" +#include "compiler/pan_ir.h" #include "pan_desc.h" #include "pan_earlyzs.h" diff --git a/src/panfrost/vulkan/panvk_vX_physical_device.c b/src/panfrost/vulkan/panvk_vX_physical_device.c index 08f1d6e55d7..c9ddd6be137 100644 --- a/src/panfrost/vulkan/panvk_vX_physical_device.c +++ b/src/panfrost/vulkan/panvk_vX_physical_device.c @@ -27,7 +27,6 @@ #include "pan_format.h" #include "pan_props.h" -#include "util/pan_ir.h" /* We reserve one ubo for push constant, one for sysvals and one per-set for the * descriptor metadata */