diff --git a/src/broadcom/vulkan/meson.build b/src/broadcom/vulkan/meson.build index 3dadb49e69f..41a3c03071b 100644 --- a/src/broadcom/vulkan/meson.build +++ b/src/broadcom/vulkan/meson.build @@ -25,6 +25,7 @@ v3dv_entrypoints = custom_target( command : [ prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak', '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'v3dv', + '--device-prefix', 'ver42', ], depend_files : vk_entrypoints_gen_depend_files, ) @@ -69,7 +70,9 @@ files_per_version = files( # The vulkan driver only supports version >= 42, which is the version present in # Rpi4. We need to explicitly set it as we are reusing pieces from the GL v3d # driver. -v3dv_flags = ['-DV3D_VERSION=42'] +v3d_versions = ['42'] + +v3dv_flags = [] dep_v3dv3 = dependency('v3dv3', required : false) if dep_v3dv3.found() @@ -107,9 +110,24 @@ if system_has_kms_drm and not with_platform_android libv3dv_files += files('v3dv_wsi_display.c') endif +per_version_libs = [] +foreach ver : v3d_versions + per_version_libs += static_library( + 'v3dv-v' + ver, + [files_per_version, v3d_xml_pack, v3dv_entrypoints[0]], + include_directories : [ + inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_broadcom, + inc_compiler, inc_util, inc_vulkan_wsi, + ], + c_args : [v3dv_flags, '-DV3D_VERSION=' + ver], + gnu_symbol_visibility : 'hidden', + dependencies : [v3dv_deps], +) +endforeach + libvulkan_broadcom = shared_library( 'vulkan_broadcom', - [libv3dv_files, files_per_version, v3dv_entrypoints, sha1_h], + [libv3dv_files, v3dv_entrypoints, sha1_h], include_directories : [ inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_broadcom, inc_compiler, inc_util, inc_vulkan_wsi, ], @@ -117,6 +135,7 @@ libvulkan_broadcom = shared_library( libbroadcom_cle, libbroadcom_v3d, libvulkan_wsi, + per_version_libs, ], dependencies : v3dv_deps, c_args : v3dv_flags, diff --git a/src/broadcom/vulkan/v3dv_cl.c b/src/broadcom/vulkan/v3dv_cl.c index c36cb6a7e19..ed11f53c4bb 100644 --- a/src/broadcom/vulkan/v3dv_cl.c +++ b/src/broadcom/vulkan/v3dv_cl.c @@ -22,6 +22,13 @@ */ #include "v3dv_private.h" + +/* We don't expect that the packets we use in this file change across hw + * versions, so we just explicitly set the V3D_VERSION and include v3dx_pack + * here + */ +#define V3D_VERSION 33 +#include "broadcom/common/v3d_macros.h" #include "broadcom/cle/v3dx_pack.h" void diff --git a/src/broadcom/vulkan/v3dv_uniforms.c b/src/broadcom/vulkan/v3dv_uniforms.c index e51ece3e161..b4ee96a3092 100644 --- a/src/broadcom/vulkan/v3dv_uniforms.c +++ b/src/broadcom/vulkan/v3dv_uniforms.c @@ -28,6 +28,12 @@ #include "v3dv_private.h" #include "vk_format_info.h" +/* The only version specific structure that we need is + * TMU_CONFIG_PARAMETER_1. This didn't seem to change significantly from + * previous V3D versions and we don't expect that to change, so for now let's + * just hardcode the V3D version here. + */ +#define V3D_VERSION 41 #include "broadcom/common/v3d_macros.h" #include "broadcom/cle/v3dx_pack.h" diff --git a/src/gallium/drivers/v3d/v3d_cl.c b/src/gallium/drivers/v3d/v3d_cl.c index 8d3d56eed74..c03927e0453 100644 --- a/src/gallium/drivers/v3d/v3d_cl.c +++ b/src/gallium/drivers/v3d/v3d_cl.c @@ -24,7 +24,10 @@ #include "util/u_math.h" #include "util/ralloc.h" #include "v3d_context.h" -/* The branching packets are the same across V3D versions. */ +/* We don't expect that the packets we use in this file change across across + * hw versions, so we just explicitly set the V3D_VERSION and include + * v3dx_pack here + */ #define V3D_VERSION 33 #include "broadcom/common/v3d_macros.h" #include "broadcom/cle/v3dx_pack.h" diff --git a/src/gallium/drivers/v3d/v3d_uniforms.c b/src/gallium/drivers/v3d/v3d_uniforms.c index 5811d07ecdf..e6ec49f6cd3 100644 --- a/src/gallium/drivers/v3d/v3d_uniforms.c +++ b/src/gallium/drivers/v3d/v3d_uniforms.c @@ -27,6 +27,10 @@ #include "v3d_context.h" #include "compiler/v3d_compiler.h" + +/* We don't expect that the packets we use in this file change across across + * hw versions, so we just include directly the v33 header + */ #include "broadcom/cle/v3d_packet_v33_pack.h" static uint32_t