| 1 |
/* |
| 2 |
* Copyright (c) 2021, 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 |
#ifndef __VP_KERNEL_CONFIG_H__ |
| 23 |
#define __VP_KERNEL_CONFIG_H__ |
| 24 |
|
| 25 |
#include <map> |
| 26 |
#include "mos_defs.h" |
| 27 |
#include "renderhal.h" |
| 28 |
#include "hal_kerneldll_next.h" |
| 29 |
#include "media_class_trace.h" |
| 30 |
#include "vp_common_defs.h" |
| 31 |
|
| 32 |
#define VP_USE_MEDIA_THREADS_MAX 0 |
| 33 |
// Compositing Block size |
| 34 |
#define VP_COMP_BLOCK_WIDTH 16 |
| 35 |
#define VP_COMP_BLOCK_HEIGHT 16 |
| 36 |
|
| 37 |
#define ADD_VP_KERNEL_PARAMS(kernelId, grfCount, btCount, samplerCount, threadCount, grfStartReg, curbeLen, blockWidth, blockHeight, blocksX, blocksY) \ |
| 38 |
m_kernelParams.insert(std::make_pair((VpKernelID)(kernelId), \ |
| 39 |
RENDERHAL_KERNEL_PARAM{ (grfCount), (btCount), (samplerCount), (threadCount), (grfStartReg), (curbeLen), (blockWidth), (blockHeight), (blocksX), (blocksY)})) |
| 40 |
|
| 41 |
#define VP_ADV_KERNEL_BINARY_ID(kernelId) ((IDR_VP_TOTAL_NUM_KERNELS) + (kernelId)) |
| 42 |
|
| 43 |
enum DelayLoadedKernelType |
| 44 |
{ |
| 45 |
KernelNone = 0, |
| 46 |
KernelFDFB, |
| 47 |
KernelSEG, |
| 48 |
KernelSR, |
| 49 |
//If more kernels need to load delayed, can add to list |
| 50 |
}; |
| 51 |
|
| 52 |
namespace vp { |
| 53 |
|
| 54 |
struct RENDERHAL_ENLARGE_OVERWRITE_PARAM |
| 55 |
{ |
| 56 |
bool needOverwrite = false; |
| 57 |
RENDERHAL_ENLARGE_PARAMS params = {}; |
| 58 |
}; |
| 59 |
|
| 60 |
class VpKernelConfig |
| 61 |
{ |
| 62 |
public: |
| 63 |
VpKernelConfig(); |
| 64 |
virtual ~VpKernelConfig(); |
| 65 |
MOS_STATUS GetKernelParam(VpKernelID kernelId, RENDERHAL_KERNEL_PARAM ¶m); |
| 66 |
|
| 67 |
virtual Kdll_Scalingratio GetFilterScalingRatio(float scaleX, float scaleY) |
| 68 |
{ |
| 69 |
return Scalingratio_Any; |
| 70 |
} |
| 71 |
|
| 72 |
virtual bool IsFcCscCoeffPatchModeEnabled() |
| 73 |
{ |
| 74 |
return true; |
| 75 |
} |
| 76 |
|
| 77 |
virtual bool IsDpFcKernelEnabled() |
| 78 |
{ |
| 79 |
return false; |
| 80 |
} |
| 81 |
|
| 82 |
// This Funcion should be used in media_platform_interfaces InitPlatformKernelBinary |
| 83 |
MOS_STATUS SetRenderEnlargeOverwriteParams(RENDERHAL_ENLARGE_PARAMS &enlargeParams) |
| 84 |
{ |
| 85 |
m_renderEnlargeOverwrite.needOverwrite = true; |
| 86 |
m_renderEnlargeOverwrite.params = enlargeParams; |
| 87 |
return MOS_STATUS_SUCCESS; |
| 88 |
} |
| 89 |
|
| 90 |
RENDERHAL_ENLARGE_OVERWRITE_PARAM& GetRenderEnlargeOverwriteParams() |
| 91 |
{ |
| 92 |
return m_renderEnlargeOverwrite; |
| 93 |
} |
| 94 |
|
| 95 |
protected: |
| 96 |
std::map<VpKernelID, RENDERHAL_KERNEL_PARAM> m_kernelParams; // Kernel params. |
| 97 |
RENDERHAL_ENLARGE_OVERWRITE_PARAM m_renderEnlargeOverwrite = {}; |
| 98 |
|
| 99 |
MEDIA_CLASS_DEFINE_END(vp__VpKernelConfig) |
| 100 |
}; |
| 101 |
} |
| 102 |
#endif // __VP_KERNEL_CONFIG_H__ |