2018-03-14 18:07:51 +08:00
|
|
|
/*
|
2020-02-23 05:21:06 +08:00
|
|
|
* Copyright (C) 2018-2020 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 {
|
|
|
|
Default = 0,
|
|
|
|
KernelArg,
|
|
|
|
GeneralStateHeap,
|
|
|
|
DynamicStateHeap,
|
|
|
|
IndirectObjectHeap,
|
|
|
|
SurfaceStateHeap,
|
2018-04-04 17:34:46 +08:00
|
|
|
InstructionHeap,
|
|
|
|
TagAddress,
|
|
|
|
TagValue,
|
|
|
|
GUCStartMessage,
|
2019-08-13 17:34:56 +08:00
|
|
|
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() {
|
|
|
|
return (targetType != PatchInfoAllocationType::Default && targetType != PatchInfoAllocationType::GUCStartMessage);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|