2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2020-02-17 12:45:24 +01:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-08-26 22:36:51 +02:00
|
|
|
#include "shared/source/gen8/aub_mapper.h"
|
2020-04-02 11:28:38 +02:00
|
|
|
#include "shared/source/helpers/constants.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/flat_batch_buffer_helper_hw.inl"
|
|
|
|
|
#include "shared/source/helpers/hw_helper_bdw_plus.inl"
|
2020-02-24 10:22:30 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2017-12-21 00:45:38 +01:00
|
|
|
typedef BDWFamily Family;
|
|
|
|
|
|
2020-06-08 21:49:11 +02:00
|
|
|
static uint32_t slmSizeId[] = {0, 1, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16};
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
uint32_t HwHelperHw<Family>::alignSlmSize(uint32_t slmSize) {
|
|
|
|
|
if (slmSize == 0u) {
|
|
|
|
|
return 0u;
|
|
|
|
|
}
|
|
|
|
|
slmSize = std::max(slmSize, 4096u);
|
|
|
|
|
slmSize = Math::nextPowerOfTwo(slmSize);
|
|
|
|
|
return slmSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
uint32_t HwHelperHw<Family>::computeSlmValues(uint32_t slmSize) {
|
|
|
|
|
slmSize += (4 * KB - 1);
|
|
|
|
|
slmSize = slmSize >> 12;
|
|
|
|
|
slmSize = std::min(slmSize, 15u);
|
|
|
|
|
slmSize = slmSizeId[slmSize];
|
|
|
|
|
return slmSize;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
template <>
|
|
|
|
|
size_t HwHelperHw<Family>::getMaxBarrierRegisterPerSlice() const {
|
|
|
|
|
return 16;
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-19 09:50:17 +01:00
|
|
|
template <>
|
2018-08-23 17:42:35 +02:00
|
|
|
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) {
|
2018-02-19 09:50:17 +01:00
|
|
|
caps->image3DMaxHeight = 2048;
|
|
|
|
|
caps->image3DMaxWidth = 2048;
|
2018-06-08 16:42:29 +02:00
|
|
|
caps->maxMemAllocSize = 2 * MemoryConstants::gigaByte - 8 * MemoryConstants::megaByte;
|
2018-07-10 13:22:11 +02:00
|
|
|
caps->isStatelesToStatefullWithOffsetSupported = false;
|
2018-02-19 09:50:17 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-28 14:15:51 +01:00
|
|
|
template <>
|
2020-04-26 21:48:59 +02:00
|
|
|
void MemorySynchronizationCommands<Family>::addPipeControl(LinearStream &commandStream, PipeControlArgs &args) {
|
2020-04-08 18:33:03 +02:00
|
|
|
Family::PIPE_CONTROL cmd = Family::cmdInitPipeControl;
|
2020-04-26 21:48:59 +02:00
|
|
|
args.dcFlushEnable = true;
|
|
|
|
|
MemorySynchronizationCommands<Family>::setPipeControl(cmd, args);
|
2020-04-08 18:33:03 +02:00
|
|
|
Family::PIPE_CONTROL *cmdBuffer = commandStream.getSpaceForCmd<Family::PIPE_CONTROL>();
|
|
|
|
|
*cmdBuffer = cmd;
|
2019-03-28 14:15:51 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-06 09:34:15 +02:00
|
|
|
template <>
|
|
|
|
|
void MemorySynchronizationCommands<Family>::addPipeControlWithCSStallOnly(LinearStream &commandStream, PipeControlArgs &args) {
|
|
|
|
|
using PIPE_CONTROL = typename Family::PIPE_CONTROL;
|
|
|
|
|
PIPE_CONTROL cmd = Family::cmdInitPipeControl;
|
|
|
|
|
cmd.setCommandStreamerStallEnable(true);
|
|
|
|
|
cmd.setDcFlushEnable(true);
|
|
|
|
|
auto pipeControl = commandStream.getSpaceForCmd<PIPE_CONTROL>();
|
|
|
|
|
*pipeControl = cmd;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-21 16:54:19 +01:00
|
|
|
template class HwHelperHw<Family>;
|
2018-09-04 11:25:54 +02:00
|
|
|
template class FlatBatchBufferHelperHw<Family>;
|
2020-02-17 12:45:24 +01:00
|
|
|
template struct MemorySynchronizationCommands<Family>;
|
2020-04-28 16:48:23 +02:00
|
|
|
template struct LriHelper<Family>;
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|