Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit c5e8000

Browse files
committed
Update pal from commit 1ca00243
GFX9 HWL cleanups Fix bug in 'Move DB_Z_INFO validation' ValidateDraw CPU performance optimization TraceSource support for enabling ExecPop SQTT tokens Clean up DevMode overlay logic, add driver setting, remove DriverUtils RPC function Ensure lz4Compressor thread local list is empty Initialize imageVaLocked to avoid assertion Mark some uncommon paths in UserData validation unlikely Ensure DevMode overlay can not be enabled when dev mode is not enabled Disable logicOp per target Deprecate some dead code in ComputeCmdBuffer Rework Graphics Userdata RS64 path Mark Task Shader Path Unlikely Report RS64 for Navi3x Null Devices Add support for switch away from registry Implement RegPairs for GFX11 APU PFP path Fix handling of PipelineStageBlt for CmdWriteTimestamp/CmdWriteImmediate/WriteEventCmd Fix a bug in SetShRegInvalid when usage is unmapped Update submodule address-lib Fix Reading from CmdBuffer in WriteLoadSeqContextRegs Reduce Reset Cost of HashBase Fix assert from cb fast clear Implement RegPairs for GFX11 RS64 PFP/MEC paths Mark some CmdBindPipeline paths unlikely Only enable PRIV flag when CWSR Trap Handler enabled Add support for mesh shader to GetShaderStats in gfx9 Fix Span, Span single-element ref ctors Add PAL_PATH_SEP as a platform-agnostic placeholder for the path separator Add dim enum static_assert for gfx10 and gfx12 DmaCmdBuffer Check PFP uCode Version for F32 RegPairs [cmake] Make PAL_COMPILE_TYPE public Remove usage of deprecated PAL_SHORT_WCHAR and -fshort-wchar Add QueryPool cmdBufferLogger comment strings Add MultiElfCacheLayer Evict() Expand APU support for UMC counters Deprecate PAL-defined wcslen and wcsrchr Improve CPU overhead of GFX Pipeline Dyn Regs Add setting EnablePerfCounterWindow with default FALSE Optimize BuildSetSeqShRegsIndex Code Gen Ignore QUERY_PEAK_CLOCKS result Remove unneeded function params Refine GFX11 F32 unpacked support check Replace amd_kernel_code_s with kernel_descriptor_t to match the behavior in compiler Disable RegPairs on RS64 MEC Add 'operator==' for 'struct ShaderHash' Remove COL0_EXPORT_FORMAT overwriting for optDepthOnlyExportRate C++ iterator for palList Fix debug assertion when AutoBuffer's capacity is 0 List::difference_type Use std::chrono in File::Stat CMake Build Parameter Refactor Retrieve Stat for all files in a directory Fix clang build warnings Retire old GFX11 setting Add interface to query memory usage Modify Util::StringLength() to work in a constexpr context Optimize memset in ValidateViewports for GFX11 [CMake] Ignore FOR_ANY cases for cached internal build parameters Add support for hashing wide strings Remove ChipProps and Device from CmdUtil Optimize SH pkt build method Minor PM4Opt optimization Support HAWK_POINT 1 and 2 Rework PM4Opt SetSeqContext Implementation Rework PM4Opt SetSeqSh Implementation Add ArchiveLibrary for graphics partial pipeline support Update coding standards for disabling warning and strong enums Update Util::PathSep Move Static GE_USER_VGPR_EN to Queue Preamble Fix scope of their compile definitions Optimize timestamp wait to save WRITE_DATA packet before RELEASE_MEM/WRM pair Allow format replacement for decompressed MM images Mark Streamout draw-time path unlikely Rework CS Userdata Path Refactor CmdBufInfo decorator unwrapping Reorder storage of ViewportParams Add Coarse Filter for uncommon Context regs for GFX11 Implement P216 format Fix interface version check in CmdBufferLogger Pipeline link scheme for graphics partial pipeline for gfx9 Add DynReg Filter for GFX11 Fix P412 format Restrict clone conditions for depth-stencil Send PERFCOUNTER_START event while frame profiling Update uCode for NullDevice Add HashSet::FindAllocate() Update GFX11 F32 RegPairs helper Add compatibility checks for P216 format Change GenericAllocator to static Fix bug in DynReg Hash Logic Add CmdWaitBusAddressableMemoryMarker to gfx12UniversalCmdBuffer Optimize UntypedBufferViewSrd Make shader cache compatible between 32-bit and 64-bit Add CmdUpdateBusAddressableMemoryMarker to gfx12UniversalCmdBuffer Add PGP BeginTimestampPoint Setting Implement tri-planar YUV formats Enable generic entry point symbols Change interface version for new InterfaceLogger string table entries Support ps_done and cs_done in CmdWriteImmediate Implement 5 missing planar YUV formats Update DevDriver to v25.04.15 Optimize BuildDrawIndexIndirect enable DCC for swap chain image to fix Vkmark low performance in fullscreen on Navi48 Adjust the mailbox implementation for better performance according to the latest Linux distro change Add CompileTimeHashString() Update submodule SwWarDetection Add AYUV format support in PAL RGP instrumentation for pipeline binds on ganged subqueues
1 parent 04bc1e7 commit c5e8000

File tree

522 files changed

+206358
-190869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

522 files changed

+206358
-190869
lines changed

CMakeLists.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ project(PAL LANGUAGES CXX)
3131

3232
message(STATUS "PAL_SOURCE_DIR = ${PAL_SOURCE_DIR}")
3333

34-
include(PalBuildParameters)
35-
include(PalCodegen)
36-
include(PalOptions)
37-
include(PalOverrides)
38-
include(PalPrecompiledHeaders)
39-
4034
# Create PAL targets:
4135
# - pal : The overall PAL target that a client links to
4236
# - palUtil : Just the PAL util library
@@ -50,6 +44,16 @@ add_library(palCompilerDeps STATIC)
5044
target_link_libraries(palCompilerDeps PRIVATE palUtil)
5145
target_link_libraries(pal PRIVATE palCompilerDeps)
5246

47+
# PAL's build parameters must be defined *after* the pal target is defined.
48+
# To aid in the sharing of PAL build parameters, set_target_property() is used on the pal
49+
# target to provide a method for clients to retrieve the final, proper value of the build parameter.
50+
# set_target_property() will not work if the target is not yet defined.
51+
include(PalBuildParameters)
52+
include(PalOnlyBuildParameters)
53+
include(PalCodegen)
54+
include(PalOverrides)
55+
include(PalPrecompiledHeaders)
56+
5357
add_subdirectory(cmake)
5458
add_subdirectory(inc)
5559
add_subdirectory(res)

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
```
2+
Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
21+
```
122

223
# Platform Abstraction Library (PAL)
324
The Platform Abstraction Library (PAL) provides hardware and OS abstractions for Radeon™ (GCN+) user-mode 3D graphics drivers. The level of abstraction is chosen to support performant driver implementations of several APIs while hiding the client from hardware and operating system details.

cmake/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ target_sources(pal PRIVATE
3232
PalCompileDefinitions.cmake
3333
PalCompilerOptions.cmake
3434
PalCompilerWarnings.cmake
35-
PalOptions.cmake
35+
PalOnlyBuildParameters.cmake
3636
PalOverrides.cmake
3737
PalPrecompiledHeaders.cmake
3838
PalVersionHelper.cmake

cmake/PalBuildParameters.cmake

Lines changed: 187 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -28,111 +28,231 @@ include_guard()
2828
# This file is meant to encapsulate all the variables that PAL's clients are intended to
2929
# manipulate when customizing PAL for their purposes. Making it the first place cmake developers
3030
# for DXCP, XGL, etc. will look to when they have build problems/ideas/confusion.
31+
#
32+
# If a client wishes to override a PAL variable, the recommended logic is:
33+
# if (NOT DEFINED PAL_*)
34+
# set(PAL_* <value>)
35+
# endif()
36+
#
37+
# If a client has their own build parameter that controls the PAL one, then the
38+
# `if (NOT DEFINED PAL_*)` and `endif()` can be omitted.
39+
#
40+
# NOTE: It is not advised to write the PAL build parameter into the cache.
41+
#
42+
# If a client wishes to see the final value of a pal_client_bp in the client's CMake project, the client can use:
43+
# get_target_property(<output-var> pal <build-parameter-name>)
44+
# to get the value that PAL uses. PAL's version of a build parameter may differ from a client's due to
45+
# the dependency tree of that build parameter.
46+
47+
########################################################################################################################
48+
# Start with any client-facing build parameters which the clients are REQUIRED to set.
3149

3250
# It's very convenient to have the PAL_CLIENT_INTERFACE_MAJOR_VERSION be defined before anything else
3351
# And it needs to be defined hence the FATAL_ERROR.
34-
pal_bp(PAL_CLIENT_INTERFACE_MAJOR_VERSION "-1" MODE "FATAL_ERROR")
52+
pal_client_bp(PAL_CLIENT_INTERFACE_MAJOR_VERSION ""
53+
MODE "FATAL_ERROR"
54+
REQUIRED
55+
)
3556

3657
if (DEFINED PAL_CLIENT_INTERFACE_MINOR_VERSION)
3758
message(AUTHOR_WARNING "Unneccessary to specify PAL_CLIENT_INTERFACE_MINOR_VERSION")
3859
endif()
3960

61+
# Clients must define this variable so pal know what API it's facilitating
62+
pal_client_bp(PAL_CLIENT ""
63+
MODE "FATAL_ERROR"
64+
REQUIRED
65+
)
66+
67+
#####################################################################################
68+
# Handle special case where we need PAL_CLIENT_* for dependencies in this file.
69+
70+
# Create a more convenient variable to avoid string comparisons.
71+
set(PAL_CLIENT_${PAL_CLIENT} ON)
72+
73+
#####################################################################################
74+
75+
########################################################################################################################
76+
77+
########################################################################################################################
78+
# Now provide any client-facing build parameters which the clients can ignore if desired.
79+
80+
pal_client_bp(PAL_BUILD_FORCE_ON OFF
81+
DESC
82+
"Forces all unset PAL_BUILD_* CMake variables to be ON, so long as the dependencies are met."
83+
)
84+
85+
set(PAL_BUILD_BRANCH "2420")
86+
4087
# See README.md for explanation of CORE/GPUUTIL functionality.
4188
# NOTE: There is no PAL_BUILD_UTIL, that functionality isn't optional.
42-
pal_bp(PAL_BUILD_CORE ON)
43-
pal_bp(PAL_BUILD_GPUUTIL ON)
89+
pal_client_bp(PAL_BUILD_CORE ON)
90+
pal_client_bp(PAL_BUILD_GPUUTIL ON)
4491

4592
#if PAL_DEVELOPER_BUILD
46-
pal_bp(PAL_DEVELOPER_BUILD OFF)
93+
pal_client_bp(PAL_DEVELOPER_BUILD OFF)
4794
#endif
4895

49-
if (PAL_CLIENT_INTERFACE_MAJOR_VERSION LESS 888)
50-
# Build PAL with Operating System support
51-
pal_bp(PAL_BUILD_OSS ON)
96+
pal_deprecated_bp(PAL_BUILD_OSS ON "${PAL_CLIENT_INTERFACE_MAJOR_VERSION} LESS 888")
5297
#if PAL_BUILD_OSS2_4
53-
pal_bp(PAL_BUILD_OSS2_4 ON DEPENDS_ON PAL_BUILD_OSS)
98+
pal_deprecated_bp(PAL_BUILD_OSS2_4 ON "${PAL_CLIENT_INTERFACE_MAJOR_VERSION} LESS 888"
99+
DEPENDS_ON PAL_BUILD_OSS
100+
)
54101
#endif
55-
endif()
56-
57-
# Clients must define this variable so pal know what API it's facilitating
58-
pal_bp(PAL_CLIENT "-1" MODE "FATAL_ERROR")
59102

60-
# Create a more convenient variable to avoid string comparisons.
61-
set(PAL_CLIENT_${PAL_CLIENT} ON)
103+
#####################################################################################
104+
# Handle special case where we need PAL_AMDGPU_BUILD for dependencies in this file.
105+
# PAL_AMDGPU_BUILD is an internal build parameter, and as such is an exception in
106+
# this file.
62107

63-
# This variable controls whether PAL is built with an amdgpu back-end
64-
if (UNIX)
65-
set(PAL_AMDGPU_BUILD ON)
66-
else()
67-
set(PAL_AMDGPU_BUILD OFF)
68-
endif()
108+
pal_internal_bp(PAL_AMDGPU_BUILD ON
109+
DEPENDS_ON
110+
UNIX
111+
DESC
112+
"Whether PAL is built with an amdgpu back-end?"
113+
)
69114

70-
pal_bp(PAL_BUILD_DRI3 ON DEPENDS_ON PAL_AMDGPU_BUILD)
71-
pal_bp(PAL_BUILD_WAYLAND OFF DEPENDS_ON PAL_AMDGPU_BUILD)
115+
#####################################################################################
72116

73-
pal_bp(PAL_DISPLAY_DCC ON DEPENDS_ON PAL_AMDGPU_BUILD)
117+
pal_client_bp(PAL_BUILD_DRI3 ON DEPENDS_ON PAL_AMDGPU_BUILD)
118+
pal_client_bp(PAL_BUILD_WAYLAND OFF DEPENDS_ON PAL_AMDGPU_BUILD)
119+
pal_client_bp(PAL_DISPLAY_DCC ON DEPENDS_ON PAL_AMDGPU_BUILD)
74120

75121
# Build null device backend for offline compilation
76-
pal_bp(PAL_BUILD_NULL_DEVICE ON)
122+
pal_client_bp(PAL_BUILD_NULL_DEVICE ON
123+
DESC
124+
"Build null device backend for offline compilation"
125+
)
77126

78-
# Build PAL with Graphics support?
79-
pal_bp(PAL_BUILD_GFX ON)
127+
#####################################################################################
128+
# Specify GFXIP and ASIC enablements.
129+
# The GFXIP and ASIC enablements should follow this hierarchy:
130+
# - Top-Level IP (for example, Gfxip)
131+
# |--- Hardware Layer (for example, Gfx9)
132+
# |------ Major IP Version (for example, Gfx10)
133+
# |--------- ASIC (for example, Navi21)
134+
#
135+
# Where possible, using whitespace below to dictate this hierarchy is preferred.
136+
#
137+
# If a major IP level is not required, it does not need to be specified and the ASICs
138+
# in that major IP level are assumed to be controlled by their Hardware Layer
139+
# enablement.
140+
#
141+
# In the event that a family of ASICs needs an enablement control to make coding
142+
# easier, *sufficient need* must be proven during review in order to add a Family
143+
# level to the hierarchy between Major IP Version and ASIC.
144+
# For example, if all Navi2x ASICs need to be grouped together and *sufficient
145+
# need* is proven, a PAL_BUILD_NAVI2X could be introduced to the hierarchy.
146+
# NOTE: Family levels are considered internal build parameters and would be added to
147+
# PalOnlyBuildParameters.cmake.
80148

81-
pal_bp(PAL_BUILD_BRANCH "2420")
149+
pal_client_bp(PAL_BUILD_GFX ON
150+
DESC
151+
"Build PAL with Graphics support?"
152+
)
82153

83-
### Specify GPU build options ##########################################################################################
84-
85-
if (PAL_BUILD_GFX)
86-
pal_bp(PAL_BUILD_GFX9 ${PAL_BUILD_GFX} MODE "AUTHOR_WARNING")
87-
# PAL's GFX11 support is part of its GFX9 HWL so you need to enable both to get GFX11.
88-
pal_bp(PAL_BUILD_GFX11 ${PAL_BUILD_GFX} DEPENDS_ON PAL_BUILD_GFX9 MODE "AUTHOR_WARNING")
89-
#if PAL_BUILD_GFX12
90-
pal_bp(PAL_BUILD_GFX12 ${PAL_BUILD_GFX} MODE "AUTHOR_WARNING")
91-
#endif
92-
endif() # PAL_BUILD_GFX
154+
pal_client_bp(PAL_BUILD_GFX9 ON
155+
DEPENDS_ON
156+
PAL_BUILD_GFX
157+
)
93158

94-
# If the client wants Gfx9 support, them give them all the neccessary build parameters they need to fill out.
95-
if (PAL_BUILD_GFX9)
159+
# PAL's GFX11 support is part of its GFX9 HWL so you need to enable both to get GFX11.
160+
pal_client_bp(PAL_BUILD_GFX11 ON
161+
DEPENDS_ON
162+
PAL_BUILD_GFX9
163+
)
96164

97-
# Clients should directly set PAL_BUILD_GFX9 and PAL_BUILD_GFX11 in their cmakes to request support for these GPUs.
98-
# These used to be pal_bp calls but were simplified to pal_set_or calls to avoid breaking clients that depend on
99-
# the ASIC-specific variables automatically setting PAL_BUILD_GFX11 via ASIC_CONFIG.
100-
if ((PAL_CLIENT_INTERFACE_MAJOR_VERSION LESS 888) AND DEFINED PAL_BUILD_PHOENIX2)
101-
pal_set_or(PAL_BUILD_GFX11 ${PAL_BUILD_PHOENIX2})
102-
endif()
103-
if ((PAL_CLIENT_INTERFACE_MAJOR_VERSION LESS 917) AND DEFINED PAL_BUILD_STRIX1)
104-
pal_set_or(PAL_BUILD_GFX11 ${PAL_BUILD_STRIX1})
105-
endif()
165+
# Clients should directly set PAL_BUILD_GFX9 and PAL_BUILD_GFX11 in their cmakes to request support for
166+
# these GPUs. These used to be pal_client_bp calls but were simplified to pal_set_or calls to avoid
167+
# breaking clients that depend on the ASIC-specific variables automatically setting PAL_BUILD_GFX11.
168+
# Note: Explicitly not include DEPENDS_ON to ensure this support remains until it can be deprecated.
169+
pal_deprecated_bp(PAL_BUILD_PHOENIX2 ON "${PAL_CLIENT_INTERFACE_MAJOR_VERSION} LESS 888")
170+
pal_set_or(PAL_BUILD_GFX11 $<BOOL:${PAL_BUILD_PHOENIX2}>)
171+
pal_deprecated_bp(PAL_BUILD_STRIX1 ON "${PAL_CLIENT_INTERFACE_MAJOR_VERSION} LESS 917")
172+
pal_set_or(PAL_BUILD_GFX11 $<BOOL:${PAL_BUILD_STRIX1}>)
106173

174+
#if PAL_BUILD_HAWK_POINT1
175+
pal_client_bp(PAL_BUILD_HAWK_POINT1 ON
176+
DEPENDS_ON
177+
PAL_BUILD_GFX11
178+
)
179+
#endif PAL_BUILD_HAWK_POINT1
180+
#if PAL_BUILD_HAWK_POINT2
181+
pal_client_bp(PAL_BUILD_HAWK_POINT2 ON
182+
DEPENDS_ON
183+
PAL_BUILD_GFX11
184+
)
185+
#endif
107186
#if PAL_BUILD_STRIX_HALO
108-
pal_bp( PAL_BUILD_STRIX_HALO OFF MODE "AUTHOR_WARNING"
109-
ASIC_CONFIG
110-
PAL_BUILD_GFX11
111-
CHIP_HDR_STRIX_HALO
112-
)
187+
pal_client_bp(PAL_BUILD_STRIX_HALO ON
188+
DEPENDS_ON
189+
PAL_BUILD_GFX11
190+
)
113191
#endif
114192

115-
endif() # PAL_BUILD_GFX9
116-
117193
#if PAL_BUILD_GFX12
118-
if (PAL_BUILD_GFX12)
194+
pal_client_bp(PAL_BUILD_GFX12 ON
195+
DEPENDS_ON
196+
PAL_BUILD_GFX
197+
)
119198

120199
#if PAL_BUILD_NAVI48
121-
pal_bp(PAL_BUILD_NAVI48 ON MODE "AUTHOR_WARNING"
122-
ASIC_CONFIG
123-
PAL_BUILD_GFX11
124-
PAL_BUILD_GFX12
125-
PAL_BUILD_NAVI4X
126-
CHIP_HDR_NAVI48
127-
)
200+
pal_client_bp(PAL_BUILD_NAVI48 ON
201+
DEPENDS_ON
202+
PAL_BUILD_GFX12
203+
)
128204
#endif
129-
endif() # PAL_BUILD_GFX12
130205
#endif
131206

207+
#####################################################################################
208+
209+
#####################################################################################
210+
# Miscellaneous enablements.
211+
212+
pal_client_bp(PAL_ENABLE_PRINTS_ASSERTS OFF
213+
DESC
214+
"Enable print assertions?"
215+
)
216+
217+
pal_client_bp(PAL_ENABLE_PRINTS_ASSERTS_DEBUG ON
218+
DESC
219+
"Enable print assertions on debug builds?"
220+
)
221+
132222
#if PAL_BUILD_RDF
133-
pal_bp(PAL_BUILD_RDF ON)
223+
pal_client_bp(PAL_BUILD_RDF ON)
134224
#endif
135225

136-
# "This must always be enabled unless the client guarantees they do not use GFX/3D queues"
137-
pal_bp(PAL_BUILD_RPM_GFX_SHADERS ON)
226+
pal_client_bp(PAL_BUILD_RPM_GFX_SHADERS ON
227+
DESC
228+
"This must always be enabled unless the client guarantees they do not use GFX/3D queues"
229+
)
230+
231+
pal_client_bp(PAL_ENABLE_DEBUG_BREAK OFF
232+
DESC
233+
"Enable debug break?"
234+
)
235+
236+
pal_client_bp(PAL_ENABLE_LOGGING OFF
237+
DESC
238+
"Enable debug logging?"
239+
)
240+
241+
pal_client_bp(PAL_MEMTRACK OFF
242+
DESC
243+
"Enable PAL memory tracker?"
244+
)
245+
246+
pal_client_bp(PAL_64BIT_ARCHIVE_FILE_FMT OFF
247+
DESC
248+
"DXCP requires 64-bit file archives to allow creation of files >4GB."
249+
"Vulkan requires 32-bit file archives for backwards compatibility."
250+
"Clients may choose your preference here. 32-bit by default."
251+
)
252+
253+
pal_client_bp(PAL_PRECOMPILED_HEADERS OFF
254+
DESC
255+
"If set, enables precompiled headers to reduce compilation times."
256+
)
138257

258+
#####################################################################################

0 commit comments

Comments
 (0)