55 *
66 */
77
8+ #include " runtime/helpers/hw_helper.h"
89#include " runtime/helpers/preamble_base.inl"
910
1011namespace NEO {
@@ -25,21 +26,27 @@ uint32_t PreambleHelper<GfxFamily>::getUrbEntryAllocationSize() {
2526
2627template <typename GfxFamily>
2728void PreambleHelper<GfxFamily>::programVFEState(LinearStream *pCommandStream, const HardwareInfo &hwInfo, int scratchSize, uint64_t scratchAddress) {
28- typedef typename GfxFamily::MEDIA_VFE_STATE MEDIA_VFE_STATE;
29+ using MEDIA_VFE_STATE = typename GfxFamily::MEDIA_VFE_STATE;
2930
3031 addPipeControlBeforeVfeCmd (pCommandStream, &hwInfo);
3132
32- auto pMediaVfeState = ( MEDIA_VFE_STATE *) pCommandStream->getSpace (sizeof (MEDIA_VFE_STATE));
33+ auto pMediaVfeState = reinterpret_cast < MEDIA_VFE_STATE *>( pCommandStream->getSpace (sizeof (MEDIA_VFE_STATE) ));
3334 *pMediaVfeState = GfxFamily::cmdInitMediaVfeState;
34- pMediaVfeState->setMaximumNumberOfThreads (PreambleHelper<GfxFamily> ::getMaxThreadsForVfe (hwInfo));
35+ pMediaVfeState->setMaximumNumberOfThreads (HwHelper ::getMaxThreadsForVfe (hwInfo));
3536 pMediaVfeState->setNumberOfUrbEntries (1 );
3637 pMediaVfeState->setUrbEntryAllocationSize (PreambleHelper<GfxFamily>::getUrbEntryAllocationSize ());
3738 pMediaVfeState->setPerThreadScratchSpace (Kernel::getScratchSizeValueToProgramMediaVfeState (scratchSize));
3839 pMediaVfeState->setStackSize (Kernel::getScratchSizeValueToProgramMediaVfeState (scratchSize));
39- uint32_t lowAddress = uint32_t (0xFFFFFFFF & scratchAddress);
40- uint32_t highAddress = uint32_t (0xFFFFFFFF & (scratchAddress >> 32 ));
40+ uint32_t lowAddress = static_cast < uint32_t > (0xFFFFFFFF & scratchAddress);
41+ uint32_t highAddress = static_cast < uint32_t > (0xFFFFFFFF & (scratchAddress >> 32 ));
4142 pMediaVfeState->setScratchSpaceBasePointer (lowAddress);
4243 pMediaVfeState->setScratchSpaceBasePointerHigh (highAddress);
4344}
4445
46+ template <typename GfxFamily>
47+ size_t PreambleHelper<GfxFamily>::getVFECommandsSize() {
48+ using MEDIA_VFE_STATE = typename GfxFamily::MEDIA_VFE_STATE;
49+ return sizeof (MEDIA_VFE_STATE) + sizeof (PIPE_CONTROL);
50+ }
51+
4552} // namespace NEO
0 commit comments