diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index fdfe983d06e..692e7e0075a 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -34,7 +34,7 @@ #include "gallium/auxiliary/util/u_blend.h" #include "panfrost-quirks.h" -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "pan_pool.h" #include "pan_bo.h" diff --git a/src/panfrost/lib/common.xml b/src/panfrost/lib/genxml/common.xml similarity index 100% rename from src/panfrost/lib/common.xml rename to src/panfrost/lib/genxml/common.xml diff --git a/src/panfrost/lib/decode.c b/src/panfrost/lib/genxml/decode.c similarity index 99% rename from src/panfrost/lib/decode.c rename to src/panfrost/lib/genxml/decode.c index f9e85efcb3b..db1aaf04e3b 100644 --- a/src/panfrost/lib/decode.c +++ b/src/panfrost/lib/genxml/decode.c @@ -23,7 +23,7 @@ * SOFTWARE. */ -#include +#include #include #include #include diff --git a/src/panfrost/lib/decode.h b/src/panfrost/lib/genxml/decode.h similarity index 99% rename from src/panfrost/lib/decode.h rename to src/panfrost/lib/genxml/decode.h index 9699141f4bf..5fde024e9d8 100644 --- a/src/panfrost/lib/decode.h +++ b/src/panfrost/lib/genxml/decode.h @@ -26,7 +26,7 @@ #ifndef __PAN_DECODE_H__ #define __PAN_DECODE_H__ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "wrap.h" diff --git a/src/panfrost/lib/decode_common.c b/src/panfrost/lib/genxml/decode_common.c similarity index 100% rename from src/panfrost/lib/decode_common.c rename to src/panfrost/lib/genxml/decode_common.c diff --git a/src/panfrost/lib/gen_macros.h b/src/panfrost/lib/genxml/gen_macros.h similarity index 94% rename from src/panfrost/lib/gen_macros.h rename to src/panfrost/lib/genxml/gen_macros.h index 1cd33b6e0ec..0e2488f74d4 100644 --- a/src/panfrost/lib/gen_macros.h +++ b/src/panfrost/lib/genxml/gen_macros.h @@ -74,22 +74,22 @@ pan_arch(unsigned gpu_id) /* Base macro defined on the command line. */ #ifndef PAN_ARCH -# include "common_pack.h" +# include "genxml/common_pack.h" #else /* Suffixing macros */ #if (PAN_ARCH == 4) # define GENX(X) X##_v4 -# include "v4_pack.h" +# include "genxml/v4_pack.h" #elif (PAN_ARCH == 5) # define GENX(X) X##_v5 -# include "v5_pack.h" +# include "genxml/v5_pack.h" #elif (PAN_ARCH == 6) # define GENX(X) X##_v6 -# include "v6_pack.h" +# include "genxml/v6_pack.h" #elif (PAN_ARCH == 7) # define GENX(X) X##_v7 -# include "v7_pack.h" +# include "genxml/v7_pack.h" #else # error "Need to add suffixing macro for this architecture" #endif diff --git a/src/panfrost/lib/gen_pack.py b/src/panfrost/lib/genxml/gen_pack.py similarity index 100% rename from src/panfrost/lib/gen_pack.py rename to src/panfrost/lib/genxml/gen_pack.py diff --git a/src/panfrost/lib/genxml/meson.build b/src/panfrost/lib/genxml/meson.build new file mode 100644 index 00000000000..e9431ec9999 --- /dev/null +++ b/src/panfrost/lib/genxml/meson.build @@ -0,0 +1,64 @@ +# Copyright © 2018 Rob Clark +# Copyright © 2019 Collabora + +# 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 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. + +pan_packers = [] +foreach packer : ['common', 'v4', 'v5', 'v6', 'v7'] + pan_packers += custom_target( + packer + '_pack.h', + input : ['gen_pack.py', packer + '.xml'], + output : packer + '_pack.h', + command : [prog_python, '@INPUT@'], + capture : true, + ) +endforeach + +idep_pan_packers = declare_dependency( + sources : [pan_packers], + include_directories : include_directories('.'), +) + +libpanfrost_decode_per_arch = [] + +foreach ver : ['4', '5', '6', '7'] + libpanfrost_decode_per_arch += static_library( + 'pandecode-arch-v' + ver, + ['decode.c', pan_packers], + include_directories : [inc_include, inc_src, inc_panfrost], + dependencies : [dep_libdrm, idep_pan_packers, idep_nir], + c_args : [no_override_init_args, '-DPAN_ARCH=' + ver], + gnu_symbol_visibility : 'hidden', + build_by_default : false, + ) +endforeach + +libpanfrost_decode = static_library( + 'panfrost_decode', + [ + 'decode_common.c', + pan_packers + ], + include_directories : [inc_include, inc_src, inc_panfrost], + dependencies : idep_mesautil, + c_args : [no_override_init_args], + gnu_symbol_visibility : 'hidden', + build_by_default : false, + link_with: [libpanfrost_decode_per_arch], +) diff --git a/src/panfrost/lib/v4.xml b/src/panfrost/lib/genxml/v4.xml similarity index 100% rename from src/panfrost/lib/v4.xml rename to src/panfrost/lib/genxml/v4.xml diff --git a/src/panfrost/lib/v5.xml b/src/panfrost/lib/genxml/v5.xml similarity index 100% rename from src/panfrost/lib/v5.xml rename to src/panfrost/lib/genxml/v5.xml diff --git a/src/panfrost/lib/v6.xml b/src/panfrost/lib/genxml/v6.xml similarity index 100% rename from src/panfrost/lib/v6.xml rename to src/panfrost/lib/genxml/v6.xml diff --git a/src/panfrost/lib/v7.xml b/src/panfrost/lib/genxml/v7.xml similarity index 100% rename from src/panfrost/lib/v7.xml rename to src/panfrost/lib/genxml/v7.xml diff --git a/src/panfrost/lib/meson.build b/src/panfrost/lib/meson.build index dfc72787a2a..d90b7e79fff 100644 --- a/src/panfrost/lib/meson.build +++ b/src/panfrost/lib/meson.build @@ -19,21 +19,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -pan_packers = [] -foreach packer : ['common', 'v4', 'v5', 'v6', 'v7'] - pan_packers += custom_target( - packer + '_pack.h', - input : ['gen_pack.py', packer + '.xml'], - output : packer + '_pack.h', - command : [prog_python, '@INPUT@'], - capture : true, - ) -endforeach - -idep_pan_packers = declare_dependency( - sources : [pan_packers], - include_directories : include_directories('.'), -) +subdir('genxml') pixel_format_versions = ['6', '7'] libpanfrost_pixel_format = [] @@ -52,7 +38,6 @@ foreach ver : pixel_format_versions endforeach libpanfrost_per_arch = [] -libpanfrost_decode_per_arch = [] foreach ver : ['4', '5', '6', '7'] libpanfrost_per_arch += static_library( @@ -71,16 +56,6 @@ foreach ver : ['4', '5', '6', '7'] gnu_symbol_visibility : 'hidden', dependencies : [dep_libdrm, idep_pan_packers, idep_nir], ) - - libpanfrost_decode_per_arch += static_library( - 'pandecode-arch-v' + ver, - ['decode.c', pan_packers], - include_directories : [inc_include, inc_src, inc_panfrost], - dependencies : [dep_libdrm, idep_pan_packers, idep_nir], - c_args : [no_override_init_args, '-DPAN_ARCH=' + ver], - gnu_symbol_visibility : 'hidden', - build_by_default : false, - ) endforeach libpanfrost_lib_files = files( @@ -110,20 +85,6 @@ libpanfrost_lib = static_library( link_with: [libpanfrost_pixel_format, libpanfrost_per_arch], ) -libpanfrost_decode = static_library( - 'panfrost_decode', - [ - 'decode_common.c', - pan_packers - ], - include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost], - dependencies : idep_mesautil, - c_args : [no_override_init_args], - gnu_symbol_visibility : 'hidden', - build_by_default : false, - link_with: [libpanfrost_decode_per_arch], -) - libpanfrost_dep = declare_dependency( link_with: [libpanfrost_lib, libpanfrost_decode, libpanfrost_midgard, libpanfrost_bifrost, libpanfrost_pixel_format, libpanfrost_per_arch], include_directories: [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw, inc_panfrost], diff --git a/src/panfrost/lib/pan_blend.h b/src/panfrost/lib/pan_blend.h index ac295c7ffa6..5b409bcf779 100644 --- a/src/panfrost/lib/pan_blend.h +++ b/src/panfrost/lib/pan_blend.h @@ -25,7 +25,7 @@ #ifndef __PAN_BLEND_H__ #define __PAN_BLEND_H__ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "util/u_dynarray.h" #include "util/format/u_format.h" diff --git a/src/panfrost/lib/pan_blitter.h b/src/panfrost/lib/pan_blitter.h index 61e982195a8..cb71161f5c5 100644 --- a/src/panfrost/lib/pan_blitter.h +++ b/src/panfrost/lib/pan_blitter.h @@ -25,7 +25,7 @@ #ifndef __PAN_BLITTER_H #define __PAN_BLITTER_H -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "panfrost-job.h" #include "pan_cs.h" diff --git a/src/panfrost/lib/pan_clear.c b/src/panfrost/lib/pan_clear.c index 4f364f17a6b..20cdf7ab45d 100644 --- a/src/panfrost/lib/pan_clear.c +++ b/src/panfrost/lib/pan_clear.c @@ -23,7 +23,7 @@ * */ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include #include "pan_util.h" diff --git a/src/panfrost/lib/pan_cs.h b/src/panfrost/lib/pan_cs.h index 43ead8628ad..27d030efdf2 100644 --- a/src/panfrost/lib/pan_cs.h +++ b/src/panfrost/lib/pan_cs.h @@ -28,7 +28,7 @@ #ifndef __PAN_CS_H #define __PAN_CS_H -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "pan_texture.h" diff --git a/src/panfrost/lib/pan_device.h b/src/panfrost/lib/pan_device.h index df6661151a9..eddd96a1788 100644 --- a/src/panfrost/lib/pan_device.h +++ b/src/panfrost/lib/pan_device.h @@ -41,7 +41,7 @@ #include "pan_pool.h" #include "pan_util.h" -#include +#include #if defined(__cplusplus) extern "C" { diff --git a/src/panfrost/lib/pan_encoder.h b/src/panfrost/lib/pan_encoder.h index fbf7c4d2c53..70621ba5b7f 100644 --- a/src/panfrost/lib/pan_encoder.h +++ b/src/panfrost/lib/pan_encoder.h @@ -33,7 +33,7 @@ #include #include "util/format/u_format.h" #include "pan_bo.h" -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "pan_device.h" /* Indices for named (non-XFB) varyings that are present. These are packed diff --git a/src/panfrost/lib/pan_format.c b/src/panfrost/lib/pan_format.c index fe0ec2ab411..7f0c3a7dcd4 100644 --- a/src/panfrost/lib/pan_format.c +++ b/src/panfrost/lib/pan_format.c @@ -24,7 +24,7 @@ * Alyssa Rosenzweig */ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "pan_format.h" #include "util/format/u_format.h" diff --git a/src/panfrost/lib/pan_format.h b/src/panfrost/lib/pan_format.h index 8aa9b1ab96c..b8a505706b1 100644 --- a/src/panfrost/lib/pan_format.h +++ b/src/panfrost/lib/pan_format.h @@ -28,7 +28,7 @@ #ifndef __PAN_FORMAT_H #define __PAN_FORMAT_H -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "util/format/u_format.h" diff --git a/src/panfrost/lib/pan_indirect_dispatch.h b/src/panfrost/lib/pan_indirect_dispatch.h index 2af2a7e13ba..30f5441feba 100644 --- a/src/panfrost/lib/pan_indirect_dispatch.h +++ b/src/panfrost/lib/pan_indirect_dispatch.h @@ -24,7 +24,7 @@ #ifndef __PAN_INDIRECT_DISPATCH_SHADERS_H__ #define __PAN_INDIRECT_DISPATCH_SHADERS_H__ -#include "gen_macros.h" +#include "genxml/gen_macros.h" struct pan_device; struct pan_scoreboard; diff --git a/src/panfrost/lib/pan_indirect_draw.h b/src/panfrost/lib/pan_indirect_draw.h index 421a4a42593..6a773744183 100644 --- a/src/panfrost/lib/pan_indirect_draw.h +++ b/src/panfrost/lib/pan_indirect_draw.h @@ -24,7 +24,7 @@ #ifndef __PAN_INDIRECT_DRAW_SHADERS_H__ #define __PAN_INDIRECT_DRAW_SHADERS_H__ -#include "gen_macros.h" +#include "genxml/gen_macros.h" struct pan_device; struct pan_scoreboard; diff --git a/src/panfrost/lib/pan_pool.h b/src/panfrost/lib/pan_pool.h index 0f2735c4dc5..01c8348c41d 100644 --- a/src/panfrost/lib/pan_pool.h +++ b/src/panfrost/lib/pan_pool.h @@ -26,7 +26,7 @@ #define __PAN_POOL_H__ #include -#include +#include #include "pan_bo.h" #include "util/u_dynarray.h" diff --git a/src/panfrost/lib/pan_scoreboard.h b/src/panfrost/lib/pan_scoreboard.h index ada142843b8..750ace0ea25 100644 --- a/src/panfrost/lib/pan_scoreboard.h +++ b/src/panfrost/lib/pan_scoreboard.h @@ -27,7 +27,7 @@ #ifndef __PAN_SCOREBOARD_H__ #define __PAN_SCOREBOARD_H__ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "pan_pool.h" struct pan_scoreboard { diff --git a/src/panfrost/lib/pan_shader.h b/src/panfrost/lib/pan_shader.h index 4447bc7c3b3..50867c46053 100644 --- a/src/panfrost/lib/pan_shader.h +++ b/src/panfrost/lib/pan_shader.h @@ -29,7 +29,7 @@ #include "panfrost/util/pan_ir.h" #include "pan_device.h" -#include "gen_macros.h" +#include "genxml/gen_macros.h" struct panfrost_device; diff --git a/src/panfrost/lib/pan_texture.h b/src/panfrost/lib/pan_texture.h index 992731791ff..24ecf2e493f 100644 --- a/src/panfrost/lib/pan_texture.h +++ b/src/panfrost/lib/pan_texture.h @@ -28,13 +28,13 @@ #ifndef __PAN_TEXTURE_H #define __PAN_TEXTURE_H -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include #include "drm-uapi/drm_fourcc.h" #include "util/format/u_format.h" #include "compiler/shader_enums.h" -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "pan_bo.h" #include "pan_device.h" #include "pan_util.h" diff --git a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c index 2e9bc35ed27..83d39e6f34a 100644 --- a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c +++ b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c @@ -26,7 +26,7 @@ * DEALINGS IN THE SOFTWARE. */ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "panvk_cs.h" #include "panvk_private.h" diff --git a/src/panfrost/vulkan/panvk_vX_cs.c b/src/panfrost/vulkan/panvk_vX_cs.c index 13b5f84f855..22e7d24bc0c 100644 --- a/src/panfrost/vulkan/panvk_vX_cs.c +++ b/src/panfrost/vulkan/panvk_vX_cs.c @@ -21,7 +21,7 @@ * DEALINGS IN THE SOFTWARE. */ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "util/macros.h" #include "compiler/shader_enums.h" diff --git a/src/panfrost/vulkan/panvk_vX_descriptor_set.c b/src/panfrost/vulkan/panvk_vX_descriptor_set.c index 38a18f1d0dd..b2bf664db0f 100644 --- a/src/panfrost/vulkan/panvk_vX_descriptor_set.c +++ b/src/panfrost/vulkan/panvk_vX_descriptor_set.c @@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. */ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "panvk_private.h" diff --git a/src/panfrost/vulkan/panvk_vX_device.c b/src/panfrost/vulkan/panvk_vX_device.c index d04da043029..ca604f6da6f 100644 --- a/src/panfrost/vulkan/panvk_vX_device.c +++ b/src/panfrost/vulkan/panvk_vX_device.c @@ -26,7 +26,7 @@ * DEALINGS IN THE SOFTWARE. */ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "decode.h" diff --git a/src/panfrost/vulkan/panvk_vX_image.c b/src/panfrost/vulkan/panvk_vX_image.c index 0dc08994568..af4980ea905 100644 --- a/src/panfrost/vulkan/panvk_vX_image.c +++ b/src/panfrost/vulkan/panvk_vX_image.c @@ -26,7 +26,7 @@ * DEALINGS IN THE SOFTWARE. */ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "panvk_private.h" #include "panfrost-quirks.h" diff --git a/src/panfrost/vulkan/panvk_vX_meta.c b/src/panfrost/vulkan/panvk_vX_meta.c index c71cd9aafca..2c1ac039451 100644 --- a/src/panfrost/vulkan/panvk_vX_meta.c +++ b/src/panfrost/vulkan/panvk_vX_meta.c @@ -21,7 +21,7 @@ * DEALINGS IN THE SOFTWARE. */ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "nir/nir_builder.h" #include "pan_encoder.h" diff --git a/src/panfrost/vulkan/panvk_vX_shader.c b/src/panfrost/vulkan/panvk_vX_shader.c index 0672ab0c926..fda961a3018 100644 --- a/src/panfrost/vulkan/panvk_vX_shader.c +++ b/src/panfrost/vulkan/panvk_vX_shader.c @@ -24,7 +24,7 @@ * DEALINGS IN THE SOFTWARE. */ -#include "gen_macros.h" +#include "genxml/gen_macros.h" #include "panvk_private.h"