| 1 | /* |
| 2 | * Copyright (c) 2008-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 hal_kerneldll.h |
| 24 | //! \brief Fast Compositing dynamic kernel linking/loading definitions |
| 25 | //! |
| 26 | #ifndef __HAL_KERNELDLL_H__ |
| 27 | #define __HAL_KERNELDLL_H__ |
| 28 | |
| 29 | #include "mos_defs.h" |
| 30 | #include "cm_fc_ld.h" |
| 31 | #include "hal_kerneldll_next.h" |
| 32 | #include "vphal_common.h" |
| 33 | |
| 34 | |
| 35 | #ifdef __cplusplus |
| 36 | extern "C" { |
| 37 | #endif // __cplusplus |
| 38 | |
| 39 | typedef enum _MOS_FORMAT Kdll_Format; |
| 40 | |
| 41 | //-------------------------------------------------------------- |
| 42 | // Kernel DLL structures |
| 43 | //-------------------------------------------------------------- |
| 44 | |
| 45 | //------------------------------------------------------------ |
| 46 | // Component kernel descriptors (equivalent to KDT) |
| 47 | //------------------------------------------------------------ |
| 48 | // Component kernel linking information |
| 49 | typedef struct tagKdll_Linking |
| 50 | { |
| 51 | int iKUID; // Component Kernel Unique ID |
| 52 | uint32_t bExport : 1; // Export (1) / Import (0) |
| 53 | uint32_t bInline : 1; // Inline(1) / Function (0) |
| 54 | uint32_t : 2; // - (MBZ) |
| 55 | uint32_t iLabelID : 12; // Label ID |
| 56 | uint32_t dwOffset : 16; // Instruction offset |
| 57 | } Kdll_Linking, *pKdll_Linking; |
| 58 | |
| 59 | // Get component/static kernel |
| 60 | Kdll_CacheEntry * |
| 61 | KernelDll_GetComponentKernel(Kdll_State *pState, |
| 62 | int iKUID); |
| 63 | |
| 64 | bool KernelDll_IsSameFormatType(MOS_FORMAT format1, MOS_FORMAT format2); |
| 65 | |
| 66 | #if _DEBUG || EMUL |
| 67 | |
| 68 | // Debugging strings for standalone application or debug driver |
| 69 | const char *KernelDll_GetLayerString (Kdll_Layer layer); |
| 70 | const char *KernelDll_GetFormatString (MOS_FORMAT format); |
| 71 | const char *KernelDll_GetCSpaceString (VPHAL_CSPACE cspace); |
| 72 | const char *KernelDll_GetSamplingString (Kdll_Sampling sampling); |
| 73 | const char *KernelDll_GetRotationString (VPHAL_ROTATION rotation); |
| 74 | const char *KernelDll_GetProcessString (Kdll_Processing process); |
| 75 | const char *KernelDll_GetParserStateString (Kdll_ParserState state); |
| 76 | const char *KernelDll_GetRuleIDString (Kdll_RuleID RID); |
| 77 | const char *KernelDll_GetCoeffIDString (Kdll_CoeffID CID); |
| 78 | |
| 79 | int32_t KernelDll_PrintRule( |
| 80 | char *szOut, |
| 81 | int iSize, |
| 82 | const Kdll_RuleEntry *pEntry, |
| 83 | Kdll_KernelCache *pCache); |
| 84 | |
| 85 | #endif // _DEBUG || EMUL |
| 86 | |
| 87 | #ifdef __cplusplus |
| 88 | } |
| 89 | #endif |
| 90 | |
| 91 | #endif // __HAL_KERNELDLL_H__ |