2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2020-02-22 16:28:27 +08:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-10-02 03:08:46 +08:00
|
|
|
#include "shared/source/command_container/command_encoder.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/gen8/hw_cmds.h"
|
2020-10-14 20:04:29 +08:00
|
|
|
#include "shared/source/helpers/populate_factory.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/device_queue/device_queue_hw.h"
|
|
|
|
#include "opencl/source/device_queue/device_queue_hw_bdw_plus.inl"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
typedef BDWFamily Family;
|
|
|
|
static auto gfxCore = IGFX_GEN8_CORE;
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void populateFactoryTable<DeviceQueueHw<Family>>() {
|
|
|
|
extern DeviceQueueCreateFunc deviceQueueFactory[IGFX_MAX_CORE];
|
|
|
|
deviceQueueFactory[gfxCore] = DeviceQueueHw<Family>::create;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
size_t DeviceQueueHw<Family>::getWaCommandsSize() {
|
|
|
|
return sizeof(Family::MI_ATOMIC) +
|
|
|
|
sizeof(Family::MI_LOAD_REGISTER_IMM) +
|
|
|
|
sizeof(Family::MI_LOAD_REGISTER_IMM);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void DeviceQueueHw<Family>::addArbCheckCmdWa() {}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void DeviceQueueHw<Family>::addMiAtomicCmdWa(uint64_t atomicOpPlaceholder) {
|
2020-10-02 03:08:46 +08:00
|
|
|
EncodeAtomic<Family>::programMiAtomic(slbCS,
|
|
|
|
atomicOpPlaceholder,
|
|
|
|
Family::MI_ATOMIC::ATOMIC_OPCODES::ATOMIC_8B_INCREMENT,
|
|
|
|
Family::MI_ATOMIC::DATA_SIZE::DATA_SIZE_QWORD,
|
|
|
|
0x1u, 0x1u);
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void DeviceQueueHw<Family>::addLriCmdWa(bool setArbCheck) {
|
2020-10-06 16:58:18 +08:00
|
|
|
// CTXT_PREMP_DBG offset
|
|
|
|
constexpr uint32_t registerAddress = 0x2248u;
|
|
|
|
uint32_t value = 0u;
|
|
|
|
if (setArbCheck) {
|
|
|
|
// set only bit 8 (Preempt On MI_ARB_CHK Only)
|
|
|
|
value = 0x00000100;
|
|
|
|
}
|
|
|
|
|
|
|
|
LriHelper<Family>::program(&slbCS,
|
|
|
|
registerAddress,
|
|
|
|
value,
|
|
|
|
false);
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void DeviceQueueHw<Family>::addPipeControlCmdWa(bool isNoopCmd) {}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void DeviceQueueHw<Family>::addProfilingEndCmds(uint64_t timestampAddress) {
|
|
|
|
auto pPipeControlCmd = (PIPE_CONTROL *)slbCS.getSpace(sizeof(PIPE_CONTROL));
|
2019-01-18 00:10:12 +08:00
|
|
|
*pPipeControlCmd = Family::cmdInitPipeControl;
|
2017-12-21 07:45:38 +08:00
|
|
|
pPipeControlCmd->setCommandStreamerStallEnable(true);
|
|
|
|
pPipeControlCmd->setPostSyncOperation(PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_TIMESTAMP);
|
|
|
|
pPipeControlCmd->setAddressHigh(timestampAddress >> 32);
|
|
|
|
pPipeControlCmd->setAddress(timestampAddress & (0xffffffff));
|
|
|
|
}
|
|
|
|
|
2018-05-30 22:13:53 +08:00
|
|
|
template <>
|
|
|
|
void DeviceQueueHw<Family>::addDcFlushToPipeControlWa(PIPE_CONTROL *pc) {
|
|
|
|
pc->setDcFlushEnable(true);
|
|
|
|
}
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
template class DeviceQueueHw<Family>;
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|