2022-02-25 10:28:39 +00:00
|
|
|
# Copyright © 2022 Imagination Technologies Ltd.
|
2024-06-28 13:16:28 -07:00
|
|
|
# SPDX-License-Identifier: MIT
|
2022-02-25 10:28:39 +00:00
|
|
|
|
|
|
|
|
subdir('pds')
|
|
|
|
|
|
|
|
|
|
pvr_entrypoints = custom_target(
|
|
|
|
|
'pvr_entrypoints',
|
|
|
|
|
input : [vk_entrypoints_gen, vk_api_xml],
|
|
|
|
|
output : ['pvr_entrypoints.h', 'pvr_entrypoints.c'],
|
|
|
|
|
command : [
|
|
|
|
|
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
|
|
|
|
|
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'pvr',
|
2025-12-10 16:28:29 +01:00
|
|
|
'--device-prefix', 'pvr_rogue',
|
2023-03-14 15:39:14 +10:00
|
|
|
'--beta', with_vulkan_beta.to_string()
|
2022-02-25 10:28:39 +00:00
|
|
|
],
|
|
|
|
|
depend_files : vk_entrypoints_gen_depend_files,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pvr_files = files(
|
|
|
|
|
'winsys/powervr/pvr_drm.c',
|
2022-03-21 11:31:38 +00:00
|
|
|
'winsys/powervr/pvr_drm_bo.c',
|
|
|
|
|
'winsys/powervr/pvr_drm_job_compute.c',
|
|
|
|
|
'winsys/powervr/pvr_drm_job_null.c',
|
|
|
|
|
'winsys/powervr/pvr_drm_job_render.c',
|
|
|
|
|
'winsys/powervr/pvr_drm_job_transfer.c',
|
2022-02-25 10:28:39 +00:00
|
|
|
'winsys/pvr_winsys.c',
|
|
|
|
|
'winsys/pvr_winsys_helper.c',
|
|
|
|
|
'pvr_bo.c',
|
|
|
|
|
'pvr_csb.c',
|
|
|
|
|
'pvr_descriptor_set.c',
|
|
|
|
|
'pvr_device.c',
|
2022-06-29 09:47:33 +01:00
|
|
|
'pvr_dump_bo.c',
|
2025-11-27 16:03:22 +01:00
|
|
|
'pvr_free_list.c',
|
2022-02-25 10:28:39 +00:00
|
|
|
'pvr_formats.c',
|
|
|
|
|
'pvr_image.c',
|
2025-11-03 16:09:07 +01:00
|
|
|
'pvr_instance.c',
|
2025-12-31 19:41:18 +00:00
|
|
|
'pvr_nir_lower_ycbcr.c',
|
2025-11-03 16:09:07 +01:00
|
|
|
'pvr_physical_device.c',
|
2022-05-17 17:19:31 +01:00
|
|
|
'pvr_transfer_frag_store.c',
|
2022-02-25 10:28:39 +00:00
|
|
|
'pvr_query.c',
|
2023-02-23 05:16:48 +00:00
|
|
|
'pvr_robustness.c',
|
2025-12-11 14:35:46 +01:00
|
|
|
'pvr_rt_dataset.c',
|
2022-11-22 16:28:29 +00:00
|
|
|
'pvr_spm.c',
|
2024-12-24 12:56:52 +00:00
|
|
|
'pvr_usc.c',
|
2022-02-25 10:28:39 +00:00
|
|
|
'pvr_wsi.c',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pvr_includes = [
|
|
|
|
|
include_directories('winsys'),
|
|
|
|
|
libpowervr_pds_includes,
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
pvr_deps = [
|
|
|
|
|
dep_csbgen,
|
|
|
|
|
dep_libdrm,
|
|
|
|
|
dep_valgrind,
|
2023-06-08 10:32:15 +01:00
|
|
|
idep_mesautil,
|
2025-11-04 11:59:48 +01:00
|
|
|
idep_pco_uscgen_programs,
|
2022-02-25 10:28:39 +00:00
|
|
|
idep_vulkan_runtime,
|
|
|
|
|
idep_vulkan_util,
|
|
|
|
|
idep_vulkan_wsi,
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
pvr_flags = [
|
2023-09-20 16:00:19 +01:00
|
|
|
imagination_c_args,
|
2022-02-25 10:28:39 +00:00
|
|
|
no_override_init_args,
|
|
|
|
|
]
|
|
|
|
|
|
2025-11-24 15:48:59 +01:00
|
|
|
common_per_arch_files = [
|
2025-10-29 16:34:05 +01:00
|
|
|
pvr_entrypoints[0],
|
|
|
|
|
sha1_h,
|
|
|
|
|
]
|
|
|
|
|
|
2025-11-11 13:31:29 +01:00
|
|
|
common_per_arch_files += files(
|
|
|
|
|
'pvr_arch_border.c',
|
|
|
|
|
'pvr_arch_cmd_buffer.c',
|
|
|
|
|
'pvr_arch_cmd_query.c',
|
|
|
|
|
'pvr_arch_csb.c',
|
|
|
|
|
'pvr_arch_descriptor_set.c',
|
|
|
|
|
'pvr_arch_device.c',
|
|
|
|
|
'pvr_arch_formats.c',
|
|
|
|
|
'pvr_arch_framebuffer.c',
|
|
|
|
|
'pvr_arch_hw_pass.c',
|
|
|
|
|
'pvr_arch_pass.c',
|
|
|
|
|
'pvr_arch_pipeline.c',
|
|
|
|
|
'pvr_arch_image.c',
|
|
|
|
|
'pvr_arch_job_common.c',
|
|
|
|
|
'pvr_arch_job_compute.c',
|
|
|
|
|
'pvr_arch_job_context.c',
|
|
|
|
|
'pvr_arch_job_render.c',
|
|
|
|
|
'pvr_arch_job_transfer.c',
|
|
|
|
|
'pvr_arch_mrt.c',
|
|
|
|
|
'pvr_arch_queue.c',
|
|
|
|
|
'pvr_arch_query_compute.c',
|
|
|
|
|
'pvr_arch_sampler.c',
|
|
|
|
|
'pvr_arch_spm.c',
|
|
|
|
|
'pvr_arch_tex_state.c',
|
|
|
|
|
)
|
|
|
|
|
|
2025-11-25 16:29:38 +01:00
|
|
|
if with_imagination_srv
|
|
|
|
|
pvr_files += files(
|
|
|
|
|
'winsys/pvrsrvkm/pvr_srv.c',
|
|
|
|
|
'winsys/pvrsrvkm/pvr_srv_bo.c',
|
|
|
|
|
'winsys/pvrsrvkm/pvr_srv_bridge.c',
|
|
|
|
|
'winsys/pvrsrvkm/pvr_srv_job_common.c',
|
|
|
|
|
'winsys/pvrsrvkm/pvr_srv_job_compute.c',
|
|
|
|
|
'winsys/pvrsrvkm/pvr_srv_job_null.c',
|
|
|
|
|
'winsys/pvrsrvkm/pvr_srv_job_render.c',
|
|
|
|
|
'winsys/pvrsrvkm/pvr_srv_job_transfer.c',
|
|
|
|
|
'winsys/pvrsrvkm/pvr_srv_sync.c',
|
|
|
|
|
'winsys/pvrsrvkm/pvr_srv_sync_prim.c',
|
|
|
|
|
)
|
|
|
|
|
common_per_arch_files += files(
|
|
|
|
|
'winsys/pvrsrvkm/pvr_arch_srv_job_compute.c',
|
|
|
|
|
'winsys/pvrsrvkm/pvr_arch_srv_job_render.c',
|
|
|
|
|
'winsys/pvrsrvkm/pvr_arch_srv_job_transfer.c',
|
|
|
|
|
)
|
|
|
|
|
pvr_flags += '-DPVR_SUPPORT_SERVICES_DRIVER'
|
|
|
|
|
endif
|
|
|
|
|
|
2025-11-24 15:48:59 +01:00
|
|
|
rogue_files = files(
|
2025-11-25 15:58:37 +01:00
|
|
|
'rogue/pvr_blit.c',
|
|
|
|
|
'rogue/pvr_clear.c',
|
2025-11-24 15:48:59 +01:00
|
|
|
'rogue/pvr_dump_csb.c',
|
|
|
|
|
)
|
|
|
|
|
|
2025-10-29 16:34:05 +01:00
|
|
|
powervr_per_arch_libs = []
|
|
|
|
|
|
|
|
|
|
foreach arch : ['rogue']
|
2025-11-24 15:48:59 +01:00
|
|
|
per_arch_files = common_per_arch_files
|
|
|
|
|
|
|
|
|
|
if arch == 'rogue'
|
|
|
|
|
per_arch_files += rogue_files
|
|
|
|
|
endif
|
|
|
|
|
|
2025-10-29 16:34:05 +01:00
|
|
|
powervr_per_arch_libs += static_library(
|
|
|
|
|
'powervr_@0@'.format(arch),
|
|
|
|
|
per_arch_files,
|
|
|
|
|
include_directories : [
|
|
|
|
|
pvr_includes,
|
|
|
|
|
inc_imagination,
|
|
|
|
|
inc_include,
|
|
|
|
|
inc_src,
|
|
|
|
|
],
|
|
|
|
|
dependencies : [
|
2025-11-24 15:48:59 +01:00
|
|
|
dep_valgrind,
|
2025-10-29 16:34:05 +01:00
|
|
|
idep_nir_headers,
|
2025-11-25 15:58:37 +01:00
|
|
|
idep_pco_uscgen_programs_headers,
|
2025-11-24 15:48:59 +01:00
|
|
|
idep_vulkan_runtime_headers,
|
2025-10-29 16:34:05 +01:00
|
|
|
idep_vulkan_util_headers,
|
2025-11-24 15:48:59 +01:00
|
|
|
idep_vulkan_wsi_headers,
|
2025-10-29 16:34:05 +01:00
|
|
|
],
|
2025-11-24 15:48:59 +01:00
|
|
|
c_args : [pvr_flags, '-DPVR_BUILD_ARCH_@0@'.format(arch.to_upper())],
|
2025-10-29 16:34:05 +01:00
|
|
|
gnu_symbol_visibility : 'hidden',
|
|
|
|
|
)
|
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 10:28:39 +00:00
|
|
|
libvulkan_powervr_mesa = shared_library(
|
|
|
|
|
'vulkan_powervr_mesa',
|
2025-10-29 16:34:05 +01:00
|
|
|
[pvr_files, pvr_entrypoints, u_format_pack_h],
|
2022-02-25 10:28:39 +00:00
|
|
|
include_directories : [
|
|
|
|
|
pvr_includes,
|
|
|
|
|
inc_imagination,
|
|
|
|
|
inc_include,
|
|
|
|
|
inc_src,
|
|
|
|
|
],
|
2025-10-29 16:34:05 +01:00
|
|
|
link_whole : [powervr_per_arch_libs],
|
2022-02-25 10:28:39 +00:00
|
|
|
link_with : [
|
|
|
|
|
libpowervr_common,
|
2024-04-05 16:12:59 +01:00
|
|
|
libpowervr_compiler,
|
2022-02-25 10:28:39 +00:00
|
|
|
libpowervr_pds,
|
2024-12-24 12:56:52 +00:00
|
|
|
libpowervr_uscgen,
|
2022-02-25 10:28:39 +00:00
|
|
|
libvulkan_wsi,
|
|
|
|
|
],
|
|
|
|
|
dependencies : [
|
|
|
|
|
pvr_deps,
|
2024-04-08 14:06:05 +01:00
|
|
|
idep_nir_headers,
|
2022-02-25 10:28:39 +00:00
|
|
|
],
|
|
|
|
|
c_args : pvr_flags,
|
|
|
|
|
link_args : [
|
2025-09-15 18:33:09 +02:00
|
|
|
vulkan_icd_link_args,
|
2022-02-25 10:28:39 +00:00
|
|
|
ld_args_build_id,
|
|
|
|
|
ld_args_bsymbolic,
|
|
|
|
|
ld_args_gc_sections
|
|
|
|
|
],
|
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
|
|
|
|
install : true,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if with_symbols_check
|
|
|
|
|
test(
|
|
|
|
|
'pvr symbols check',
|
|
|
|
|
symbols_check,
|
|
|
|
|
args : [
|
|
|
|
|
'--lib', libvulkan_powervr_mesa,
|
|
|
|
|
'--symbols-file', vulkan_icd_symbols,
|
|
|
|
|
symbols_check_args,
|
|
|
|
|
],
|
|
|
|
|
suite : ['imagination'],
|
|
|
|
|
)
|
|
|
|
|
endif
|
|
|
|
|
|
vulkan: Consistently form driver library names as prefix + name + suffix
This consistently uses `NAME.dll` on Windows, `libNAME.dylib` on Darwin
derivatives such as macOS, and `libNAME.so` on Linux, *BSD and so on.
It's also consistent about using the local variable name `icd_file_name`
for this name in every Vulkan driver, which was already the case in many
but not all drivers.
Some of these drivers probably don't make sense (or don't work) on
Windows and/or macOS, but if this is kept consistent for all drivers,
it should avoid the need for driver-specific commits like
commit 611e9f29e "lavapipe: fix icd generation for windows",
commit 951f3287 "lavapipe: set empty dll prefix",
commit 13e7a39f "lavapipe: fixes for macOS support",
commit 7008e655 "radv: Update JSON generator if Windows" and so on,
each time a driver is found to be relevant on more platforms than
previously believed.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37576>
2025-09-25 13:40:14 +01:00
|
|
|
icd_file_name = libname_prefix + 'vulkan_powervr_mesa.' + libname_suffix
|
|
|
|
|
|
2022-02-25 10:28:39 +00:00
|
|
|
powervr_mesa_icd = custom_target(
|
|
|
|
|
'powervr_mesa_icd',
|
|
|
|
|
input : [vk_icd_gen, vk_api_xml],
|
vulkan: Optionally share one JSON manifest per driver between architectures
If the library_path is just a basename like `libvulkan_lvp.so`, then we
can share the same JSON manifest like `lvp_icd.json` between all of the
architectures, like we already do for Vulkan layers. The library will
be looked up in the dynamic linker's default search path in this case,
and in practice will be found in `${libdir}`. This is how the Mesa's
EGL driver and Vulkan layers work, how Mesa is packaged in Debian 13,
and also how the Nvidia proprietary driver works; it makes installation
simpler for distros, especially on multiarch systems like Debian and
the freedesktop.org SDK.
However, if we want a separate manifest per architecture in order to
be able to write the full path into it, we still need per-architecture
filename disambiguation like `lvp_icd.x86_64.json`.
We presumably still want a separate per architecture on Windows, because
the concept of a single monolithic `${libdir}` is less common there, and
it can also be helpful during development when setting `$VK_DRIVER_FILES`
to force the use of a specific driver installed in a non-default location.
Use the following parameter to passed to vk_icd_gen:
'--icd-lib-path', vulkan_icd_lib_path,
'--icd-filename', icd_file_name,
output : 'virtio_icd.' + vulkan_manifest_suffix,
and the output is passed by '--out', '@OUTPUT@',
so we can detect vulkan_manifest_per_architecture from the --out parameter in script.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13745
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37314>
2025-09-25 21:01:25 +08:00
|
|
|
output : 'powervr_mesa_icd.' + vulkan_manifest_suffix,
|
2022-02-25 10:28:39 +00:00
|
|
|
command : [
|
|
|
|
|
prog_python, '@INPUT0@',
|
2025-09-24 23:38:40 +02:00
|
|
|
'--api-version', '1.4', '--xml', '@INPUT1@',
|
2025-06-16 20:04:11 -04:00
|
|
|
'--sizeof-pointer', sizeof_pointer,
|
vulkan: Optionally share one JSON manifest per driver between architectures
If the library_path is just a basename like `libvulkan_lvp.so`, then we
can share the same JSON manifest like `lvp_icd.json` between all of the
architectures, like we already do for Vulkan layers. The library will
be looked up in the dynamic linker's default search path in this case,
and in practice will be found in `${libdir}`. This is how the Mesa's
EGL driver and Vulkan layers work, how Mesa is packaged in Debian 13,
and also how the Nvidia proprietary driver works; it makes installation
simpler for distros, especially on multiarch systems like Debian and
the freedesktop.org SDK.
However, if we want a separate manifest per architecture in order to
be able to write the full path into it, we still need per-architecture
filename disambiguation like `lvp_icd.x86_64.json`.
We presumably still want a separate per architecture on Windows, because
the concept of a single monolithic `${libdir}` is less common there, and
it can also be helpful during development when setting `$VK_DRIVER_FILES`
to force the use of a specific driver installed in a non-default location.
Use the following parameter to passed to vk_icd_gen:
'--icd-lib-path', vulkan_icd_lib_path,
'--icd-filename', icd_file_name,
output : 'virtio_icd.' + vulkan_manifest_suffix,
and the output is passed by '--out', '@OUTPUT@',
so we can detect vulkan_manifest_per_architecture from the --out parameter in script.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13745
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37314>
2025-09-25 21:01:25 +08:00
|
|
|
'--icd-lib-path', vulkan_icd_lib_path,
|
|
|
|
|
'--icd-filename', icd_file_name,
|
2022-02-25 10:28:39 +00:00
|
|
|
'--out', '@OUTPUT@',
|
|
|
|
|
],
|
|
|
|
|
build_by_default : true,
|
|
|
|
|
install_dir : with_vulkan_icd_dir,
|
2023-08-27 16:35:17 +02:00
|
|
|
install_tag : 'runtime',
|
2022-02-25 10:28:39 +00:00
|
|
|
install : true,
|
|
|
|
|
)
|
|
|
|
|
|
2023-01-25 16:55:32 +01:00
|
|
|
_dev_icd = custom_target(
|
2023-01-17 09:46:41 -08:00
|
|
|
'powervr_mesa_devenv_icd',
|
|
|
|
|
input : [vk_icd_gen, vk_api_xml],
|
2023-04-27 16:21:07 +01:00
|
|
|
output : 'powervr_mesa_devenv_icd.@0@.json'.format(host_machine.cpu()),
|
2023-01-17 09:46:41 -08:00
|
|
|
command : [
|
|
|
|
|
prog_python, '@INPUT0@',
|
2025-09-24 23:38:40 +02:00
|
|
|
'--api-version', '1.4', '--xml', '@INPUT1@',
|
2025-06-16 20:04:11 -04:00
|
|
|
'--sizeof-pointer', sizeof_pointer,
|
vulkan: Optionally share one JSON manifest per driver between architectures
If the library_path is just a basename like `libvulkan_lvp.so`, then we
can share the same JSON manifest like `lvp_icd.json` between all of the
architectures, like we already do for Vulkan layers. The library will
be looked up in the dynamic linker's default search path in this case,
and in practice will be found in `${libdir}`. This is how the Mesa's
EGL driver and Vulkan layers work, how Mesa is packaged in Debian 13,
and also how the Nvidia proprietary driver works; it makes installation
simpler for distros, especially on multiarch systems like Debian and
the freedesktop.org SDK.
However, if we want a separate manifest per architecture in order to
be able to write the full path into it, we still need per-architecture
filename disambiguation like `lvp_icd.x86_64.json`.
We presumably still want a separate per architecture on Windows, because
the concept of a single monolithic `${libdir}` is less common there, and
it can also be helpful during development when setting `$VK_DRIVER_FILES`
to force the use of a specific driver installed in a non-default location.
Use the following parameter to passed to vk_icd_gen:
'--icd-lib-path', vulkan_icd_lib_path,
'--icd-filename', icd_file_name,
output : 'virtio_icd.' + vulkan_manifest_suffix,
and the output is passed by '--out', '@OUTPUT@',
so we can detect vulkan_manifest_per_architecture from the --out parameter in script.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13745
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37314>
2025-09-25 21:01:25 +08:00
|
|
|
'--icd-lib-path', meson.current_build_dir(),
|
|
|
|
|
'--icd-filename', icd_file_name,
|
2023-01-17 09:46:41 -08:00
|
|
|
'--out', '@OUTPUT@',
|
|
|
|
|
],
|
|
|
|
|
build_by_default : true,
|
|
|
|
|
)
|
2022-02-25 10:28:39 +00:00
|
|
|
|
2024-04-01 13:30:18 +01:00
|
|
|
devenv.append('VK_DRIVER_FILES', _dev_icd.full_path())
|