| 1 |
/*===================== begin_copyright_notice ================================== |
| 2 |
|
| 3 |
# Copyright (c) 2023-2026, Intel Corporation |
| 4 |
|
| 5 |
# Permission is hereby granted, free of charge, to any person obtaining a |
| 6 |
# copy of this software and associated documentation files (the "Software"), |
| 7 |
# to deal in the Software without restriction, including without limitation |
| 8 |
# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 9 |
# and/or sell copies of the Software, and to permit persons to whom the |
| 10 |
# Software is furnished to do so, subject to the following conditions: |
| 11 |
|
| 12 |
# The above copyright notice and this permission notice shall be included |
| 13 |
# in all copies or substantial portions of the Software. |
| 14 |
|
| 15 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 16 |
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 18 |
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 19 |
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 20 |
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 21 |
# OTHER DEALINGS IN THE SOFTWARE. |
| 22 |
|
| 23 |
======================= end_copyright_notice ==================================*/ |
| 24 |
//! |
| 25 |
//! \file mhw_vdbox_huc_ppgtt_impl.h |
| 26 |
//! \brief MHW VDBOX HUC PPGTT interface common base for Xe3P_plus+ platforms |
| 27 |
//! \details |
| 28 |
//! |
| 29 |
|
| 30 |
#ifndef __MHW_VDBOX_HUC_PPGTT_IMPL_H__ |
| 31 |
#define __MHW_VDBOX_HUC_PPGTT_IMPL_H__ |
| 32 |
|
| 33 |
#include "mhw_vdbox_huc_impl.h" |
| 34 |
#include "mhw_vdbox_huc_ppgtt_itf.h" |
| 35 |
|
| 36 |
namespace mhw |
| 37 |
{ |
| 38 |
namespace vdbox |
| 39 |
{ |
| 40 |
namespace huc |
| 41 |
{ |
| 42 |
template <typename cmd_t> |
| 43 |
class ImplPPGTT: public ItfPPGTT, public huc::Impl<cmd_t> |
| 44 |
{ |
| 45 |
_HUC_PPGTT_CMD_DEF(_MHW_CMD_ALL_DEF_FOR_IMPL); |
| 46 |
|
| 47 |
protected: |
| 48 |
using base_t = ItfPPGTT; |
| 49 |
|
| 50 |
ImplPPGTT(PMOS_INTERFACE osItf, MhwCpInterface *cpItf) : huc::Impl<cmd_t>(osItf, cpItf) {}; |
| 51 |
|
| 52 |
_MHW_SETCMD_OVERRIDE_DECL(HUC_IMEM_ADDR) |
| 53 |
{ |
| 54 |
MHW_FUNCTION_ENTER; |
| 55 |
|
| 56 |
_MHW_SETCMD_CALLBASE(HUC_IMEM_ADDR); |
| 57 |
|
| 58 |
MHW_RESOURCE_PARAMS resourceParams = {}; |
| 59 |
|
| 60 |
resourceParams.dwLsbNum = MHW_VDBOX_HUC_GENERAL_STATE_SHIFT; |
| 61 |
resourceParams.HwCommandType = MOS_HUC_DMEM; |
| 62 |
|
| 63 |
if (!Mos_ResourceIsNull(params.kernelBinBuffer)) |
| 64 |
{ |
| 65 |
resourceParams.presResource = params.kernelBinBuffer; |
| 66 |
resourceParams.dwOffset = params.kernelbinOffset; |
| 67 |
resourceParams.pdwCmd = cmd.HucPpgttAddress.DW0_1.Value; |
| 68 |
resourceParams.dwLocationInCmd = 1; |
| 69 |
resourceParams.bIsWritable = false; |
| 70 |
resourceParams.dwSize = params.kernelBinSize; |
| 71 |
|
| 72 |
InitMocsParams(resourceParams, &cmd.MemoryAddressAttributes.DW0.Value, 1, 6); |
| 73 |
|
| 74 |
MHW_MI_CHK_STATUS(this->AddResourceToCmd( |
| 75 |
this->m_osItf, |
| 76 |
this->m_currentCmdBuf, |
| 77 |
&resourceParams)); |
| 78 |
} |
| 79 |
|
| 80 |
#define DO_FIELDS() \ |
| 81 |
DO_FIELD(DW4, IntegrityEnabledBit, params.integrityEnable ? 1 : 0); |
| 82 |
|
| 83 |
#include "mhw_hwcmd_process_cmdfields.h" |
| 84 |
} |
| 85 |
|
| 86 |
MEDIA_CLASS_DEFINE_END(mhw__vdbox__huc__ImplPPGTT) |
| 87 |
}; |
| 88 |
} // namespace huc |
| 89 |
} // namespace vdbox |
| 90 |
} // namespace mhw |
| 91 |
|
| 92 |
#endif // __MHW_VDBOX_HUC_PPGTT_IMPL_H__ |