| 1 | /* |
| 2 | * Copyright (c) 2016-2017, 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 vphal_render_renderstate.cpp |
| 24 | //! \brief VPHAL RenderState class implementation |
| 25 | //! \details RenderState class function implementation |
| 26 | //! |
| 27 | #include "vphal_renderer.h" |
| 28 | #include "vphal_render_renderstate.h" |
| 29 | |
| 30 | //! |
| 31 | //! \brief RenderState Constructor |
| 32 | //! \details Construct RenderState and allocate member data structure |
| 33 | //! \param [in] pOsInterface |
| 34 | //! Pointer to MOS interface structure |
| 35 | //! \param [in] pRenderHal |
| 36 | //! Pointer to RenderHal interface structure |
| 37 | //! \param [in] pPerfData |
| 38 | //! Pointer to performance data structure |
| 39 | //! \param [out] peStatus |
| 40 | //! Pointer to MOS status |
| 41 | //! |
| 42 | RenderState::RenderState( |
| 43 | PMOS_INTERFACE pOsInterface, |
| 44 | PRENDERHAL_INTERFACE pRenderHal, |
| 45 | PVPHAL_RNDR_PERF_DATA pPerfData, |
| 46 | MOS_STATUS *peStatus) : |
| 47 | m_pOsInterface(pOsInterface), |
| 48 | m_pRenderHal((PRENDERHAL_INTERFACE_LEGACY)pRenderHal), |
| 49 | m_pSkuTable(nullptr), |
| 50 | m_pWaTable(nullptr), |
| 51 | m_bDisableRender(false), |
| 52 | m_bSingleSlice(false), |
| 53 | m_pPerfData(pPerfData), |
| 54 | m_reporting(nullptr) |
| 55 | { |
| 56 | MOS_STATUS eStatus = MOS_STATUS_SUCCESS; |
| 57 | |
| 58 | VPHAL_RENDER_CHK_NULL(pRenderHal); |
| 59 | |
| 60 | if (m_pOsInterface) |
| 61 | { |
| 62 | m_userSettingPtr = pOsInterface->pfnGetUserSettingInstance(m_pOsInterface); |
| 63 | } |
| 64 | |
| 65 | // Connect renderer to other VPHAL components (HW/OS interfaces) |
| 66 | m_pWaTable = pRenderHal->pWaTable; |
| 67 | m_pSkuTable = pRenderHal->pSkuTable; |
| 68 | |
| 69 | finish: |
| 70 | if (peStatus) |
| 71 | { |
| 72 | *peStatus = eStatus; |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | //! |
| 77 | //! \brief Render function for the pass |
| 78 | //! \details The render function coordinates the advanced renderers and basic |
| 79 | //! renders in one pass |
| 80 | //! \param [in,out] pRenderer |
| 81 | //! VPHAL renderer pointer |
| 82 | //! \param [in,out] pRenderParams |
| 83 | //! Pointer to VPHAL render parameter |
| 84 | //! \return MOS_STATUS |
| 85 | //! Return MOS_STATUS_SUCCESS if successful, otherwise failed |
| 86 | //! |
| 87 | void RenderState::SetStatusReportParams( |
| 88 | VphalRenderer *pRenderer, |
| 89 | PVPHAL_RENDER_PARAMS pRenderParams) |
| 90 | { |
| 91 | bool bSurfIsRenderTarget = (pRenderParams->pTarget[0]->SurfType == SURF_OUT_RENDERTARGET); |
| 92 | m_StatusTableUpdateParams.bReportStatus = (pRenderParams->bReportStatus); |
| 93 | m_StatusTableUpdateParams.bSurfIsRenderTarget = bSurfIsRenderTarget; |
| 94 | m_StatusTableUpdateParams.pStatusTable = pRenderer->m_statusTable; |
| 95 | m_StatusTableUpdateParams.StatusFeedBackID = pRenderParams->StatusFeedBackID; |
| 96 | } |