Skip to content

Commit

Permalink
[VP] Legacy mos support for scalability
Browse files Browse the repository at this point in the history
Legacy MOS Support Enabled for scalability.
  • Loading branch information
sudhanshusemwal authored and intel-mediadev committed Nov 22, 2024
1 parent ab45550 commit 699dcd8
Show file tree
Hide file tree
Showing 4 changed files with 249 additions and 213 deletions.
169 changes: 0 additions & 169 deletions media_driver/agnostic/common/os/mos_os_virtualengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,175 +30,6 @@
#include "mos_os_virtualengine_specific.h"
#include "mos_os_virtualengine_next.h"

class MosVeInterface;
typedef struct _MOS_VIRTUALENGINE_INTERFACE
{
MosVeInterface *veInterface;

bool bScalabilitySupported;
PMOS_INTERFACE pOsInterface;
#if (_DEBUG || _RELEASE_INTERNAL)
uint8_t EngineLogicId[MOS_MAX_ENGINE_INSTANCE_PER_CLASS];
uint8_t ucEngineCount;
#endif
uint8_t ucMaxNumPipesInUse;
uint8_t ucNumOfSdryCmdBufInCurFrm; //!< number of secondary cmd buffers for current frame
uint32_t dwSdryCmdBufSize; //!< secondary cmd buffer size for current frame
uint8_t ucMaxNumOfSdryCmdBufInOneFrame;
uint32_t dwTotalNumOfSdryCmdBufs;
uint8_t ucNumOfSdryCmdBufSets;
uint8_t ucSdryCmdbufPoolIndx;
bool *pbSdryCmdBufPrepared;
PMOS_COMMAND_BUFFER pSecondryCmdBufPool;
MOS_VIRTUALENGINE_HINT_PARAMS ScalabilityHintParams;
MOS_VIRTUALENGINE_HINT_PARAMS SinglePipeHintParams;

//!
//! \brief check if scalability is supported
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [out] pbScalabilitySupported
//! pointer to a bool value
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEIsScalabilitySupported)(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
bool *pbScalabilitySupported);

//!
//! \brief Reset secondary cmd buffer state
//! \details Reset secondary cmd buffer state in scalability virtual engine interface
//! \param [in] pVEInterface
//! virtual engine interface
//! \return void
//!
void (*pfnVEResetSecdryCmdBufStates)(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface);

//!
//! \brief Verify secondary cmd buffer size
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] dwNewRequestSize
//! new request cmd buffer size
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEVerifySecdryCmdBufSize)(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
uint32_t dwNewRequestSize);

//!
//! \brief resize secondary cmd buffer
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] dwNewRequestSize
//! new request cmd buffer size
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEResizeSecdryCmdBuf)(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
uint32_t dwNewRequestSize);

//!
//! \brief get secondary cmd buffer
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] pScdryCmdBuf
//! pointer to secondry cmd buffer
//! \param [in] dwBufIdxPlus1
//! secondary cmd buffer index plus 1
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEGetSecdryCmdBuf)(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
PMOS_COMMAND_BUFFER pScdryCmdBuf,
uint32_t dwBufIdxPlus1);

//!
//! \brief return secondary cmd buffer
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] pScdryCmdBuf
//! pointer to secondry cmd buffer address
//! \param [in] dwBufIdxPlus1
//! secondary cmd buffer index plus 1
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEReturnSecdryCmdBuf)(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
PMOS_COMMAND_BUFFER pScdryCmdBuf,
uint32_t dwBufIdxPlus1);

//!
//! \brief done virtual engine secondary command buffers
//! \details UnLock virtual engine secondary command buffers
//! \param [in] pVEInterface
//! virtual engine interface
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEDoneSecdryCmdBuf)(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface);

//!
//! \brief set hint parameters
//! \details set hint parameters for virtual engine scalability or single pipe mode
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] pVEParams
//! pointer to VE parameter data structure
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVESetHintParams) (
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
PMOS_VIRTUALENGINE_SET_PARAMS pVEParams);

//!
//! \brief get hint parameters
//! \details get hint parameters for virtual engine scalability or single pipe mode
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] bScalableMode
//! flag to indicate if scalability mode
//! \param [in] ppHintParams
//! pointer to VE hint parameter address
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEGetHintParams)(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
bool bScalableMode,
PMOS_VIRTUALENGINE_HINT_PARAMS *ppHintParams);

//!
//! \brief check hint parameters
//! \details check hint parameters for virtual engine scalability or single pipe mode
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] ppHintParams
//! pointer to VE hint parameter address
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVECheckHintParamsValidity) (
PMOS_VIRTUALENGINE_INTERFACE pVEInterface);

//!
//! \brief Destroy resources for virtual engine scalability
//! \param [in] pVEInterface
//! virtual engine interface
//! \return void
//!
void (* pfnVEDestroy)(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface);
}MOS_VIRTUALENGINE_INTERFACE, *PMOS_VIRTUALENGINE_INTERFACE;

//!
//! \brief initialize virtual engine interface
//! \details initialize virtual engine interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,6 @@ MOS_STATUS VpScalabilityMultiPipe::Destroy()

SCALABILITY_CHK_STATUS_RETURN(VpScalabilityMultiPipeNext::Destroy());

if (m_veInterface)
{
if (m_veInterface->pfnVEDestroy)
{
m_veInterface->pfnVEDestroy(m_veInterface);
}
MOS_FreeMemAndSetNull(m_veInterface);
}
else
{
if (!m_osInterface->apoMosEnabled)
{
// For VE not enabled/supported case, such as vp vebox on some platform, m_veInterface is nullptr.
// MOS_STATUS_SUCCESS should be returned for such case.
if (MOS_VE_SUPPORTED(m_osInterface))
{
SCALABILITY_CHK_NULL_RETURN(m_veInterface);
}
}
}

return MOS_STATUS_SUCCESS;
}

Expand Down
177 changes: 177 additions & 0 deletions media_softlet/agnostic/common/os/mos_os_virtualengine_next.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,5 +251,182 @@ class MosVeInterface
MEDIA_CLASS_DEFINE_END(MosVeInterface)
};

typedef struct _MOS_VIRTUALENGINE_INTERFACE
{
MosVeInterface *veInterface;

bool bScalabilitySupported;
PMOS_INTERFACE pOsInterface;
#if (_DEBUG || _RELEASE_INTERNAL)
uint8_t EngineLogicId[MOS_MAX_ENGINE_INSTANCE_PER_CLASS];
uint8_t ucEngineCount;
#endif
uint8_t ucMaxNumPipesInUse;
uint8_t ucNumOfSdryCmdBufInCurFrm; //!< number of secondary cmd buffers for current frame
uint32_t dwSdryCmdBufSize; //!< secondary cmd buffer size for current frame
uint8_t ucMaxNumOfSdryCmdBufInOneFrame;
uint32_t dwTotalNumOfSdryCmdBufs;
uint8_t ucNumOfSdryCmdBufSets;
uint8_t ucSdryCmdbufPoolIndx;
bool *pbSdryCmdBufPrepared;
PMOS_COMMAND_BUFFER pSecondryCmdBufPool;
MOS_VIRTUALENGINE_HINT_PARAMS ScalabilityHintParams;
MOS_VIRTUALENGINE_HINT_PARAMS SinglePipeHintParams;

//!
//! \brief check if scalability is supported
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [out] pbScalabilitySupported
//! pointer to a bool value
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEIsScalabilitySupported)
(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
bool *pbScalabilitySupported);

//!
//! \brief Reset secondary cmd buffer state
//! \details Reset secondary cmd buffer state in scalability virtual engine interface
//! \param [in] pVEInterface
//! virtual engine interface
//! \return void
//!
void (*pfnVEResetSecdryCmdBufStates)(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface);

//!
//! \brief Verify secondary cmd buffer size
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] dwNewRequestSize
//! new request cmd buffer size
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEVerifySecdryCmdBufSize)
(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
uint32_t dwNewRequestSize);

//!
//! \brief resize secondary cmd buffer
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] dwNewRequestSize
//! new request cmd buffer size
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEResizeSecdryCmdBuf)
(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
uint32_t dwNewRequestSize);

//!
//! \brief get secondary cmd buffer
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] pScdryCmdBuf
//! pointer to secondry cmd buffer
//! \param [in] dwBufIdxPlus1
//! secondary cmd buffer index plus 1
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEGetSecdryCmdBuf)
(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
PMOS_COMMAND_BUFFER pScdryCmdBuf,
uint32_t dwBufIdxPlus1);

//!
//! \brief return secondary cmd buffer
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] pScdryCmdBuf
//! pointer to secondry cmd buffer address
//! \param [in] dwBufIdxPlus1
//! secondary cmd buffer index plus 1
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEReturnSecdryCmdBuf)
(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
PMOS_COMMAND_BUFFER pScdryCmdBuf,
uint32_t dwBufIdxPlus1);

//!
//! \brief done virtual engine secondary command buffers
//! \details UnLock virtual engine secondary command buffers
//! \param [in] pVEInterface
//! virtual engine interface
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEDoneSecdryCmdBuf)
(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface);

//!
//! \brief set hint parameters
//! \details set hint parameters for virtual engine scalability or single pipe mode
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] pVEParams
//! pointer to VE parameter data structure
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVESetHintParams)
(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
PMOS_VIRTUALENGINE_SET_PARAMS pVEParams);

//!
//! \brief get hint parameters
//! \details get hint parameters for virtual engine scalability or single pipe mode
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] bScalableMode
//! flag to indicate if scalability mode
//! \param [in] ppHintParams
//! pointer to VE hint parameter address
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVEGetHintParams)
(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface,
bool bScalableMode,
PMOS_VIRTUALENGINE_HINT_PARAMS *ppHintParams);

//!
//! \brief check hint parameters
//! \details check hint parameters for virtual engine scalability or single pipe mode
//! \param [in] pVEInterface
//! virtual engine interface
//! \param [in] ppHintParams
//! pointer to VE hint parameter address
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS (*pfnVECheckHintParamsValidity)
(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface);

//!
//! \brief Destroy resources for virtual engine scalability
//! \param [in] pVEInterface
//! virtual engine interface
//! \return void
//!
void (*pfnVEDestroy)(
PMOS_VIRTUALENGINE_INTERFACE pVEInterface);
} MOS_VIRTUALENGINE_INTERFACE, *PMOS_VIRTUALENGINE_INTERFACE;

#endif //__MOS_OS_VIRTUALENGINE_SCALABILITY_NEXT_H__

Loading

0 comments on commit 699dcd8

Please sign in to comment.