| 1 |
/* |
| 2 |
* Copyright (c) 2022, 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 mhw_blt_legacy.h |
| 24 |
//! \brief MHW interface for constructing commands for the BLT |
| 25 |
//! |
| 26 |
#ifndef __MHW_BLT_LEGACY_H__ |
| 27 |
#define __MHW_BLT_LEGACY_H__ |
| 28 |
|
| 29 |
#include "mhw_blt.h" |
| 30 |
|
| 31 |
class MhwBltInterface |
| 32 |
{ |
| 33 |
public: |
| 34 |
MhwBltInterface(PMOS_INTERFACE pOsInterface); |
| 35 |
|
| 36 |
virtual ~MhwBltInterface() |
| 37 |
{ |
| 38 |
MHW_FUNCTION_ENTER; |
| 39 |
} |
| 40 |
|
| 41 |
//! |
| 42 |
//! \brief Add fast copy blt |
| 43 |
//! \details MHW function to add fast copy blt command |
| 44 |
//! \param [in] pCmdBuffer |
| 45 |
//! Pointer to Command buffer |
| 46 |
//! \param [in] pFastCopyBltParam |
| 47 |
//! Pointer to MHW_FAST_COPY_BLT_PARAM |
| 48 |
//! \param [in] srcOffset |
| 49 |
//! input surface's soruce offset |
| 50 |
//! \param [in] outOffset |
| 51 |
//! output surface's soruce offset |
| 52 |
//! \return MOS_STATUS |
| 53 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 54 |
//! |
| 55 |
virtual MOS_STATUS AddFastCopyBlt( |
| 56 |
PMOS_COMMAND_BUFFER pCmdBuffer, |
| 57 |
PMHW_FAST_COPY_BLT_PARAM pFastCopyBltParam, |
| 58 |
uint32_t srcOffset, |
| 59 |
uint32_t dstOffset); |
| 60 |
|
| 61 |
//! |
| 62 |
//! \brief Add Block copy |
| 63 |
//! \details MHW function to add block copy command |
| 64 |
//! \param [in] pCmdBuffer |
| 65 |
//! Pointer to Command buffer |
| 66 |
//! \param [in] pFastCopyBltParam |
| 67 |
//! Pointer to MHW_FAST_COPY_BLT_PARAM |
| 68 |
//! \param [in] srcOffset |
| 69 |
//! input surface's soruce offset |
| 70 |
//! \param [in] outOffset |
| 71 |
//! output surface's soruce offset |
| 72 |
//! \return MOS_STATUS |
| 73 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 74 |
//! |
| 75 |
virtual MOS_STATUS AddBlockCopyBlt( |
| 76 |
PMOS_COMMAND_BUFFER pCmdBuffer, |
| 77 |
PMHW_FAST_COPY_BLT_PARAM pFastCopyBltParam, |
| 78 |
uint32_t srcOffset, |
| 79 |
uint32_t dstOffset); |
| 80 |
|
| 81 |
MOS_STATUS (*pfnAddResourceToCmd)( |
| 82 |
PMOS_INTERFACE pOsInterface, |
| 83 |
PMOS_COMMAND_BUFFER pCmdBuffer, |
| 84 |
PMHW_RESOURCE_PARAMS pParams); |
| 85 |
|
| 86 |
//! |
| 87 |
//! \brief Get fastcopy tilling mode |
| 88 |
//! \details Get fastcopy tilling mode |
| 89 |
//! \param [in] TileType |
| 90 |
//! Pointer to BLT_TILE_TYPE |
| 91 |
//! \return uint32_t |
| 92 |
//! 0:1:2:3 |
| 93 |
//! |
| 94 |
virtual uint32_t GetFastTilingMode( |
| 95 |
BLT_TILE_TYPE TileType); |
| 96 |
|
| 97 |
virtual std::shared_ptr<void> GetNewBltInterface() { return nullptr; } |
| 98 |
|
| 99 |
public: |
| 100 |
PMOS_INTERFACE m_osInterface = nullptr; |
| 101 |
std::shared_ptr<void> m_bltItfNew = nullptr; |
| 102 |
}; |
| 103 |
|
| 104 |
typedef class MhwBltInterface *PMHW_BLT_INTERFACE; |
| 105 |
|
| 106 |
#endif // __MHW_BLT_LEGACY_H__ |