2018-03-14 18:07:51 +08:00
|
|
|
/*
|
2023-12-14 00:09:52 +08:00
|
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
2018-03-14 18:07:51 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-03-14 18:07:51 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-03-14 18:07:51 +08:00
|
|
|
|
|
|
|
enum PatchInfoAllocationType {
|
2023-12-14 00:09:52 +08:00
|
|
|
defaultType = 0,
|
|
|
|
kernelArg,
|
|
|
|
generalStateHeap,
|
|
|
|
dynamicStateHeap,
|
|
|
|
indirectObjectHeap,
|
|
|
|
surfaceStateHeap,
|
|
|
|
instructionHeap,
|
|
|
|
tagAddress,
|
|
|
|
tagValue,
|
|
|
|
gucStartMessage,
|
|
|
|
scratchSpace
|
2018-03-14 18:07:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct PatchInfoData {
|
|
|
|
uint64_t sourceAllocation;
|
|
|
|
uint64_t sourceAllocationOffset;
|
|
|
|
PatchInfoAllocationType sourceType;
|
|
|
|
uint64_t targetAllocation;
|
|
|
|
uint64_t targetAllocationOffset;
|
|
|
|
PatchInfoAllocationType targetType;
|
2018-04-04 17:34:46 +08:00
|
|
|
uint32_t patchAddressSize;
|
|
|
|
|
|
|
|
PatchInfoData(uint64_t sourceAllocation,
|
|
|
|
uint64_t sourceAllocationOffset,
|
|
|
|
PatchInfoAllocationType sourceType,
|
|
|
|
uint64_t targetAllocation,
|
|
|
|
uint64_t targetAllocationOffset,
|
|
|
|
PatchInfoAllocationType targetType,
|
|
|
|
uint32_t patchAddressSize)
|
|
|
|
: sourceAllocation(sourceAllocation),
|
|
|
|
sourceAllocationOffset(sourceAllocationOffset),
|
|
|
|
sourceType(sourceType),
|
|
|
|
targetAllocation(targetAllocation),
|
|
|
|
targetAllocationOffset(targetAllocationOffset),
|
|
|
|
targetType(targetType),
|
|
|
|
patchAddressSize(patchAddressSize) {
|
|
|
|
}
|
|
|
|
|
|
|
|
PatchInfoData(uint64_t sourceAllocation,
|
|
|
|
uint64_t sourceAllocationOffset,
|
|
|
|
PatchInfoAllocationType sourceType,
|
|
|
|
uint64_t targetAllocation,
|
|
|
|
uint64_t targetAllocationOffset,
|
|
|
|
PatchInfoAllocationType targetType)
|
|
|
|
: sourceAllocation(sourceAllocation),
|
|
|
|
sourceAllocationOffset(sourceAllocationOffset),
|
|
|
|
sourceType(sourceType),
|
|
|
|
targetAllocation(targetAllocation),
|
|
|
|
targetAllocationOffset(targetAllocationOffset),
|
|
|
|
targetType(targetType),
|
|
|
|
patchAddressSize(sizeof(void *)) {
|
|
|
|
}
|
|
|
|
|
|
|
|
bool requiresIndirectPatching() {
|
2023-12-14 00:09:52 +08:00
|
|
|
return (targetType != PatchInfoAllocationType::defaultType && targetType != PatchInfoAllocationType::gucStartMessage);
|
2018-04-04 17:34:46 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CommandChunk {
|
|
|
|
uint64_t baseAddressCpu = 0;
|
|
|
|
uint64_t baseAddressGpu = 0;
|
|
|
|
uint64_t startOffset = 0;
|
|
|
|
uint64_t endOffset = 0;
|
|
|
|
uint64_t batchBufferStartLocation = 0;
|
|
|
|
uint64_t batchBufferStartAddress = 0;
|
2018-03-14 18:07:51 +08:00
|
|
|
};
|
2023-12-14 00:09:52 +08:00
|
|
|
} // namespace NEO
|