Debian Codegraph @

media_driver/cmake/linux/media_feature_flags_linux.cmake

raw
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
21 # global flag for encode AVC_VME/HEVC_VME/MPEG2/VP8
22 if(GEN8 OR GEN9 OR GEN11 OR GEN12)
23 bs_set_if_undefined(Encode_VME_Supported "yes")
24 else()
25 bs_set_if_undefined(Encode_VME_Supported "no")
26 endif()
27 # global flag for encode AVC_VDENC/HEVC_VDENC/VP9_VDENC/JPEG
28 bs_set_if_undefined(Encode_VDEnc_Supported "yes")
29
30 # Some features can't be supported if shaders (kernels) are not
31 # available. So, we switch such features off explicitly. That's
32 # possible either if user requested a build entirely without
33 # shaders or a build with free only shaders. The list of switched
34 # off features correspnds to the free kernels case, but we can
35 # reuse the full list for enable kernels as well.
36 if(NOT ENABLE_KERNELS OR NOT ENABLE_NONFREE_KERNELS)
37 # full-open-source
38 bs_set_if_undefined(AVC_Encode_VME_Supported "no")
39 bs_set_if_undefined(HEVC_Encode_VME_Supported "no")
40 bs_set_if_undefined(MPEG2_Encode_VME_Supported "no")
41 bs_set_if_undefined(VC1_Decode_Supported "no")
42 bs_set_if_undefined(Decode_Processing_Supported "no")
43 bs_set_if_undefined(Kernel_Auto_Denoise_Supported "no")
44 bs_set_if_undefined(VP8_Encode_Supported "no")
45 else()
46 # full-feature
47 bs_set_if_undefined(AVC_Encode_VME_Supported "${Encode_VME_Supported}")
48 bs_set_if_undefined(HEVC_Encode_VME_Supported "${Encode_VME_Supported}")
49 bs_set_if_undefined(MPEG2_Encode_VME_Supported "${Encode_VME_Supported}")
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}")
54 endif()
55
56 # features are always able to open
57 bs_set_if_undefined(VVC_Decode_Supported "yes")
58 bs_set_if_undefined(AV1_Decode_Supported "yes")
59 bs_set_if_undefined(AVC_Decode_Supported "yes")
60 bs_set_if_undefined(HEVC_Decode_Supported "yes")
61 bs_set_if_undefined(JPEG_Decode_Supported "yes")
62 bs_set_if_undefined(MPEG2_Decode_Supported "yes")
63 bs_set_if_undefined(VP8_Decode_Supported "yes")
64 bs_set_if_undefined(VP9_Decode_Supported "yes")
65 bs_set_if_undefined(VP_SFC_Supported "yes")
66 bs_set_if_undefined(Common_Encode_Supported "yes")
67 bs_set_if_undefined(Media_Scalability_Supported "yes")
68 bs_set_if_undefined(MMC_Supported "yes")
69
70 # features controlled by global flag Encode_VDEnc_Supported
71 bs_set_if_undefined(AVC_Encode_VDEnc_Supported "${Encode_VDEnc_Supported}")
72 bs_set_if_undefined(HEVC_Encode_VDEnc_Supported "${Encode_VDEnc_Supported}")
73 bs_set_if_undefined(VP9_Encode_VDEnc_Supported "${Encode_VDEnc_Supported}")
74 bs_set_if_undefined(AV1_Encode_VDEnc_Supported "${Encode_VDEnc_Supported}")
75 bs_set_if_undefined(JPEG_Encode_Supported "${Encode_VDEnc_Supported}")
76
77 if(${Common_Encode_Supported} STREQUAL "yes")
78 add_definitions(-D_COMMON_ENCODE_SUPPORTED)
79 endif()
80
81 if(${AVC_Encode_VME_Supported} STREQUAL "yes")
82 add_definitions(-D_AVC_ENCODE_VME_SUPPORTED)
83 endif()
84
85 if(${AVC_Encode_VDEnc_Supported} STREQUAL "yes")
86 add_definitions(-D_AVC_ENCODE_VDENC_SUPPORTED)
87 endif()
88
89 if(${AVC_Decode_Supported} STREQUAL "yes")
90 add_definitions(-D_AVC_DECODE_SUPPORTED)
91 endif()
92
93 if (${HEVC_Encode_VME_Supported} STREQUAL "yes")
94 add_definitions (-D_HEVC_ENCODE_VME_SUPPORTED)
95 endif()
96
97 if (${HEVC_Encode_VDEnc_Supported} STREQUAL "yes")
98 add_definitions(-D_HEVC_ENCODE_VDENC_SUPPORTED)
99 endif ()
100
101 if(${HEVC_Decode_Supported} STREQUAL "yes")
102 add_definitions(-D_HEVC_DECODE_SUPPORTED)
103 endif()
104
105 if(${JPEG_Encode_Supported} STREQUAL "yes")
106 add_definitions(-D_JPEG_ENCODE_SUPPORTED)
107 endif()
108
109 if(${JPEG_Decode_Supported} STREQUAL "yes")
110 add_definitions(-D_JPEG_DECODE_SUPPORTED)
111 endif()
112
113 if(${MPEG2_Encode_VME_Supported} STREQUAL "yes")
114 add_definitions(-D_MPEG2_ENCODE_VME_SUPPORTED)
115 endif()
116
117 if(${MPEG2_Decode_Supported} STREQUAL "yes")
118 add_definitions(-D_MPEG2_DECODE_SUPPORTED)
119 endif()
120
121 if(${VC1_Decode_Supported} STREQUAL "yes")
122 add_definitions(-D_VC1_DECODE_SUPPORTED)
123 endif()
124
125 if(${VP8_Decode_Supported} STREQUAL "yes")
126 add_definitions(-D_VP8_DECODE_SUPPORTED)
127 endif()
128
129 if(${VP8_Encode_Supported} STREQUAL "yes")
130 add_definitions(-D_VP8_ENCODE_SUPPORTED)
131 endif()
132
133 if(${VP9_Encode_VDEnc_Supported} STREQUAL "yes")
134 add_definitions(-D_VP9_ENCODE_VDENC_SUPPORTED)
135 endif()
136
137 if(${AV1_Encode_VDEnc_Supported} STREQUAL "yes")
138 add_definitions(-D_AV1_ENCODE_VDENC_SUPPORTED)
139 endif()
140
141 if(${VP9_Decode_Supported} STREQUAL "yes")
142 add_definitions(-D_VP9_DECODE_SUPPORTED)
143 endif()
144
145 if(${AV1_Decode_Supported} STREQUAL "yes")
146 add_definitions(-D_AV1_DECODE_SUPPORTED)
147 endif()
148
149 if(${VVC_Decode_Supported} STREQUAL "yes")
150 add_definitions(-D_VVC_DECODE_SUPPORTED)
151 endif()
152
153 if(${Decode_Processing_Supported} STREQUAL "yes")
154 add_definitions(-D_DECODE_PROCESSING_SUPPORTED)
155 endif()
156
157 if(${Kernel_Auto_Denoise_Supported} STREQUAL "yes")
158 add_definitions(-DVEBOX_AUTO_DENOISE_SUPPORTED=1)
159 else()
160 add_definitions(-DVEBOX_AUTO_DENOISE_SUPPORTED=0)
161 endif()
162
163 if(${VP_SFC_Supported} STREQUAL "yes")
164 add_definitions(-D__VPHAL_SFC_SUPPORTED=1)
165 else()
166 add_definitions(-D__VPHAL_SFC_SUPPORTED=0)
167 endif()
168
169 bs_set_if_undefined(CLASS_TRACE 0)
170 add_definitions(-DCLASS_TRACE=${CLASS_TRACE})
171
172 if(ENABLE_KERNELS)
173 add_definitions(-DENABLE_KERNELS)
174 endif()
175
176 if(BUILD_KERNELS)
177 add_definitions(-DBUILD_KERNELS)
178 endif()
179
180 if(NOT ENABLE_NONFREE_KERNELS)
181 add_definitions(-D_FULL_OPEN_SOURCE)
182 endif()
183
184 include(${MEDIA_EXT_CMAKE}/ext/linux/media_feature_flags_linux_ext.cmake OPTIONAL)