| 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 vp_debug.h |
| 24 | //! \brief Definition of structures and functions for debugging VPHAL |
| 25 | //! \details This file contains the definition of structures and functions for |
| 26 | //! surface dumper, hw state dumper, perf counter dumper, and render |
| 27 | //! parameter dumper |
| 28 | //! |
| 29 | #ifndef __VP_DEBUG_H__ |
| 30 | #define __VP_DEBUG_H__ |
| 31 | |
| 32 | #include "vp_common.h" |
| 33 | #include "vp_oca_defs.h" // Common interfaces and structures |
| 34 | |
| 35 | #define VPHAL_DBG_OCA_DUMPER_CREATE(pRenderHal) \ |
| 36 | if (pRenderHal) \ |
| 37 | pRenderHal->pVphalOcaDumper = MOS_New(VphalOcaDumper); |
| 38 | |
| 39 | #define VPHAL_DBG_OCA_DUMPER_DESTORY(pRenderHal) \ |
| 40 | if (pRenderHal && pRenderHal->pVphalOcaDumper) \ |
| 41 | VphalOcaDumper::Delete(pRenderHal->pVphalOcaDumper); |
| 42 | |
| 43 | #define VPHAL_DBG_OCA_DUMPER_SET_RENDER_PARAM(pRenderHal, pRenderParams) \ |
| 44 | if (pRenderHal && pRenderHal->pVphalOcaDumper) \ |
| 45 | ((VphalOcaDumper*)pRenderHal->pVphalOcaDumper)->SetRenderParam(pRenderParams); |
| 46 | |
| 47 | class VphalOcaDumper |
| 48 | { |
| 49 | public: |
| 50 | VphalOcaDumper(); |
| 51 | virtual ~VphalOcaDumper(); |
| 52 | void SetRenderParam(VPHAL_RENDER_PARAMS *pRenderParams); |
| 53 | |
| 54 | VPHAL_OCA_RENDER_PARAM *GetRenderParam() |
| 55 | { |
| 56 | return m_pOcaRenderParam; |
| 57 | } |
| 58 | |
| 59 | static void Delete(void *&p); |
| 60 | |
| 61 | void InitSurfInfo(VPHAL_OCA_SURFACE_INFO &surfInfo, VPHAL_SURFACE &surf); |
| 62 | void InitSourceInfo(VPHAL_OCA_SOURCE_INFO &sourceInfo, VPHAL_SURFACE &source); |
| 63 | void InitTargetInfo(VPHAL_OCA_TARGET_INFO &targetInfo, VPHAL_SURFACE &target); |
| 64 | |
| 65 | VPHAL_OCA_RENDER_PARAM *m_pOcaRenderParam = nullptr; |
| 66 | |
| 67 | MEDIA_CLASS_DEFINE_END(VphalOcaDumper) |
| 68 | }; |
| 69 | #endif // __VP_DEBUG_H__ |