1# Copyright (c) 2017, Intel Corporation 2# 3# Permission is hereby granted, free of charge, to any person obtaining a 4# copy of this software and associated documentation files (the "Software"), 5# to deal in the Software without restriction, including without limitation 6# the rights to use, copy, modify, merge, publish, distribute, sublicense, 7# and/or sell copies of the Software, and to permit persons to whom the 8# Software is furnished to do so, subject to the following conditions: 9# 10# The above copyright notice and this permission notice shall be included 11# in all copies or substantial portions of the Software. 12# 13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 14# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 17# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 18# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19# OTHER DEALINGS IN THE SOFTWARE. 20 21option (ENABLE_XE_KMD "Enable Linux Xe KMD header files" ON) 22 23# global flag for encode AVC_VME/HEVC_VME/MPEG2/VP8 24bs_set_if_undefined(Encode_VME_Supported "yes") 25# global flag for encode AVC_VDENC/HEVC_VDENC/VP9_VDENC/JPEG 26bs_set_if_undefined(Encode_VDEnc_Supported "yes") 27 28# Some features can't be supported if shaders (kernels) are not 29# available. So, we switch such features off explicitly. That's 30# possible either if user requested a build entirely without 31# shaders or a build with free only shaders. The list of switched 32# off features correspnds to the free kernels case, but we can 33# reuse the full list for enable kernels as well. 34if(NOT ENABLE_KERNELS OR NOT ENABLE_NONFREE_KERNELS) 35 # full-open-source 36 bs_set_if_undefined(AVC_Encode_VME_Supported "no") 37 bs_set_if_undefined(HEVC_Encode_VME_Supported "no") 38 bs_set_if_undefined(MPEG2_Encode_VME_Supported "no") 39 bs_set_if_undefined(CMRT_HEVC_ENC_FEI_Supported "no") 40 bs_set_if_undefined(VC1_Decode_Supported "no") 41 bs_set_if_undefined(Decode_Processing_Supported "no") 42 bs_set_if_undefined(Kernel_Auto_Denoise_Supported "no") 43 bs_set_if_undefined(VP8_Encode_Supported "no") 44else() 45 # full-feature 46 bs_set_if_undefined(AVC_Encode_VME_Supported "${Encode_VME_Supported}") 47 bs_set_if_undefined(HEVC_Encode_VME_Supported "${Encode_VME_Supported}") 48 bs_set_if_undefined(MPEG2_Encode_VME_Supported "${Encode_VME_Supported}") 49 bs_set_if_undefined(CMRT_HEVC_ENC_FEI_Supported "yes") 50 bs_set_if_undefined(VC1_Decode_Supported "yes") 51 bs_set_if_undefined(Decode_Processing_Supported "yes") 52 bs_set_if_undefined(Kernel_Auto_Denoise_Supported "yes") 53 bs_set_if_undefined(VP8_Encode_Supported "${Encode_VME_Supported}") 54endif() 55 56# features are always able to open 57bs_set_if_undefined(VVC_Decode_Supported "yes") 58bs_set_if_undefined(AV1_Decode_Supported "yes") 59bs_set_if_undefined(AVC_Decode_Supported "yes") 60bs_set_if_undefined(HEVC_Decode_Supported "yes") 61bs_set_if_undefined(JPEG_Decode_Supported "yes") 62bs_set_if_undefined(MPEG2_Decode_Supported "yes") 63bs_set_if_undefined(VP8_Decode_Supported "yes") 64bs_set_if_undefined(VP9_Decode_Supported "yes") 65bs_set_if_undefined(VP_SFC_Supported "yes") 66bs_set_if_undefined(Common_Encode_Supported "yes") 67bs_set_if_undefined(Media_Scalability_Supported "yes") 68bs_set_if_undefined(MMC_Supported "yes") 69 70# features controlled by global flag Encode_VDEnc_Supported 71bs_set_if_undefined(AVC_Encode_VDEnc_Supported "${Encode_VDEnc_Supported}") 72bs_set_if_undefined(HEVC_Encode_VDEnc_Supported "${Encode_VDEnc_Supported}") 73bs_set_if_undefined(VP9_Encode_VDEnc_Supported "${Encode_VDEnc_Supported}") 74bs_set_if_undefined(AV1_Encode_VDEnc_Supported "${Encode_VDEnc_Supported}") 75bs_set_if_undefined(JPEG_Encode_Supported "${Encode_VDEnc_Supported}") 76 77if(${Common_Encode_Supported} STREQUAL "yes") 78 add_definitions(-D_COMMON_ENCODE_SUPPORTED) 79endif() 80 81if(${AVC_Encode_VME_Supported} STREQUAL "yes") 82 add_definitions(-D_AVC_ENCODE_VME_SUPPORTED) 83endif() 84 85if(${AVC_Encode_VDEnc_Supported} STREQUAL "yes") 86 add_definitions(-D_AVC_ENCODE_VDENC_SUPPORTED) 87endif() 88 89if(${AVC_Decode_Supported} STREQUAL "yes") 90 add_definitions(-D_AVC_DECODE_SUPPORTED) 91endif() 92 93if (${HEVC_Encode_VME_Supported} STREQUAL "yes") 94 add_definitions (-D_HEVC_ENCODE_VME_SUPPORTED) 95endif() 96 97if (${HEVC_Encode_VDEnc_Supported} STREQUAL "yes") 98 add_definitions(-D_HEVC_ENCODE_VDENC_SUPPORTED) 99endif () 100 101if(${HEVC_Decode_Supported} STREQUAL "yes") 102 add_definitions(-D_HEVC_DECODE_SUPPORTED) 103endif() 104 105if(${JPEG_Encode_Supported} STREQUAL "yes") 106 add_definitions(-D_JPEG_ENCODE_SUPPORTED) 107endif() 108 109if(${JPEG_Decode_Supported} STREQUAL "yes") 110 add_definitions(-D_JPEG_DECODE_SUPPORTED) 111endif() 112 113if(${MPEG2_Encode_VME_Supported} STREQUAL "yes") 114 add_definitions(-D_MPEG2_ENCODE_VME_SUPPORTED) 115endif() 116 117if(${MPEG2_Decode_Supported} STREQUAL "yes") 118 add_definitions(-D_MPEG2_DECODE_SUPPORTED) 119endif() 120 121if(${VC1_Decode_Supported} STREQUAL "yes") 122 add_definitions(-D_VC1_DECODE_SUPPORTED) 123endif() 124 125if(${VP8_Decode_Supported} STREQUAL "yes") 126 add_definitions(-D_VP8_DECODE_SUPPORTED) 127endif() 128 129if(${VP8_Encode_Supported} STREQUAL "yes") 130 add_definitions(-D_VP8_ENCODE_SUPPORTED) 131endif() 132 133if(${VP9_Encode_VDEnc_Supported} STREQUAL "yes") 134 add_definitions(-D_VP9_ENCODE_VDENC_SUPPORTED) 135endif() 136 137if(${AV1_Encode_VDEnc_Supported} STREQUAL "yes") 138 add_definitions(-D_AV1_ENCODE_VDENC_SUPPORTED) 139endif() 140 141if(${VP9_Decode_Supported} STREQUAL "yes") 142 add_definitions(-D_VP9_DECODE_SUPPORTED) 143endif() 144 145if(${AV1_Decode_Supported} STREQUAL "yes") 146 add_definitions(-D_AV1_DECODE_SUPPORTED) 147endif() 148 149if(${VVC_Decode_Supported} STREQUAL "yes") 150 add_definitions(-D_VVC_DECODE_SUPPORTED) 151endif() 152 153if(${CMRT_HEVC_ENC_FEI_Supported} STREQUAL "yes") 154 add_definitions(-DHEVC_FEI_ENABLE_CMRT) 155endif() 156 157if(${Decode_Processing_Supported} STREQUAL "yes") 158 add_definitions(-D_DECODE_PROCESSING_SUPPORTED) 159endif() 160 161if(${MMC_Supported} STREQUAL "yes") 162 add_definitions(-D_MMC_SUPPORTED) 163endif() 164 165if(${Kernel_Auto_Denoise_Supported} STREQUAL "yes") 166 add_definitions(-DVEBOX_AUTO_DENOISE_SUPPORTED=1) 167else() 168 add_definitions(-DVEBOX_AUTO_DENOISE_SUPPORTED=0) 169endif() 170 171if(${VP_SFC_Supported} STREQUAL "yes") 172 add_definitions(-D__VPHAL_SFC_SUPPORTED=1) 173else() 174 add_definitions(-D__VPHAL_SFC_SUPPORTED=0) 175endif() 176 177bs_set_if_undefined(CLASS_TRACE 0) 178add_definitions(-DCLASS_TRACE=${CLASS_TRACE}) 179 180if(ENABLE_KERNELS) 181 add_definitions(-DENABLE_KERNELS) 182endif() 183 184if(BUILD_KERNELS) 185 add_definitions(-DBUILD_KERNELS) 186endif() 187 188if(NOT ENABLE_NONFREE_KERNELS) 189 add_definitions(-D_FULL_OPEN_SOURCE) 190endif() 191 192if(ENABLE_XE_KMD) 193 message("New XE Kmd support has been enabled") 194 add_definitions(-DENABLE_XE_KMD) 195endif() 196 197add_definitions(-D_MANUAL_SOFTLET_) 198 199include(${MEDIA_EXT_CMAKE}/ext/linux/media_feature_flags_linux_ext.cmake OPTIONAL) 200