Unify STORE_DATA_IMM cmd and reduce number of files to compile
Change-Id: Ib24f4a954468423528a36c88bac45218196c5a96
This commit is contained in:
parent
14e4ee9d9a
commit
c1fc60efa9
|
@ -48,7 +48,6 @@ set(RUNTIME_SRCS_GENX_CPP_BASE
|
|||
command_stream_receiver_hw
|
||||
device_queue
|
||||
experimental_command_buffer
|
||||
flat_batch_buffer_helper_hw
|
||||
gpgpu_walker
|
||||
hw_helper
|
||||
hw_info
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hw_cmds.h"
|
||||
#include "runtime/helpers/flat_batch_buffer_helper_hw.inl"
|
||||
|
||||
namespace OCLRT {
|
||||
|
||||
typedef CNLFamily Family;
|
||||
|
||||
template <>
|
||||
void FlatBatchBufferHelperHw<Family>::sdiSetAddress(typename Family::MI_STORE_DATA_IMM *sdiCommand, uint64_t address) {
|
||||
sdiCommand->setAddressGraphicsaddress472(address);
|
||||
}
|
||||
|
||||
template <>
|
||||
void FlatBatchBufferHelperHw<Family>::sdiSetStoreQword(typename Family::MI_STORE_DATA_IMM *sdiCommand, bool setQword) {
|
||||
sdiCommand->setStoreQword(setQword);
|
||||
}
|
||||
|
||||
template class FlatBatchBufferHelperHw<Family>;
|
||||
} // namespace OCLRT
|
|
@ -1586,107 +1586,7 @@ typedef struct tagMI_NOOP {
|
|||
}
|
||||
} MI_NOOP;
|
||||
STATIC_ASSERT(4 == sizeof(MI_NOOP));
|
||||
typedef struct tagMI_STORE_DATA_IMM {
|
||||
union tagTheStructure {
|
||||
struct tagCommon {
|
||||
uint32_t DwordLength : BITFIELD_RANGE(0, 9);
|
||||
uint32_t Reserved_10 : BITFIELD_RANGE(10, 20);
|
||||
uint32_t StoreQword : BITFIELD_RANGE(21, 21);
|
||||
uint32_t UseGlobalGtt : BITFIELD_RANGE(22, 22);
|
||||
uint32_t MiCommandOpcode : BITFIELD_RANGE(23, 28);
|
||||
uint32_t CommandType : BITFIELD_RANGE(29, 31);
|
||||
uint64_t CoreModeEnable : BITFIELD_RANGE(0, 0);
|
||||
uint64_t Reserved_33 : BITFIELD_RANGE(1, 1);
|
||||
uint64_t Address_Graphicsaddress47_2 : BITFIELD_RANGE(2, 47);
|
||||
uint64_t Address_Reserved : BITFIELD_RANGE(48, 63);
|
||||
uint32_t DataDword0;
|
||||
uint32_t DataDword1;
|
||||
} Common;
|
||||
uint32_t RawData[5];
|
||||
} TheStructure;
|
||||
typedef enum tagDWORD_LENGTH {
|
||||
DWORD_LENGTH_STORE_DWORD = 0x2,
|
||||
DWORD_LENGTH_STORE_QWORD = 0x3,
|
||||
} DWORD_LENGTH;
|
||||
typedef enum tagMI_COMMAND_OPCODE {
|
||||
MI_COMMAND_OPCODE_MI_STORE_DATA_IMM = 0x20,
|
||||
} MI_COMMAND_OPCODE;
|
||||
typedef enum tagCOMMAND_TYPE {
|
||||
COMMAND_TYPE_MI_COMMAND = 0x0,
|
||||
} COMMAND_TYPE;
|
||||
inline void init(void) {
|
||||
memset(&TheStructure, 0, sizeof(TheStructure));
|
||||
TheStructure.Common.DwordLength = DWORD_LENGTH_STORE_DWORD;
|
||||
TheStructure.Common.MiCommandOpcode = MI_COMMAND_OPCODE_MI_STORE_DATA_IMM;
|
||||
TheStructure.Common.CommandType = COMMAND_TYPE_MI_COMMAND;
|
||||
}
|
||||
static tagMI_STORE_DATA_IMM sInit(void) {
|
||||
MI_STORE_DATA_IMM state;
|
||||
state.init();
|
||||
return state;
|
||||
}
|
||||
inline uint32_t &getRawData(const uint32_t index) {
|
||||
DEBUG_BREAK_IF(index >= 5);
|
||||
return TheStructure.RawData[index];
|
||||
}
|
||||
inline void setDwordLength(const DWORD_LENGTH value) {
|
||||
TheStructure.Common.DwordLength = value;
|
||||
}
|
||||
inline DWORD_LENGTH getDwordLength(void) const {
|
||||
return static_cast<DWORD_LENGTH>(TheStructure.Common.DwordLength);
|
||||
}
|
||||
inline void setStoreQword(const bool value) {
|
||||
TheStructure.Common.StoreQword = value;
|
||||
}
|
||||
inline bool getStoreQword(void) const {
|
||||
return (TheStructure.Common.StoreQword);
|
||||
}
|
||||
inline void setUseGlobalGtt(const bool value) {
|
||||
TheStructure.Common.UseGlobalGtt = value;
|
||||
}
|
||||
inline bool getUseGlobalGtt(void) const {
|
||||
return (TheStructure.Common.UseGlobalGtt);
|
||||
}
|
||||
inline void setCoreModeEnable(const uint64_t value) {
|
||||
TheStructure.Common.CoreModeEnable = value;
|
||||
}
|
||||
inline uint64_t getCoreModeEnable(void) const {
|
||||
return (TheStructure.Common.CoreModeEnable);
|
||||
}
|
||||
typedef enum tagADDRESS_GRAPHICSADDRESS47_2 {
|
||||
ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT = 0x2,
|
||||
ADDRESS_GRAPHICSADDRESS47_2_ALIGN_SIZE = 0x4,
|
||||
} ADDRESS_GRAPHICSADDRESS47_2;
|
||||
inline void setAddressGraphicsaddress472(const uint64_t value) {
|
||||
TheStructure.Common.Address_Graphicsaddress47_2 = value >> ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT;
|
||||
}
|
||||
inline uint64_t getAddressGraphicsaddress472(void) const {
|
||||
return (TheStructure.Common.Address_Graphicsaddress47_2 << ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT);
|
||||
}
|
||||
typedef enum tagADDRESS_RESERVED {
|
||||
ADDRESS_RESERVED_BIT_SHIFT = 0x2,
|
||||
ADDRESS_RESERVED_ALIGN_SIZE = 0x4,
|
||||
} ADDRESS_RESERVED;
|
||||
inline void setAddressReserved(const uint64_t value) {
|
||||
TheStructure.Common.Address_Reserved = value >> ADDRESS_RESERVED_BIT_SHIFT;
|
||||
}
|
||||
inline uint64_t getAddressReserved(void) const {
|
||||
return (TheStructure.Common.Address_Reserved << ADDRESS_RESERVED_BIT_SHIFT);
|
||||
}
|
||||
inline void setDataDword0(const uint32_t value) {
|
||||
TheStructure.Common.DataDword0 = value;
|
||||
}
|
||||
inline uint32_t getDataDword0(void) const {
|
||||
return (TheStructure.Common.DataDword0);
|
||||
}
|
||||
inline void setDataDword1(const uint32_t value) {
|
||||
TheStructure.Common.DataDword1 = value;
|
||||
}
|
||||
inline uint32_t getDataDword1(void) const {
|
||||
return (TheStructure.Common.DataDword1);
|
||||
}
|
||||
} MI_STORE_DATA_IMM;
|
||||
STATIC_ASSERT(20 == sizeof(MI_STORE_DATA_IMM));
|
||||
|
||||
typedef struct tagMI_STORE_REGISTER_MEM {
|
||||
union tagTheStructure {
|
||||
struct tagCommon {
|
||||
|
|
|
@ -515,4 +515,106 @@ typedef struct tagMI_SEMAPHORE_WAIT {
|
|||
}
|
||||
} MI_SEMAPHORE_WAIT;
|
||||
STATIC_ASSERT(16 == sizeof(MI_SEMAPHORE_WAIT));
|
||||
|
||||
typedef struct tagMI_STORE_DATA_IMM {
|
||||
union tagTheStructure {
|
||||
struct tagCommon {
|
||||
uint32_t DwordLength : BITFIELD_RANGE(0, 9);
|
||||
uint32_t Reserved_10 : BITFIELD_RANGE(10, 20);
|
||||
uint32_t StoreQword : BITFIELD_RANGE(21, 21);
|
||||
uint32_t UseGlobalGtt : BITFIELD_RANGE(22, 22);
|
||||
uint32_t MiCommandOpcode : BITFIELD_RANGE(23, 28);
|
||||
uint32_t CommandType : BITFIELD_RANGE(29, 31);
|
||||
uint64_t CoreModeEnable : BITFIELD_RANGE(0, 0);
|
||||
uint64_t Reserved_33 : BITFIELD_RANGE(1, 1);
|
||||
uint64_t Address_Graphicsaddress47_2 : BITFIELD_RANGE(2, 47);
|
||||
uint64_t Address_Reserved : BITFIELD_RANGE(48, 63);
|
||||
uint32_t DataDword0;
|
||||
uint32_t DataDword1;
|
||||
} Common;
|
||||
uint32_t RawData[5];
|
||||
} TheStructure;
|
||||
typedef enum tagDWORD_LENGTH {
|
||||
DWORD_LENGTH_STORE_DWORD = 0x2,
|
||||
DWORD_LENGTH_STORE_QWORD = 0x3,
|
||||
} DWORD_LENGTH;
|
||||
typedef enum tagMI_COMMAND_OPCODE {
|
||||
MI_COMMAND_OPCODE_MI_STORE_DATA_IMM = 0x20,
|
||||
} MI_COMMAND_OPCODE;
|
||||
typedef enum tagCOMMAND_TYPE {
|
||||
COMMAND_TYPE_MI_COMMAND = 0x0,
|
||||
} COMMAND_TYPE;
|
||||
inline void init(void) {
|
||||
memset(&TheStructure, 0, sizeof(TheStructure));
|
||||
TheStructure.Common.DwordLength = DWORD_LENGTH_STORE_DWORD;
|
||||
TheStructure.Common.MiCommandOpcode = MI_COMMAND_OPCODE_MI_STORE_DATA_IMM;
|
||||
TheStructure.Common.CommandType = COMMAND_TYPE_MI_COMMAND;
|
||||
}
|
||||
static tagMI_STORE_DATA_IMM sInit(void) {
|
||||
MI_STORE_DATA_IMM state;
|
||||
state.init();
|
||||
return state;
|
||||
}
|
||||
inline uint32_t &getRawData(const uint32_t index) {
|
||||
DEBUG_BREAK_IF(index >= 5);
|
||||
return TheStructure.RawData[index];
|
||||
}
|
||||
inline void setDwordLength(const DWORD_LENGTH value) {
|
||||
TheStructure.Common.DwordLength = value;
|
||||
}
|
||||
inline DWORD_LENGTH getDwordLength(void) const {
|
||||
return static_cast<DWORD_LENGTH>(TheStructure.Common.DwordLength);
|
||||
}
|
||||
inline void setStoreQword(const bool value) {
|
||||
TheStructure.Common.StoreQword = value;
|
||||
}
|
||||
inline bool getStoreQword(void) const {
|
||||
return (TheStructure.Common.StoreQword);
|
||||
}
|
||||
inline void setUseGlobalGtt(const bool value) {
|
||||
TheStructure.Common.UseGlobalGtt = value;
|
||||
}
|
||||
inline bool getUseGlobalGtt(void) const {
|
||||
return (TheStructure.Common.UseGlobalGtt);
|
||||
}
|
||||
inline void setCoreModeEnable(const uint64_t value) {
|
||||
TheStructure.Common.CoreModeEnable = value;
|
||||
}
|
||||
inline uint64_t getCoreModeEnable(void) const {
|
||||
return (TheStructure.Common.CoreModeEnable);
|
||||
}
|
||||
typedef enum tagADDRESS_GRAPHICSADDRESS47_2 {
|
||||
ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT = 0x2,
|
||||
ADDRESS_GRAPHICSADDRESS47_2_ALIGN_SIZE = 0x4,
|
||||
} ADDRESS_GRAPHICSADDRESS47_2;
|
||||
inline void setAddress(const uint64_t value) {
|
||||
TheStructure.Common.Address_Graphicsaddress47_2 = value >> ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT;
|
||||
}
|
||||
inline uint64_t getAddress(void) const {
|
||||
return (TheStructure.Common.Address_Graphicsaddress47_2 << ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT);
|
||||
}
|
||||
typedef enum tagADDRESS_RESERVED {
|
||||
ADDRESS_RESERVED_BIT_SHIFT = 0x2,
|
||||
ADDRESS_RESERVED_ALIGN_SIZE = 0x4,
|
||||
} ADDRESS_RESERVED;
|
||||
inline void setAddressReserved(const uint64_t value) {
|
||||
TheStructure.Common.Address_Reserved = value >> ADDRESS_RESERVED_BIT_SHIFT;
|
||||
}
|
||||
inline uint64_t getAddressReserved(void) const {
|
||||
return (TheStructure.Common.Address_Reserved << ADDRESS_RESERVED_BIT_SHIFT);
|
||||
}
|
||||
inline void setDataDword0(const uint32_t value) {
|
||||
TheStructure.Common.DataDword0 = value;
|
||||
}
|
||||
inline uint32_t getDataDword0(void) const {
|
||||
return (TheStructure.Common.DataDword0);
|
||||
}
|
||||
inline void setDataDword1(const uint32_t value) {
|
||||
TheStructure.Common.DataDword1 = value;
|
||||
}
|
||||
inline uint32_t getDataDword1(void) const {
|
||||
return (TheStructure.Common.DataDword1);
|
||||
}
|
||||
} MI_STORE_DATA_IMM;
|
||||
STATIC_ASSERT(20 == sizeof(MI_STORE_DATA_IMM));
|
||||
#pragma pack()
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/hw_helper.inl"
|
||||
#include "runtime/helpers/flat_batch_buffer_helper_hw.inl"
|
||||
|
||||
namespace OCLRT {
|
||||
typedef CNLFamily Family;
|
||||
|
@ -47,4 +48,5 @@ bool HwHelperHw<Family>::setupPreemptionRegisters(HardwareInfo *pHwInfo, bool en
|
|||
}
|
||||
|
||||
template class HwHelperHw<Family>;
|
||||
template class FlatBatchBufferHelperHw<Family>;
|
||||
} // namespace OCLRT
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hw_cmds.h"
|
||||
#include "runtime/helpers/flat_batch_buffer_helper_hw.inl"
|
||||
|
||||
namespace OCLRT {
|
||||
|
||||
constexpr uint32_t LOW32_BIT_MASK = 0x0000FFFFFFFFULL;
|
||||
|
||||
typedef BDWFamily Family;
|
||||
|
||||
template <>
|
||||
void FlatBatchBufferHelperHw<Family>::sdiSetAddress(typename Family::MI_STORE_DATA_IMM *sdiCommand, uint64_t address) {
|
||||
sdiCommand->setAddress(static_cast<uint32_t>(address & LOW32_BIT_MASK));
|
||||
sdiCommand->setAddressHigh(static_cast<uint32_t>(address >> 32));
|
||||
}
|
||||
|
||||
template <>
|
||||
void FlatBatchBufferHelperHw<Family>::sdiSetStoreQword(typename Family::MI_STORE_DATA_IMM *sdiCommand, bool setQword) {
|
||||
sdiCommand->setStoreQword(setQword ? Family::MI_STORE_DATA_IMM::STORE_QWORD_STORE_QWORD : Family::MI_STORE_DATA_IMM::STORE_QWORD_STORE_DWORD);
|
||||
}
|
||||
|
||||
template class FlatBatchBufferHelperHw<Family>;
|
||||
} // namespace OCLRT
|
|
@ -1523,107 +1523,7 @@ typedef struct tagMI_NOOP {
|
|||
}
|
||||
} MI_NOOP;
|
||||
STATIC_ASSERT(4 == sizeof(MI_NOOP));
|
||||
typedef struct tagMI_STORE_DATA_IMM {
|
||||
union tagTheStructure {
|
||||
struct tagCommon {
|
||||
uint32_t DwordLength : BITFIELD_RANGE(0, 9);
|
||||
uint32_t Reserved_10 : BITFIELD_RANGE(10, 20);
|
||||
uint32_t StoreQword : BITFIELD_RANGE(21, 21);
|
||||
uint32_t UseGlobalGtt : BITFIELD_RANGE(22, 22);
|
||||
uint32_t MiCommandOpcode : BITFIELD_RANGE(23, 28);
|
||||
uint32_t CommandType : BITFIELD_RANGE(29, 31);
|
||||
uint32_t Reserved_32 : BITFIELD_RANGE(0, 1);
|
||||
uint32_t Address : BITFIELD_RANGE(2, 31);
|
||||
uint32_t AddressHigh : BITFIELD_RANGE(0, 15);
|
||||
uint32_t Reserved_80 : BITFIELD_RANGE(16, 31);
|
||||
uint32_t DataDword0;
|
||||
uint32_t DataDword1;
|
||||
} Common;
|
||||
uint32_t RawData[5];
|
||||
} TheStructure;
|
||||
typedef enum tagDWORD_LENGTH {
|
||||
DWORD_LENGTH_EXCLUDES_DWORD_0_1 = 0x0,
|
||||
} DWORD_LENGTH;
|
||||
typedef enum tagSTORE_QWORD {
|
||||
STORE_QWORD_STORE_DWORD = 0x0,
|
||||
STORE_QWORD_STORE_QWORD = 0x1,
|
||||
} STORE_QWORD;
|
||||
typedef enum tagMI_COMMAND_OPCODE {
|
||||
MI_COMMAND_OPCODE_MI_STORE_DATA_IMM = 0x20,
|
||||
} MI_COMMAND_OPCODE;
|
||||
typedef enum tagCOMMAND_TYPE {
|
||||
COMMAND_TYPE_MI_COMMAND = 0x0,
|
||||
} COMMAND_TYPE;
|
||||
typedef enum tagPATCH_CONSTANTS {
|
||||
ADDRESS_BYTEOFFSET = 0x4,
|
||||
ADDRESS_INDEX = 0x1,
|
||||
ADDRESSHIGH_BYTEOFFSET = 0x8,
|
||||
ADDRESSHIGH_INDEX = 0x2,
|
||||
} PATCH_CONSTANTS;
|
||||
inline void init(void) {
|
||||
memset(&TheStructure, 0, sizeof(TheStructure));
|
||||
TheStructure.Common.DwordLength = DWORD_LENGTH_EXCLUDES_DWORD_0_1;
|
||||
TheStructure.Common.StoreQword = STORE_QWORD_STORE_DWORD;
|
||||
TheStructure.Common.MiCommandOpcode = MI_COMMAND_OPCODE_MI_STORE_DATA_IMM;
|
||||
TheStructure.Common.CommandType = COMMAND_TYPE_MI_COMMAND;
|
||||
}
|
||||
static tagMI_STORE_DATA_IMM sInit(void) {
|
||||
MI_STORE_DATA_IMM state;
|
||||
state.init();
|
||||
return state;
|
||||
}
|
||||
inline uint32_t &getRawData(const uint32_t index) {
|
||||
DEBUG_BREAK_IF(index >= 5);
|
||||
return TheStructure.RawData[index];
|
||||
}
|
||||
inline void setDwordLength(const DWORD_LENGTH value) {
|
||||
TheStructure.Common.DwordLength = value;
|
||||
}
|
||||
inline DWORD_LENGTH getDwordLength(void) const {
|
||||
return static_cast<DWORD_LENGTH>(TheStructure.Common.DwordLength);
|
||||
}
|
||||
inline void setStoreQword(const STORE_QWORD value) {
|
||||
TheStructure.Common.StoreQword = value;
|
||||
}
|
||||
inline STORE_QWORD getStoreQword(void) const {
|
||||
return static_cast<STORE_QWORD>(TheStructure.Common.StoreQword);
|
||||
}
|
||||
inline void setUseGlobalGtt(const uint32_t value) {
|
||||
TheStructure.Common.UseGlobalGtt = value;
|
||||
}
|
||||
inline uint32_t getUseGlobalGtt(void) const {
|
||||
return (TheStructure.Common.UseGlobalGtt);
|
||||
}
|
||||
typedef enum tagADDRESS {
|
||||
ADDRESS_BIT_SHIFT = 0x2,
|
||||
ADDRESS_ALIGN_SIZE = 0x4,
|
||||
} ADDRESS;
|
||||
inline void setAddress(const uint32_t value) {
|
||||
TheStructure.Common.Address = value >> ADDRESS_BIT_SHIFT;
|
||||
}
|
||||
inline uint32_t getAddress(void) const {
|
||||
return (TheStructure.Common.Address << ADDRESS_BIT_SHIFT);
|
||||
}
|
||||
inline void setAddressHigh(const uint32_t value) {
|
||||
TheStructure.Common.AddressHigh = value;
|
||||
}
|
||||
inline uint32_t getAddressHigh(void) const {
|
||||
return (TheStructure.Common.AddressHigh);
|
||||
}
|
||||
inline void setDataDword0(const uint32_t value) {
|
||||
TheStructure.Common.DataDword0 = value;
|
||||
}
|
||||
inline uint32_t getDataDword0(void) const {
|
||||
return (TheStructure.Common.DataDword0);
|
||||
}
|
||||
inline void setDataDword1(const uint32_t value) {
|
||||
TheStructure.Common.DataDword1 = value;
|
||||
}
|
||||
inline uint32_t getDataDword1(void) const {
|
||||
return (TheStructure.Common.DataDword1);
|
||||
}
|
||||
} MI_STORE_DATA_IMM;
|
||||
STATIC_ASSERT(20 == sizeof(MI_STORE_DATA_IMM));
|
||||
|
||||
typedef struct tagMI_STORE_REGISTER_MEM {
|
||||
union tagTheStructure {
|
||||
struct tagCommon {
|
||||
|
|
|
@ -398,4 +398,108 @@ typedef struct tagMI_SEMAPHORE_WAIT {
|
|||
}
|
||||
} MI_SEMAPHORE_WAIT;
|
||||
STATIC_ASSERT(16 == sizeof(MI_SEMAPHORE_WAIT));
|
||||
|
||||
typedef struct tagMI_STORE_DATA_IMM {
|
||||
union tagTheStructure {
|
||||
struct tagCommon {
|
||||
uint32_t DwordLength : BITFIELD_RANGE(0, 9);
|
||||
uint32_t Reserved_10 : BITFIELD_RANGE(10, 20);
|
||||
uint32_t StoreQword : BITFIELD_RANGE(21, 21);
|
||||
uint32_t UseGlobalGtt : BITFIELD_RANGE(22, 22);
|
||||
uint32_t MiCommandOpcode : BITFIELD_RANGE(23, 28);
|
||||
uint32_t CommandType : BITFIELD_RANGE(29, 31);
|
||||
uint32_t Reserved_32 : BITFIELD_RANGE(0, 1);
|
||||
uint32_t Address : BITFIELD_RANGE(2, 31);
|
||||
uint32_t AddressHigh : BITFIELD_RANGE(0, 15);
|
||||
uint32_t Reserved_80 : BITFIELD_RANGE(16, 31);
|
||||
uint32_t DataDword0;
|
||||
uint32_t DataDword1;
|
||||
} Common;
|
||||
uint32_t RawData[5];
|
||||
} TheStructure;
|
||||
typedef enum tagDWORD_LENGTH {
|
||||
DWORD_LENGTH_EXCLUDES_DWORD_0_1 = 0x0,
|
||||
} DWORD_LENGTH;
|
||||
typedef enum tagMI_COMMAND_OPCODE {
|
||||
MI_COMMAND_OPCODE_MI_STORE_DATA_IMM = 0x20,
|
||||
} MI_COMMAND_OPCODE;
|
||||
typedef enum tagCOMMAND_TYPE {
|
||||
COMMAND_TYPE_MI_COMMAND = 0x0,
|
||||
} COMMAND_TYPE;
|
||||
typedef enum tagPATCH_CONSTANTS {
|
||||
ADDRESS_BYTEOFFSET = 0x4,
|
||||
ADDRESS_INDEX = 0x1,
|
||||
ADDRESSHIGH_BYTEOFFSET = 0x8,
|
||||
ADDRESSHIGH_INDEX = 0x2,
|
||||
} PATCH_CONSTANTS;
|
||||
inline void init(void) {
|
||||
memset(&TheStructure, 0, sizeof(TheStructure));
|
||||
TheStructure.Common.DwordLength = DWORD_LENGTH_EXCLUDES_DWORD_0_1;
|
||||
TheStructure.Common.MiCommandOpcode = MI_COMMAND_OPCODE_MI_STORE_DATA_IMM;
|
||||
TheStructure.Common.CommandType = COMMAND_TYPE_MI_COMMAND;
|
||||
}
|
||||
static tagMI_STORE_DATA_IMM sInit(void) {
|
||||
MI_STORE_DATA_IMM state;
|
||||
state.init();
|
||||
return state;
|
||||
}
|
||||
inline uint32_t &getRawData(const uint32_t index) {
|
||||
DEBUG_BREAK_IF(index >= 5);
|
||||
return TheStructure.RawData[index];
|
||||
}
|
||||
inline void setDwordLength(const DWORD_LENGTH value) {
|
||||
TheStructure.Common.DwordLength = value;
|
||||
}
|
||||
inline DWORD_LENGTH getDwordLength(void) const {
|
||||
return static_cast<DWORD_LENGTH>(TheStructure.Common.DwordLength);
|
||||
}
|
||||
inline void setStoreQword(const bool value) {
|
||||
TheStructure.Common.StoreQword = value;
|
||||
}
|
||||
inline bool getStoreQword(void) const {
|
||||
return TheStructure.Common.StoreQword;
|
||||
}
|
||||
inline void setUseGlobalGtt(const uint32_t value) {
|
||||
TheStructure.Common.UseGlobalGtt = value;
|
||||
}
|
||||
inline uint32_t getUseGlobalGtt(void) const {
|
||||
return (TheStructure.Common.UseGlobalGtt);
|
||||
}
|
||||
typedef enum tagADDRESS {
|
||||
ADDRESS_BIT_SHIFT = 0x2,
|
||||
ADDRESS_ALIGN_SIZE = 0x4,
|
||||
} ADDRESS;
|
||||
inline void setAddress(const uint64_t value) {
|
||||
setAddressLow(static_cast<uint32_t>(value & 0x0000FFFFFFFFULL));
|
||||
setAddressHigh(static_cast<uint32_t>(value >> 32));
|
||||
}
|
||||
inline uint64_t getAddress(void) const {
|
||||
return (static_cast<uint64_t>(getAddressHigh()) << 32) | static_cast<uint64_t>(getAddressLow());
|
||||
}
|
||||
inline void setAddressLow(const uint32_t value) {
|
||||
TheStructure.Common.Address = value >> ADDRESS_BIT_SHIFT;
|
||||
}
|
||||
inline uint32_t getAddressLow(void) const {
|
||||
return (TheStructure.Common.Address << ADDRESS_BIT_SHIFT);
|
||||
}
|
||||
inline void setAddressHigh(const uint32_t value) {
|
||||
TheStructure.Common.AddressHigh = value;
|
||||
}
|
||||
inline uint32_t getAddressHigh(void) const {
|
||||
return (TheStructure.Common.AddressHigh);
|
||||
}
|
||||
inline void setDataDword0(const uint32_t value) {
|
||||
TheStructure.Common.DataDword0 = value;
|
||||
}
|
||||
inline uint32_t getDataDword0(void) const {
|
||||
return (TheStructure.Common.DataDword0);
|
||||
}
|
||||
inline void setDataDword1(const uint32_t value) {
|
||||
TheStructure.Common.DataDword1 = value;
|
||||
}
|
||||
inline uint32_t getDataDword1(void) const {
|
||||
return (TheStructure.Common.DataDword1);
|
||||
}
|
||||
} MI_STORE_DATA_IMM;
|
||||
STATIC_ASSERT(20 == sizeof(MI_STORE_DATA_IMM));
|
||||
#pragma pack()
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/hw_helper.inl"
|
||||
#include "runtime/helpers/flat_batch_buffer_helper_hw.inl"
|
||||
#include "runtime/memory_manager/memory_constants.h"
|
||||
|
||||
namespace OCLRT {
|
||||
|
@ -46,4 +47,5 @@ void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps, c
|
|||
}
|
||||
|
||||
template class HwHelperHw<Family>;
|
||||
template class FlatBatchBufferHelperHw<Family>;
|
||||
} // namespace OCLRT
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hw_cmds.h"
|
||||
#include "runtime/helpers/flat_batch_buffer_helper_hw.inl"
|
||||
|
||||
namespace OCLRT {
|
||||
|
||||
typedef SKLFamily Family;
|
||||
|
||||
template <>
|
||||
void FlatBatchBufferHelperHw<Family>::sdiSetAddress(typename Family::MI_STORE_DATA_IMM *sdiCommand, uint64_t address) {
|
||||
sdiCommand->setAddressGraphicsaddress472(address);
|
||||
}
|
||||
|
||||
template <>
|
||||
void FlatBatchBufferHelperHw<Family>::sdiSetStoreQword(typename Family::MI_STORE_DATA_IMM *sdiCommand, bool setQword) {
|
||||
sdiCommand->setStoreQword(setQword);
|
||||
}
|
||||
|
||||
template class FlatBatchBufferHelperHw<Family>;
|
||||
} // namespace OCLRT
|
|
@ -1527,107 +1527,7 @@ typedef struct tagMI_NOOP {
|
|||
}
|
||||
} MI_NOOP;
|
||||
STATIC_ASSERT(4 == sizeof(MI_NOOP));
|
||||
typedef struct tagMI_STORE_DATA_IMM {
|
||||
union tagTheStructure {
|
||||
struct tagCommon {
|
||||
uint32_t DwordLength : BITFIELD_RANGE(0, 9);
|
||||
uint32_t Reserved_10 : BITFIELD_RANGE(10, 20);
|
||||
uint32_t StoreQword : BITFIELD_RANGE(21, 21);
|
||||
uint32_t UseGlobalGtt : BITFIELD_RANGE(22, 22);
|
||||
uint32_t MiCommandOpcode : BITFIELD_RANGE(23, 28);
|
||||
uint32_t CommandType : BITFIELD_RANGE(29, 31);
|
||||
uint64_t CoreModeEnable : BITFIELD_RANGE(0, 0);
|
||||
uint64_t Reserved_33 : BITFIELD_RANGE(1, 1);
|
||||
uint64_t Address_Graphicsaddress47_2 : BITFIELD_RANGE(2, 47);
|
||||
uint64_t Address_Reserved : BITFIELD_RANGE(48, 63);
|
||||
uint32_t DataDword0;
|
||||
uint32_t DataDword1;
|
||||
} Common;
|
||||
uint32_t RawData[5];
|
||||
} TheStructure;
|
||||
typedef enum tagDWORD_LENGTH {
|
||||
DWORD_LENGTH_STORE_DWORD = 0x2,
|
||||
DWORD_LENGTH_STORE_QWORD = 0x3,
|
||||
} DWORD_LENGTH;
|
||||
typedef enum tagMI_COMMAND_OPCODE {
|
||||
MI_COMMAND_OPCODE_MI_STORE_DATA_IMM = 0x20,
|
||||
} MI_COMMAND_OPCODE;
|
||||
typedef enum tagCOMMAND_TYPE {
|
||||
COMMAND_TYPE_MI_COMMAND = 0x0,
|
||||
} COMMAND_TYPE;
|
||||
inline void init(void) {
|
||||
memset(&TheStructure, 0, sizeof(TheStructure));
|
||||
TheStructure.Common.DwordLength = DWORD_LENGTH_STORE_DWORD;
|
||||
TheStructure.Common.MiCommandOpcode = MI_COMMAND_OPCODE_MI_STORE_DATA_IMM;
|
||||
TheStructure.Common.CommandType = COMMAND_TYPE_MI_COMMAND;
|
||||
}
|
||||
static tagMI_STORE_DATA_IMM sInit(void) {
|
||||
MI_STORE_DATA_IMM state;
|
||||
state.init();
|
||||
return state;
|
||||
}
|
||||
inline uint32_t &getRawData(const uint32_t index) {
|
||||
DEBUG_BREAK_IF(index >= 5);
|
||||
return TheStructure.RawData[index];
|
||||
}
|
||||
inline void setDwordLength(const DWORD_LENGTH value) {
|
||||
TheStructure.Common.DwordLength = value;
|
||||
}
|
||||
inline DWORD_LENGTH getDwordLength(void) const {
|
||||
return static_cast<DWORD_LENGTH>(TheStructure.Common.DwordLength);
|
||||
}
|
||||
inline void setStoreQword(const bool value) {
|
||||
TheStructure.Common.StoreQword = value;
|
||||
}
|
||||
inline bool getStoreQword(void) const {
|
||||
return (TheStructure.Common.StoreQword);
|
||||
}
|
||||
inline void setUseGlobalGtt(const bool value) {
|
||||
TheStructure.Common.UseGlobalGtt = value;
|
||||
}
|
||||
inline bool getUseGlobalGtt(void) const {
|
||||
return (TheStructure.Common.UseGlobalGtt);
|
||||
}
|
||||
inline void setCoreModeEnable(const uint64_t value) {
|
||||
TheStructure.Common.CoreModeEnable = value;
|
||||
}
|
||||
inline uint64_t getCoreModeEnable(void) const {
|
||||
return (TheStructure.Common.CoreModeEnable);
|
||||
}
|
||||
typedef enum tagADDRESS_GRAPHICSADDRESS47_2 {
|
||||
ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT = 0x2,
|
||||
ADDRESS_GRAPHICSADDRESS47_2_ALIGN_SIZE = 0x4,
|
||||
} ADDRESS_GRAPHICSADDRESS47_2;
|
||||
inline void setAddressGraphicsaddress472(const uint64_t value) {
|
||||
TheStructure.Common.Address_Graphicsaddress47_2 = value >> ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT;
|
||||
}
|
||||
inline uint64_t getAddressGraphicsaddress472(void) const {
|
||||
return (TheStructure.Common.Address_Graphicsaddress47_2 << ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT);
|
||||
}
|
||||
typedef enum tagADDRESS_RESERVED {
|
||||
ADDRESS_RESERVED_BIT_SHIFT = 0x2,
|
||||
ADDRESS_RESERVED_ALIGN_SIZE = 0x4,
|
||||
} ADDRESS_RESERVED;
|
||||
inline void setAddressReserved(const uint64_t value) {
|
||||
TheStructure.Common.Address_Reserved = value >> ADDRESS_RESERVED_BIT_SHIFT;
|
||||
}
|
||||
inline uint64_t getAddressReserved(void) const {
|
||||
return (TheStructure.Common.Address_Reserved << ADDRESS_RESERVED_BIT_SHIFT);
|
||||
}
|
||||
inline void setDataDword0(const uint32_t value) {
|
||||
TheStructure.Common.DataDword0 = value;
|
||||
}
|
||||
inline uint32_t getDataDword0(void) const {
|
||||
return (TheStructure.Common.DataDword0);
|
||||
}
|
||||
inline void setDataDword1(const uint32_t value) {
|
||||
TheStructure.Common.DataDword1 = value;
|
||||
}
|
||||
inline uint32_t getDataDword1(void) const {
|
||||
return (TheStructure.Common.DataDword1);
|
||||
}
|
||||
} MI_STORE_DATA_IMM;
|
||||
STATIC_ASSERT(20 == sizeof(MI_STORE_DATA_IMM));
|
||||
|
||||
typedef struct tagMI_STORE_REGISTER_MEM {
|
||||
union tagTheStructure {
|
||||
struct tagCommon {
|
||||
|
|
|
@ -489,4 +489,105 @@ typedef struct tagMI_SEMAPHORE_WAIT {
|
|||
} MI_SEMAPHORE_WAIT;
|
||||
STATIC_ASSERT(16 == sizeof(MI_SEMAPHORE_WAIT));
|
||||
|
||||
typedef struct tagMI_STORE_DATA_IMM {
|
||||
union tagTheStructure {
|
||||
struct tagCommon {
|
||||
uint32_t DwordLength : BITFIELD_RANGE(0, 9);
|
||||
uint32_t Reserved_10 : BITFIELD_RANGE(10, 20);
|
||||
uint32_t StoreQword : BITFIELD_RANGE(21, 21);
|
||||
uint32_t UseGlobalGtt : BITFIELD_RANGE(22, 22);
|
||||
uint32_t MiCommandOpcode : BITFIELD_RANGE(23, 28);
|
||||
uint32_t CommandType : BITFIELD_RANGE(29, 31);
|
||||
uint64_t CoreModeEnable : BITFIELD_RANGE(0, 0);
|
||||
uint64_t Reserved_33 : BITFIELD_RANGE(1, 1);
|
||||
uint64_t Address_Graphicsaddress47_2 : BITFIELD_RANGE(2, 47);
|
||||
uint64_t Address_Reserved : BITFIELD_RANGE(48, 63);
|
||||
uint32_t DataDword0;
|
||||
uint32_t DataDword1;
|
||||
} Common;
|
||||
uint32_t RawData[5];
|
||||
} TheStructure;
|
||||
typedef enum tagDWORD_LENGTH {
|
||||
DWORD_LENGTH_STORE_DWORD = 0x2,
|
||||
DWORD_LENGTH_STORE_QWORD = 0x3,
|
||||
} DWORD_LENGTH;
|
||||
typedef enum tagMI_COMMAND_OPCODE {
|
||||
MI_COMMAND_OPCODE_MI_STORE_DATA_IMM = 0x20,
|
||||
} MI_COMMAND_OPCODE;
|
||||
typedef enum tagCOMMAND_TYPE {
|
||||
COMMAND_TYPE_MI_COMMAND = 0x0,
|
||||
} COMMAND_TYPE;
|
||||
inline void init(void) {
|
||||
memset(&TheStructure, 0, sizeof(TheStructure));
|
||||
TheStructure.Common.DwordLength = DWORD_LENGTH_STORE_DWORD;
|
||||
TheStructure.Common.MiCommandOpcode = MI_COMMAND_OPCODE_MI_STORE_DATA_IMM;
|
||||
TheStructure.Common.CommandType = COMMAND_TYPE_MI_COMMAND;
|
||||
}
|
||||
static tagMI_STORE_DATA_IMM sInit(void) {
|
||||
MI_STORE_DATA_IMM state;
|
||||
state.init();
|
||||
return state;
|
||||
}
|
||||
inline uint32_t &getRawData(const uint32_t index) {
|
||||
DEBUG_BREAK_IF(index >= 5);
|
||||
return TheStructure.RawData[index];
|
||||
}
|
||||
inline void setDwordLength(const DWORD_LENGTH value) {
|
||||
TheStructure.Common.DwordLength = value;
|
||||
}
|
||||
inline DWORD_LENGTH getDwordLength(void) const {
|
||||
return static_cast<DWORD_LENGTH>(TheStructure.Common.DwordLength);
|
||||
}
|
||||
inline void setStoreQword(const bool value) {
|
||||
TheStructure.Common.StoreQword = value;
|
||||
}
|
||||
inline bool getStoreQword(void) const {
|
||||
return (TheStructure.Common.StoreQword);
|
||||
}
|
||||
inline void setUseGlobalGtt(const bool value) {
|
||||
TheStructure.Common.UseGlobalGtt = value;
|
||||
}
|
||||
inline bool getUseGlobalGtt(void) const {
|
||||
return (TheStructure.Common.UseGlobalGtt);
|
||||
}
|
||||
inline void setCoreModeEnable(const uint64_t value) {
|
||||
TheStructure.Common.CoreModeEnable = value;
|
||||
}
|
||||
inline uint64_t getCoreModeEnable(void) const {
|
||||
return (TheStructure.Common.CoreModeEnable);
|
||||
}
|
||||
typedef enum tagADDRESS_GRAPHICSADDRESS47_2 {
|
||||
ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT = 0x2,
|
||||
ADDRESS_GRAPHICSADDRESS47_2_ALIGN_SIZE = 0x4,
|
||||
} ADDRESS_GRAPHICSADDRESS47_2;
|
||||
inline void setAddress(const uint64_t value) {
|
||||
TheStructure.Common.Address_Graphicsaddress47_2 = value >> ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT;
|
||||
}
|
||||
inline uint64_t getAddress(void) const {
|
||||
return (TheStructure.Common.Address_Graphicsaddress47_2 << ADDRESS_GRAPHICSADDRESS47_2_BIT_SHIFT);
|
||||
}
|
||||
typedef enum tagADDRESS_RESERVED {
|
||||
ADDRESS_RESERVED_BIT_SHIFT = 0x2,
|
||||
ADDRESS_RESERVED_ALIGN_SIZE = 0x4,
|
||||
} ADDRESS_RESERVED;
|
||||
inline void setAddressReserved(const uint64_t value) {
|
||||
TheStructure.Common.Address_Reserved = value >> ADDRESS_RESERVED_BIT_SHIFT;
|
||||
}
|
||||
inline uint64_t getAddressReserved(void) const {
|
||||
return (TheStructure.Common.Address_Reserved << ADDRESS_RESERVED_BIT_SHIFT);
|
||||
}
|
||||
inline void setDataDword0(const uint32_t value) {
|
||||
TheStructure.Common.DataDword0 = value;
|
||||
}
|
||||
inline uint32_t getDataDword0(void) const {
|
||||
return (TheStructure.Common.DataDword0);
|
||||
}
|
||||
inline void setDataDword1(const uint32_t value) {
|
||||
TheStructure.Common.DataDword1 = value;
|
||||
}
|
||||
inline uint32_t getDataDword1(void) const {
|
||||
return (TheStructure.Common.DataDword1);
|
||||
}
|
||||
} MI_STORE_DATA_IMM;
|
||||
STATIC_ASSERT(20 == sizeof(MI_STORE_DATA_IMM));
|
||||
#pragma pack()
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/hw_helper.inl"
|
||||
#include "runtime/helpers/flat_batch_buffer_helper_hw.inl"
|
||||
|
||||
namespace OCLRT {
|
||||
typedef SKLFamily Family;
|
||||
|
@ -46,4 +47,5 @@ SipKernelType HwHelperHw<Family>::getSipKernelType(bool debuggingActive) {
|
|||
}
|
||||
|
||||
template class HwHelperHw<Family>;
|
||||
template class FlatBatchBufferHelperHw<Family>;
|
||||
} // namespace OCLRT
|
||||
|
|
|
@ -33,8 +33,6 @@ class FlatBatchBufferHelperHw : public FlatBatchBufferHelper {
|
|||
GraphicsAllocation *flattenBatchBuffer(BatchBuffer &batchBuffer, size_t &sizeBatchBuffer, DispatchMode dispatchMode) override;
|
||||
char *getIndirectPatchCommands(size_t &indirectPatchCommandsSize, std::vector<PatchInfoData> &indirectPatchInfo) override;
|
||||
void removePipeControlData(size_t pipeControlLocationSize, void *pipeControlForNooping) override;
|
||||
static void sdiSetAddress(typename GfxFamily::MI_STORE_DATA_IMM *sdiCommand, uint64_t address);
|
||||
static void sdiSetStoreQword(typename GfxFamily::MI_STORE_DATA_IMM *sdiCommand, bool setQword);
|
||||
};
|
||||
|
||||
} // namespace OCLRT
|
||||
} // namespace OCLRT
|
||||
|
|
|
@ -176,8 +176,8 @@ char *FlatBatchBufferHelperHw<GfxFamily>::getIndirectPatchCommands(size_t &indir
|
|||
if (patchInfoData.requiresIndirectPatching()) {
|
||||
auto storeDataImmediate = indirectPatchCommandStream.getSpaceForCmd<MI_STORE_DATA_IMM>();
|
||||
storeDataImmediate->init();
|
||||
sdiSetAddress(storeDataImmediate, patchInfoData.targetAllocation + patchInfoData.targetAllocationOffset);
|
||||
sdiSetStoreQword(storeDataImmediate, patchInfoData.patchAddressSize != sizeof(uint32_t));
|
||||
storeDataImmediate->setAddress(patchInfoData.targetAllocation + patchInfoData.targetAllocationOffset);
|
||||
storeDataImmediate->setStoreQword(patchInfoData.patchAddressSize != sizeof(uint32_t));
|
||||
storeDataImmediate->setDataDword0(static_cast<uint32_t>((patchInfoData.sourceAllocation + patchInfoData.sourceAllocationOffset) & 0x0000FFFFFFFFULL));
|
||||
storeDataImmediate->setDataDword1(static_cast<uint32_t>((patchInfoData.sourceAllocation + patchInfoData.sourceAllocationOffset) >> 32));
|
||||
|
||||
|
|
|
@ -1700,19 +1700,6 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAddBatc
|
|||
EXPECT_EQ(0xA000u, addr.second);
|
||||
}
|
||||
|
||||
HWTEST_F(AubCommandStreamReceiverTests, givenFlatBatchBufferHelperWhenSettingSroreQwordOnSDICommandThenAppropriateBitIsSet) {
|
||||
typedef typename FamilyType::MI_STORE_DATA_IMM MI_STORE_DATA_IMM;
|
||||
|
||||
std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr(new AUBCommandStreamReceiverHw<FamilyType>(*platformDevices[0], "", true, *pDevice->executionEnvironment));
|
||||
|
||||
MI_STORE_DATA_IMM cmd;
|
||||
cmd.init();
|
||||
FlatBatchBufferHelperHw<FamilyType>::sdiSetStoreQword(&cmd, false);
|
||||
EXPECT_EQ(0u, static_cast<uint32_t>(cmd.getStoreQword()));
|
||||
FlatBatchBufferHelperHw<FamilyType>::sdiSetStoreQword(&cmd, true);
|
||||
EXPECT_EQ(1u, static_cast<uint32_t>(cmd.getStoreQword()));
|
||||
}
|
||||
|
||||
class OsAgnosticMemoryManagerForImagesWithNoHostPtr : public OsAgnosticMemoryManager {
|
||||
public:
|
||||
GraphicsAllocation *allocateGraphicsMemoryForImage(ImageInfo &imgInfo, Gmm *gmm) override {
|
||||
|
|
|
@ -48,6 +48,7 @@ using MI_MATH = GEN10::MI_MATH;
|
|||
using GPGPU_CSR_BASE_ADDRESS = GEN10::GPGPU_CSR_BASE_ADDRESS;
|
||||
using STATE_SIP = GEN10::STATE_SIP;
|
||||
using MI_SEMAPHORE_WAIT = GEN10::MI_SEMAPHORE_WAIT;
|
||||
using MI_STORE_DATA_IMM = GEN10::MI_STORE_DATA_IMM;
|
||||
// clang-format on
|
||||
|
||||
template <>
|
||||
|
@ -278,6 +279,16 @@ MI_SEMAPHORE_WAIT *genCmdCast<MI_SEMAPHORE_WAIT *>(void *buffer) {
|
|||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_STORE_DATA_IMM *genCmdCast<MI_STORE_DATA_IMM *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_STORE_DATA_IMM *>(buffer);
|
||||
|
||||
return MI_STORE_DATA_IMM::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_STORE_DATA_IMM::MI_COMMAND_OPCODE_MI_STORE_DATA_IMM == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
size_t CnlParse::getCommandLength(void *cmd) {
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_BASE_ADDRESS *>(cmd);
|
||||
|
@ -384,6 +395,11 @@ size_t CnlParse::getCommandLength(void *cmd) {
|
|||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_STORE_DATA_IMM *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ using MI_REPORT_PERF_COUNT = GEN8::MI_REPORT_PERF_COUNT;
|
|||
using MI_MATH = GEN8::MI_MATH;
|
||||
using MI_LOAD_REGISTER_REG = GEN8::MI_LOAD_REGISTER_REG;
|
||||
using MI_SEMAPHORE_WAIT = GEN8::MI_SEMAPHORE_WAIT;
|
||||
using MI_STORE_DATA_IMM = GEN8::MI_STORE_DATA_IMM;
|
||||
// clang-format on
|
||||
|
||||
template <>
|
||||
|
@ -252,6 +253,16 @@ MI_SEMAPHORE_WAIT *genCmdCast<MI_SEMAPHORE_WAIT *>(void *buffer) {
|
|||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_STORE_DATA_IMM *genCmdCast<MI_STORE_DATA_IMM *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_STORE_DATA_IMM *>(buffer);
|
||||
|
||||
return MI_STORE_DATA_IMM::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_STORE_DATA_IMM::MI_COMMAND_OPCODE_MI_STORE_DATA_IMM == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
size_t BdwParse::getCommandLength(void *cmd) {
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_BASE_ADDRESS *>(cmd);
|
||||
|
@ -348,6 +359,11 @@ size_t BdwParse::getCommandLength(void *cmd) {
|
|||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_STORE_DATA_IMM *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ using MI_LOAD_REGISTER_REG = GEN9::MI_LOAD_REGISTER_REG;
|
|||
using GPGPU_CSR_BASE_ADDRESS = GEN9::GPGPU_CSR_BASE_ADDRESS;
|
||||
using STATE_SIP = GEN9::STATE_SIP;
|
||||
using MI_SEMAPHORE_WAIT = GEN9::MI_SEMAPHORE_WAIT;
|
||||
using MI_STORE_DATA_IMM = GEN9::MI_STORE_DATA_IMM;
|
||||
// clang-format on
|
||||
|
||||
template <>
|
||||
|
@ -278,6 +279,16 @@ MI_SEMAPHORE_WAIT *genCmdCast<MI_SEMAPHORE_WAIT *>(void *buffer) {
|
|||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_STORE_DATA_IMM *genCmdCast<MI_STORE_DATA_IMM *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_STORE_DATA_IMM *>(buffer);
|
||||
|
||||
return MI_STORE_DATA_IMM::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_STORE_DATA_IMM::MI_COMMAND_OPCODE_MI_STORE_DATA_IMM == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
size_t SklParse::getCommandLength(void *cmd) {
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_BASE_ADDRESS *>(cmd);
|
||||
|
@ -384,6 +395,11 @@ size_t SklParse::getCommandLength(void *cmd) {
|
|||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_STORE_DATA_IMM *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue