rocr: add specific flag for blit kernel object

so that aql-to-pm4 conversion could verify the validity of the kernel
object.

Signed-off-by: Flora Cui <flora.cui@amd.com>
Этот коммит содержится в:
Flora Cui
2025-07-16 10:48:02 +08:00
коммит произвёл Cui, Flora
родитель 6c87f5b5ce
Коммит a765dd7e94
4 изменённых файлов: 10 добавлений и 2 удалений
+3
Просмотреть файл
@@ -241,6 +241,9 @@ KfdDriver::AllocateMemory(const core::MemoryRegion &mem_region,
? 1
: kmt_alloc_flags.ui32.Uncached);
kmt_alloc_flags.ui32.ExecuteBlit =
!!(alloc_flags & core::MemoryRegion::AllocateExecutableBlitKernelObject);
if (m_region.IsLocalMemory()) {
// Allocate physically contiguous memory. AllocateKfdMemory function call
// will fail if this flag is not supported in KFD.
+3
Просмотреть файл
@@ -106,6 +106,9 @@ class MemoryRegion : public Checked<0x9C961F19EE175BB3> {
AllocateGTTAccess = (1 << 9),
AllocateContiguous = (1 << 10), // Physically contiguous memory
AllocateUncached = (1 << 11), // Uncached memory
// this flag is ignored by Thunk and only used for emulator/dxg to track code-object
// allocations in AQL to PM4 conversion.
AllocateExecutableBlitKernelObject = (1 << 12),
};
typedef uint32_t AllocateFlags;
+2 -1
Просмотреть файл
@@ -378,7 +378,8 @@ void GpuAgent::AssembleShader(const char* func_name, AssembleTarget assemble_tar
(assemble_target == AssembleTarget::AQL ? sizeof(amd_kernel_code_t) : 0);
code_buf_size = AlignUp(header_size + asic_shader->size, 0x1000);
code_buf = system_allocator()(code_buf_size, 0x1000, core::MemoryRegion::AllocateExecutable);
code_buf = system_allocator()(code_buf_size, 0x1000,
core::MemoryRegion::AllocateExecutable | core::MemoryRegion::AllocateExecutableBlitKernelObject);
assert(code_buf != NULL && "Code buffer allocation failed");
memset(code_buf, 0, code_buf_size);