1 /* 2 * Copyright (c) 2020, Intel Corporation 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included 12 * in all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 * OTHER DEALINGS IN THE SOFTWARE. 21 */ 22 //! 23 //! \file null_hardware.h 24 //! \brief Defines interfaces for null hardware. 25 26 27 #ifndef __NULL_HARDWARE_H__ 28 #define __NULL_HARDWARE_H__ 29 30 #include "mos_os_specific.h" 31 32 class MhwMiInterface; 33 class NullHW 34 { 35 public: 36 NullHW() = delete; 37 ~NullHW() = delete; 38 39 //! 40 //! \brief Start predicate. 41 //! \details Add predicate command to skip the following commands with NOOP. 42 //! \param [in] miInterface 43 //! Pointer to MhwMiInterface. 44 //! \param [out] cmdBuffer 45 //! command buffer for adding predicate command. 46 //! \return MOS_STATUS 47 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed 48 //! 49 static MOS_STATUS StartPredicate(PMOS_INTERFACE pOsInterface, MhwMiInterface* miInterface, PMOS_COMMAND_BUFFER cmdBuffer); 50 51 //! 52 //! \brief Start predicate. - Refactor Version 53 //! \details Add predicate command to skip the following commands with NOOP. 54 //! \param [in] miInterface 55 //! Pointer to MhwMiInterface. 56 //! \param [out] cmdBuffer 57 //! command buffer for adding predicate command. 58 //! \return MOS_STATUS 59 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed 60 //! 61 static MOS_STATUS StartPredicateNext(PMOS_INTERFACE pOsInterface, std::shared_ptr<void> pMiItf, PMOS_COMMAND_BUFFER cmdBuffer); 62 63 //! 64 //! \brief Stop predicate. 65 //! \details Add predicate command to resume to normal commands execution. 66 //! \param [in] miInterface 67 //! Pointer to MhwMiInterface. 68 //! \param [out] cmdBuffer 69 //! command buffer for adding predicate command. 70 //! \return MOS_STATUS 71 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed 72 //! 73 static MOS_STATUS StopPredicate(PMOS_INTERFACE pOsInterface, MhwMiInterface* miInterface, PMOS_COMMAND_BUFFER cmdBuffer); 74 75 //! 76 //! \brief Stop predicate. - Refactor 77 //! \details Add predicate command to resume to normal commands execution. 78 //! \param [in] miInterface 79 //! Pointer to MhwMiInterface. 80 //! \param [out] cmdBuffer 81 //! command buffer for adding predicate command. 82 //! \return MOS_STATUS 83 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed 84 //! 85 static MOS_STATUS StopPredicateNext(PMOS_INTERFACE pOsInterface, std::shared_ptr<void> pMiItf, PMOS_COMMAND_BUFFER cmdBuffer); 86 87 //! 88 //! \brief Overwrite status report. 89 //! \details Overwrite the status of status report and bit-stream size. 90 //! \param [out] status 91 //! Status of status report. 92 //! \param [out] streamSize 93 //! The size of bit-stream. 94 //! \return void 95 //! 96 static void StatusReport(PMOS_INTERFACE pOsInterface, uint32_t &status, uint32_t &streamSize); 97 }; 98 #endif