Codebase list intel-media-driver / f8ffbc6
New upstream version 19.2.1+dfsg1 Sebastian Ramacher 4 years ago
65 changed file(s) with 550 addition(s) and 332 deletion(s). Raw diff Collapse all Expand all
1010
1111 The Intel(R) Media Driver for VAAPI is distributed under the MIT license with
1212 portions covered under the BSD 3-clause "New" or "Revised" License.
13 You may obtain a copy of the License at:
14
15 https://opensource.org/licenses/MIT
16
17 &
18
19 https://opensource.org/licenses/BSD-3-Clause
13 You may obtain a copy of the License at [MIT](https://opensource.org/licenses/MIT) & [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
2014
2115 ## Prerequisites
2216
23 For Ubuntu 16.04 and above
17 For Ubuntu 16.04+
2418
25 \# apt install autoconf libtool libdrm-dev xorg xorg-dev openbox libx11-dev libgl1-mesa-glx libgl1-mesa-dev
19 ```
20 apt install autoconf libtool libdrm-dev xorg xorg-dev openbox libx11-dev libgl1-mesa-glx libgl1-mesa-dev
21 ```
2622
2723 Equivalents for other distributions should work.
2824
2925 ## Dependencies
3026
31 Libva - https://github.com/intel/libva
32
33 GmmLib - https://github.com/intel/gmmlib (please check https://github.com/intel/media-driver/wiki/Comparability-with-GmmLib)
27 * [Libva](https://github.com/intel/libva)
28 * [GmmLib](https://github.com/intel/gmmlib)(Please check [comparability with GmmLib](https://github.com/intel/media-driver/wiki/Comparability-with-GmmLib))
3429
3530 ## Building
3631
5550 ```
5651 7.
5752 ```
58 $ make -j8
53 $ make -j"$(nproc)"
5954 ```
6055
6156 ## Install
7671 export LIBVA_DRIVER_NAME=iHD
7772 ```
7873
79 ## Build Modes
80
81 This section summarizes key driver build modes which can be used in the different environment requirements:
82
83 | Build option | Default value | Dependencies | Comments |
84 |-|-|-|-|
85 | ENABLE_KERNELS | ON | N/A | Enable/Disable shaders during driver build |
86 | ENABLE_NONFREE_KERNELS | ON | ENABLE_KERNELS=ON | Enable/disable close source shaders (kernels) during the build |
87 | BUILD_KERNELS | OFF | ENABLE_KERNELS=ON, ENABLE_NONFREE_KERNELS=OFF | If enabled, rebuild open source shaders (kernels) from sources. Requires ENABLE_NONFREE_KERNELS=OFF |
88
89 With the above options it is possible to build (table assumes that non-listed options have default values):
90
91 | No. | Build option(s) | HW Features | Shaders (Kernels) | Comments |
92 |-|-|-|-|-|
93 | 1 | ENABLE_KERNELS=ON | Yes | Close source (pre-built) | **Default Build**, full feature driver |
94 | 2 | ENABLE_KERNELS=OFF | Yes | None | HW features only, include HW decoder, HW VDEnc Encoder (CQP mode) |
95 | 3 | ENABLE_NONFREE_KERNELS=OFF | Yes | Open source (pre-built) | **Open Source Build**, HW features available in prev. mode (ENABLE_KERNELS=ON) and features supported by open source shaders |
96 | 4 | ENABLE_NONFREE_KERNELS=OFF BUILD_KERNELS=ON | Yes | Open source | **Open Source Build**, Same as ENABLE_NONFREE_KERNELS=OFF driver, but shaders are rebuilt from sources |
9774
9875 ## Supported Platforms
9976
100 BDW (Broadwell)
77 * BDW (Broadwell)
78 * SKL (Skylake)
79 * BXT (Broxton) / APL (Apollo Lake)
80 * KBL (Kaby Lake)
81 * CFL (Coffee Lake)
82 * WHL (Whiskey Lake)
83 * CML (Comet Lake)
84 * ICL (Ice Lake)
10185
102 SKL (Skylake)
10386
104 BXT (Broxton) / APL (Apollo Lake)
87 ## Components and Features
10588
106 KBL (Kaby Lake)
89 Media driver contains three components as below
90 * **Video decoding** calls hardware-based decoder([VDBox](https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-kbl-vol08-media_vdbox.pdf)) which provides fully-accelerated hardware video decoding to release the graphics engine for other operations.
91 * **Video encoding** supports two modes, one calls hardware-based encoder([VDEnc](https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-kbl-vol08-media_vdbox.pdf)/[Huc](https://01.org/linuxgraphics/downloads/firmware?langredirect=1)) to provide low power encoding, another one is hardware([PAK](https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-kbl-vol08-media_vdbox.pdf))+shader(media kernel+[VME](https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-kbl-vol04-configurations.pdf)) based encoding. User could choose the mode through VA-API.
92 * **Video processing** supports several popular features by hardware-based video processor([VEBox/SFC](https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-kbl-vol09-media_vebox.pdf)) and shader(media kernel) based solution together.
10793
108 CFL (Coffee Lake)
94 Media driver supports two build types as below
95 * **Full Feature Build** is default driver build, which supports all feature by hardware accelerator and close source shaders(media kernel binaries). Ubuntu [intel-media-va-driver-non-free](https://packages.ubuntu.com/disco/intel-media-va-driver-non-free) package is generated from this build type.
96 * **Free Kernel Build**, enables fully open source shaders(media kernels) and hardware features but the features would be limited. Ubuntu [intel-media-va-driver](https://packages.ubuntu.com/disco/intel-media-va-driver) package is generated from this build type.
10997
110 WHL (Whiskey Lake)
11198
112 CML (Comet Lake)
99 ### Decoding/Encoding Features
113100
114 ICL (Ice Lake)
101 | CODEC | Build Types | BDW | SKL | BXT/APL | KBL | CFL | WHL | CML | ICL* |
102 |---|---|---|---|---|---|---|---|---|---|
103 | AVC | <u>Full Feature</u><br><i>Free Kernel</i> | <u>D/Es</u><br><i>D<i> | <u>D/E/Es</u><br><i>D/E<i> | <u>D/E/Es</u><br><i>D/E<i> | <u>D/E/Es</u><br><i>D/E<i> | <u>D/E/Es</u><br><i>D/E<i> | <u>D/E/Es</u><br><i>D/E<i> | <u>D/E/Es</u><br><i>D/E<i> | <u>D/E/Es</u><br><i>D/E<i> |
104 | MPEG-2 | <u>Full Feature</u><br><i>Free Kernel</i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> |
105 | VC-1 | <u>Full Feature</u><br><i>Free Kernel</i> | <u>D</u><br><i>&nbsp;<i> | <u>D</u><br><i>&nbsp;<i> | <u>D</u><br><i>&nbsp;<i> | <u>D</u><br><i>&nbsp;<i> | <u>D</u><br><i>&nbsp;<i> | <u>D</u><br><i>&nbsp;<i> | <u>D</u><br><i>&nbsp;<i> | <u>D</u><br><i>&nbsp;<i> |
106 | JPEG | <u>Full Feature</u><br><i>Free Kernel</i> | <u>D</u><br><i>D<i> | <u>D/E</u><br><i>D/E<i> | <u>D/E</u><br><i>D/E<i> | <u>D/E</u><br><i>D/E<i> | <u>D/E</u><br><i>D/E<i> | <u>D/E</u><br><i>D/E<i> | <u>D/E</u><br><i>D/E<i> | <u>D/E</u><br><i>D/E<i> |
107 | VP8 | <u>Full Feature</u><br><i>Free Kernel</i> | <u>D</u><br><i>D<i> | <u>D</u><br><i>D<i> | <u>D</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> |
108 | HEVC 8bit | <u>Full Feature</u><br><i>Free Kernel</i> | | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/E/Es</u><br><i>D/E<i> |
109 | HEVC 8bit 422 | <u>Full Feature</u><br><i>Free Kernel</i> | | | | | | | | <u>D/Es</u><br><i>D<i> |
110 | HEVC 8bit 444 | <u>Full Feature</u><br><i>Free Kernel</i> | | | | | | | | <u>D/E</u><br><i>D/E<i> |
111 | HEVC 10bit | <u>Full Feature</u><br><i>Free Kernel</i> | | | <u>D</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/Es</u><br><i>D<i> | <u>D/E/Es</u><br><i>D/E<i> |
112 | HEVC 10bit 422 | <u>Full Feature</u><br><i>Free Kernel</i> | | | | | | | | <u>D/Es</u><br><i>D<i> |
113 | HEVC 10bit 444 | <u>Full Feature</u><br><i>Free Kernel</i> | | | | | | | | <u>D/E</u><br><i>D/E<i> |
114 | VP9 8bit | <u>Full Feature</u><br><i>Free Kernel</i> | | | <u>D</u><br><i>D<i> | <u>D</u><br><i>D<i> | <u>D</u><br><i>D<i> | <u>D</u><br><i>D<i> | <u>D</u><br><i>D<i> | <u>D/E</u><br><i>D/E<i> |
115 | VP9 8bit 444 | <u>Full Feature</u><br><i>Free Kernel</i> | | | | | | | | <u>D/E</u><br><i>D/E<i> |
116 | VP9 10bit | <u>Full Feature</u><br><i>Free Kernel</i> | | | | <u>D</u><br><i>D<i> | <u>D</u><br><i>D<i> | <u>D</u><br><i>D<i> | <u>D</u><br><i>D<i> | <u>D/E</u><br><i>D/E<i> |
117 | VP9 10bit 444 | <u>Full Feature</u><br><i>Free Kernel</i> | | | | | | | | <u>D/E</u><br><i>D/E<i> |
115118
116 ## Driver Features
117
118 ### Features in Default Driver Build
119
120 | CODEC | BDW | SKL | BXT/APL | KBL | CFL | WHL | CML | ICL* |
121 |---|---|---|---|---|---|---|---|---|
122 | AVC | D/Es | D/E/Es | D/E/Es | D/E/Es | D/E/Es | D/E/Es | D/E/Es | D/E/Es |
123 | MPEG-2 | D/Es | D/Es | D | D/Es | D/Es | D/Es | D/Es | D/Es |
124 | VC-1 | D | D | D | D | D | D | D | D |
125 | JPEG | D | D/E | D/E | D/E | D/E | D/E | D/E | D/E |
126 | VP8 | D | D | D | D/Es | D/Es | D/Es | D/Es | D/Es |
127 | HEVC 8bit | | D/Es | D/Es | D/Es | D/Es | D/Es | D/Es | D/E/Es |
128 | HEVC 8bit 422 | | | | | | | | D/Es |
129 | HEVC 8bit 444 | | | | | | | | D/E |
130 | HEVC 10bit | | | D | D/Es | D/Es | D/Es | D/Es | D/E/Es |
131 | HEVC 10bit 422 | | | | | | | | D/Es |
132 | HEVC 10bit 444 | | | | | | | | D/E |
133 | VP9 8bit | | | D | D | D | D | D | D/E |
134 | VP9 8bit 444 | | | | | | | | D/E |
135 | VP9 10bit | | | | D | D | D | D | D/E |
136 | VP9 10bit 444 | | | | | | | | D/E |
137
138 D - HW Decoding
139
140 E - HW Encoding, Low Power Encoding
141
142 Es - HW + Shader Encoding
119 * D - Hardware Decoding
120 * E - Hardware Encoding, Low Power Encoding(VDEnc/Huc)
121 * Es - Hardware(PAK) + Shader(media kernel+VME) Encoding
143122
144123 \* ICL encoding is pending on i915 support on upstream, for more information, please check [Known Issues and Limitations #5](https://github.com/intel/media-driver/blob/master/README.md#known-issues-and-limitations).
145124
125 For more information, please refer to
126 * [Media Features Summary](https://github.com/intel/media-driver/blob/master/docs/media_features.md#media-features-summary)
127 * [Supported Decoding Output Format and Max Resolution](https://github.com/intel/media-driver/blob/master/docs/media_features.md#supported-decoding-output-format-and-max-resolution)
128 * [Supported Encoding Input Format and Max Resolution](https://github.com/intel/media-driver/blob/master/docs/media_features.md#supported-encoding-input-format-and-max-resolution)
146129
147 | Video Processing | BDW | SKL | BXT/APL | KBL | CFL | WHL | CML | ICL |
148 |---|---|---|---|---|---|---|---|---|
149 | Blending | Y | Y | Y | Y | Y | Y | Y | Y |
150 | CSC (Color Space Conversion) | Y | Y | Y | Y | Y | Y | Y | Y |
151 | De-interlace | Y | Y | Y | Y | Y | Y | Y | Y |
152 | De-noise | Y | Y | Y | Y | Y | Y | Y | Y |
153 | Luma Key | Y | Y | Y | Y | Y | Y | Y | Y |
154 | Mirroring | Y | Y | Y | Y | Y | Y | Y | Y |
155 | ProcAmp (brightness,contrast,hue,saturation) | Y | Y | Y | Y | Y | Y | Y | Y |
156 | Rotation | Y | Y | Y | Y | Y | Y | Y | Y |
157 | Scaling | Y | Y | Y | Y | Y | Y | Y | Y |
158 | Sharpening | Y | Y | Y | Y | Y | Y | Y | Y |
159 | STD/E (Skin Tone Detect & Enhancement) | Y | Y | Y | Y | Y | Y | Y | Y |
160 | TCC (Total Color Control) | Y | Y | Y | Y | Y | Y | Y | Y |
161 | Color fill | Y | Y | Y | Y | Y | Y | Y | Y |
162 | Chroma Siting | | Y | Y | Y | Y | Y | Y | Y |
163 | HDR10 Tone Mapping | | | | | | | | Y |
130 ### Video Processing Features
164131
165 For detail feature information, you can access [Media Features](https://github.com/intel/media-driver/blob/master/docs/media_features.md).
132 | Features | Build Types | BDW | SKL | BXT/APL | KBL | CFL | WHL | CML | ICL |
133 |---|---|---|---|---|---|---|---|---|---|
134 | Blending | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>Yes</i> |
135 | CSC<br>(Color Space Conversion) | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>Yes</i> |
136 | De-interlace | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>Yes</i> |
137 | De-noise | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> |
138 | Luma Key | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>Yes</i> |
139 | Mirroring | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>Yes</i> |
140 | ProcAmp<br>(brightness,contrast,hue,saturation) | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>Yes</i> |
141 | Rotation | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>Yes</i> |
142 | Scaling | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>Yes</i> |
143 | Sharpening | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>Yes</i> |
144 | STD/E<br>(Skin Tone Detect & Enhancement) | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> |
145 | TCC<br>(Total Color Control) | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> |
146 | Color fill | <u>Full Feature</u><br><i>Free Kernel</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>Yes</i> |
147 | Chroma Siting | <u>Full Feature</u><br><i>Free Kernel</i> | &nbsp;<br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> | <u>Yes</u><br><i>Yes</i> |
148 | HDR10 Tone Mapping | <u>Full Feature</u><br><i>Free Kernel</i> | &nbsp;<br><i>&nbsp;</i> | &nbsp;<br><i>&nbsp;</i> | &nbsp;<br><i>&nbsp;</i> | &nbsp;<br><i>&nbsp;</i> | &nbsp;<br><i>&nbsp;</i> | &nbsp;<br><i>&nbsp;</i> | &nbsp;<br><i>&nbsp;</i> | <u>Yes</u><br><i>&nbsp;</i> |
149
150 For more feature information, please refer to [Supported video processing csc/scaling format](https://github.com/intel/media-driver/blob/master/docs/media_features.md#supported-video-processing-cscscaling-format)
166151
167152
168 ### Features in Open Source Build
153 ### Build Options
169154
170 | CODEC | BDW | SKL | BXT/APL | KBL | CFL | WHL | CML | ICL* |
171 |---|---|---|---|---|---|---|---|---|
172 | AVC | D | D/E | D/E | D/E | D/E | D/E | D/E | D/E |
173 | MPEG-2 | D | D | D | D | D | D | D | D |
174 | VC-1 | | | | | | | | |
175 | JPEG | D | D/E | D/E | D/E | D/E | D/E | D/E | D/E |
176 | VP8 | D | D | D | D | D | D | D | D |
177 | HEVC 8bit | | D | D | D | D | D | D | D/E |
178 | HEVC 8bit 422 | | | | | | | | D |
179 | HEVC 8bit 444 | | | | | | | | D/E |
180 | HEVC 10bit | | | D | D | D | D | D | D/E |
181 | HEVC 10bit 422 | | | | | | | | D |
182 | HEVC 10bit 444 | | | | | | | | D/E |
183 | VP9 8bit | | | D | D | D | D | D | D/E |
184 | VP9 8bit 444 | | | | | | | | D/E |
185 | VP9 10bit | | | | D | D | D | D | D/E |
186 | VP9 10bit 444 | | | | | | | | D/E |
155 You could follow below build options to enable these two builds.
156 * **Full Feature Build**: ENABLE_KERNELS=ON(Default) ENABLE_NONFREE_KERNELS=ON(Default)
157 * **Free Kernel Build**: ENABLE_KERNELS=ON ENABLE_NONFREE_KERNELS=OFF
158 * If trying to use pre-built open source kernel binaries, please add BUILD_KERNELS=OFF(Default).
159 * If trying to rebuild open source kernel from source code, please add BUILD_KERNELS=ON.
187160
188 D - HW Decoding
189
190 E - HW Encoding, Low Power Encoding
191
192 \* ICL encoding is pending on i915 support on upstream, for more information, please check [Known Issues and Limitations #5](https://github.com/intel/media-driver/blob/master/README.md#known-issues-and-limitations).
193
194
195 | Video Processing | BDW | SKL | BXT/APL | KBL | CFL | WHL | CML | ICL |
196 |---|---|---|---|---|---|---|---|---|
197 | Blending | | | | | | | | Y |
198 | CSC (Color Space Conversion) | | | | | | | | Y |
199 | De-interlace | | | | | | | | Y |
200 | Luma Key | | | | | | | | Y |
201 | Mirroring | | | | | | | | Y |
202 | ProcAmp (brightness,contrast,hue,saturation) | | | | | | | | Y |
203 | Rotation | | | | | | | | Y |
204 | Scaling | | | | | | | | Y |
205 | Sharpening | | | | | | | | Y |
206 | Color fill | | | | | | | | Y |
207 | Chroma Siting | | | | | | | | Y |
208161
209162
210163 ## Known Issues and Limitations
212165 1. Intel(R) Media Driver for VAAPI is recommended to be built against gcc compiler v6.1
213166 or later, which officially supported C++11.
214167
215 2. SKL: Green or other incorrect color will be observed in output frames when using YV12/I420 as input format for csc/scaling/blending/rotation, etc. on Ubuntu 16.04 stock (with kernel 4.10). The issue can be addressed with the kernel patch: WaEnableYV12BugFixInHalfSliceChicken7 [commit 0b71cea29fc29bbd8e9dd9c641fee6bd75f6827](https://cgit.freedesktop.org/drm-tip/commit/?id=0b71cea29fc29bbd8e9dd9c641fee6bd75f68274)
168 2. SKL: Green or other incorrect color will be observed in output frames when using YV12/I420 as input format for csc/scaling/blending/rotation, etc. on Ubuntu 16.04 stock (with kernel 4.10). The issue can be addressed with the kernel patch: [WaEnableYV12BugFixInHalfSliceChicken7](https://cgit.freedesktop.org/drm-tip/commit/?id=0b71cea29fc29bbd8e9dd9c641fee6bd75f68274)
216169
217 3. HuC firmware is needed for AVC low power encoding bitrate control, including CBR, VBR, etc. As of now, HuC firmware support is disabled in Linux kernels by default. Please, refer to i915 kernel mode driver documentation to learn how to enable it. Mind that HuC firmware support presents in the following kernels for the specified platforms:
170 3. HuC firmware is needed for AVC/HEVC/VP9 low power encoding bitrate control, including CBR, VBR, etc. As of now, HuC firmware support is disabled in Linux kernels by default. Please, refer to i915 kernel mode driver documentation to learn how to enable it. Mind that HuC firmware support presents in the following kernels for the specified platforms:
218171 * APL/KBL: starting from kernel 4.11
219172 * CFL: starting from kernel 4.15
220173
147147 m_printEnabled ( false),
148148 m_printBufferSize( 0),
149149 m_createOption(createOption),
150 m_driverStoreEnabled(0)
150 m_driverStoreEnabled(0),
151 m_driFileDescriptor(0)
151152 {
152153
153154 // New Surface Manager
00 # Media Features Summary
11
2 ## Supported Decoding Format and Resolution
3
4 Supported decoding output format and max resolution:
2 ## Supported Decoding Output Format and Max Resolution
53
64 (2k=2048x2048, 4k=4096x4096, 8k=8192x8192, 16k=16384x16384)
75
8 | Codec | Type | BDW | SKL | BXT/APL | KBL | CFL | WHL | CNL | ICL |
6 | Codec | Type | BDW | SKL | BXT/APL | KBL | CFL | WHL | CML | ICL |
97 |------------|----------|------|------|---------|------|------|------|------|----------------|
108 | AVC |Output | NV12 | NV12 | NV12 | NV12 | NV12 | NV12 | NV12 | NV12 |
119 | |Max Res. | 4k | 4k | 4k | 4k | 4k | 4k | 4k | 4k |
2523 | VP9 10bit |Output | | | | P010 | P010 | P010 | P010 | P010/Y410 |
2624 | |Max Res. | | | | 8k | 8k | 8k | 8k | 8k |
2725
28 \* JPEG output format: NV12/411P/422H/422V/444P/BGRP/RGBP/YUY2/ARGB
26 * \* JPEG output format: NV12/411P/422H/422V/444P/BGRP/RGBP/YUY2/ARGB
2927
3028
31 ## Supported Encoding Format and Resolution
29 ## Supported Encoding Input Format and Max Resolution
3230
33 ### HW Encoding:
34
35 Supported input format and max resoultuion:
31 ### Hardware Encoding, Low Power Encoding(VDEnc/Huc)
3632
3733 (4k=4096x4096, 16k=16384x16384)
3834
39 | Codec | Type | BDW | SKL | BXT/APL | KBL | CFL | WHL | CNL | ICL*** |
35 | Codec | Type | BDW | SKL | BXT/APL | KBL | CFL | WHL | CML | ICL*** |
4036 |------------|------------|------|------|---------|------|-------|-------|------|----------------|
41 | AVC |Input | | | NV12 | More*| More* | More* | | More* |
42 | |Max Res. | | | 4k | 4k | 4k | 4k | | 4k |
37 | AVC |Input | | NV12 | NV12 | More*| More* | More* | More*| More* |
38 | |Max Res. | | 4k | 4k | 4k | 4k | 4k | 4k | 4k |
4339 | JPEG |Input/Output| |Note**| Note** |Note**|Note** |Note** |Note**| Note** |
4440 | |Max Res. | | 16k | 16k | 16k | 16k | 16k | 16k | 16k |
4541 | HEVC 8bit |Input | | | | | | | | NV12/AYUV |
5147 | VP9 10bit |Input | | | | | | | | P010/Y410 |
5248 | |Max Res. | | | | | | | | 8k |
5349
54 \* KBL/CFL/ICL AVC encoding supported input formats: NV12/YUY2/YUYV/YVYU/UYVY/AYUV/ARGB
55
56 \** JPEG encoding supports input format NV12/YUY2/UYVY/AYUV/ABGR/Y8 and output format YUV400/YUV420/YUV422H_2Y/YUV444/RGB24.
57
58 \*** ICL encoding is pending on i915 support on upstream, for more information, please check [Known Issues and Limitations #5](https://github.com/intel/media-driver/blob/master/README.md#known-issues-and-limitations).
50 * \* KBL/CFL/ICL AVC encoding supported input formats: NV12/YUY2/YUYV/YVYU/UYVY/AYUV/ARGB
51 * \** JPEG encoding supports input format NV12/YUY2/UYVY/AYUV/ABGR/Y8 and output format YUV400/YUV420/YUV422H_2Y/YUV444/RGB24.
52 * \*** ICL encoding is pending on i915 support on upstream, for more information, please check [Known Issues and Limitations #5](https://github.com/intel/media-driver/blob/master/README.md#known-issues-and-limitations).
5953
6054
61 ### HW+Shader Encoding:
62
63 Supported input format and max resolution:
55 ### Hardware(PAK) + Shader(media kernel+VME) Encoding
6456
6557 (2k=2048x2048, 4k=4096x4096, 8k=8192x8192)
6658
67 | Codec | Type | BDW | SKL | BXT/APL | KBL | CFL | WHL | CNL | ICL* |
59 | Codec | Type | BDW | SKL | BXT/APL | KBL | CFL | WHL | CML | ICL* |
6860 |------------|------------|------|------|---------|------|------|------|------|----------------|
6961 | AVC |Input | NV12 | NV12 | NV12 | NV12 | NV12 | NV12 | NV12 | NV12 |
7062 | |Max Res. | 4k | 4k | 4k | 4k | 4k | 4k | 4k | 4k |
7163 | MPEG2 |Input | NV12 | NV12 | | NV12 | NV12 | NV12 | NV12 | NV12 |
7264 | |Max Res. | 2k | 2k | | 2k | 2k | 2k | 2k | 2k |
73 | VP8 |Input | | | | | | NV12 | NV12 | NV12 |
74 | |Max Res. | | | | | | 4k | 4k | 4k |
65 | VP8 |Input | | | | NV12 | NV12 | NV12 | NV12 | NV12 |
66 | |Max Res. | | | | 4k | 4k | 4k | 4k | 4k |
7567 | HEVC 8bit |Input | | NV12 | NV12 | NV12 | NV12 | NV12 | NV12 | NV12/AYUV |
7668 | |Max Res. | | 8k | 8k | 8k | 8k | 8k | 8k | 8k |
77 | HEVC 10bit |Input | | | | | | | NV12 | P010/Y410 |
78 | |Max Res. | | | | | | | 8k | 8k |
69 | HEVC 10bit |Input | | | | | | | | P010/Y410 |
70 | |Max Res. | | | | | | | | 8k |
7971
80 \* ICL encoding is pending on i915 support on upstream, for more information, please check [Known Issues and Limitations #5](https://github.com/intel/media-driver/blob/master/README.md#known-issues-and-limitations).
72 * \* ICL encoding is pending on i915 support on upstream, for more information, please check [Known Issues and Limitations #5](https://github.com/intel/media-driver/blob/master/README.md#known-issues-and-limitations).
8173
8274 ## Supported Video Processing CSC/Scaling Format
8375
8577 |-----------------------|--------|------|------|------|------|------|------|------|------|------|
8678 | BDW | Input | Y | Y | Y | | Y | | | | |
8779 | | Output | Y | Y | Y | | Y | | | | |
88 |SKL/BXT/APL/KBL/CFL/WHL| Input | Y | Y | Y | Y | Y | | | | |
80 |SKL/BXT/KBL/CFL/WHL/CML| Input | Y | Y | Y | Y | Y | | | | |
8981 | | Output | Y | Y | Y | | Y | | | | |
9082 | ICL | Input | Y | Y | Y | Y | Y | Y | Y | Y | Y |
9183 | | Output | Y | Y | Y | Y | Y | | Y | Y | Y |
138138 m_nGPUFreqMax(0),
139139 m_vtuneOn(false),
140140 m_isDriverStoreEnabled(0),
141 m_notifierGroup(nullptr),
141142 m_hasGpuCopyKernel(false),
142143 m_hasGpuInitKernel(false)
143144 {
145 //Initialize the structures in the class
146 MOS_ZeroMemory(&m_halMaxValues, sizeof(m_halMaxValues));
147 MOS_ZeroMemory(&m_halMaxValuesEx, sizeof(m_halMaxValuesEx));
148 MOS_ZeroMemory(&m_cmHalCreateOption, sizeof(m_cmHalCreateOption));
149
144150 //Initialize Dev Create Param
145151 InitDevCreateOption( m_cmHalCreateOption, options );
146152
16561662 CM_QUEUE_CREATE_OPTION queueCreateOption)
16571663 {
16581664 INSERT_API_CALL_LOG();
1659 m_criticalSectionQueue.Acquire();
1665 CLock locker(m_criticalSectionQueue);
16601666
16611667 CmQueueRT *queueRT = nullptr;
16621668 if (CM_QUEUE_TYPE_RENDER == queueCreateOption.QueueType)
16691675 && gpuContext == queueCreateOption.GPUContext)
16701676 {
16711677 queue = (*iter);
1672 m_criticalSectionQueue.Release();
16731678 return CM_SUCCESS;
16741679 }
16751680 }
16811686 if (result != CM_SUCCESS)
16821687 {
16831688 CM_ASSERTMESSAGE("Failed to create the queue.");
1684 m_criticalSectionQueue.Release();
16851689 return result;
16861690 }
16871691 m_queue.push_back(queueRT);
16881692 queue = queueRT;
1689 m_criticalSectionQueue.Release();
16901693
16911694 return result;
16921695 }
90119011 if (batchBuffer->bLocked)
90129012 {
90139013 // Only happens in Error cases
9014 CM_CHK_NULL_RETURN_MOSERROR(batchBuffer->pPrivateData);
9015
9016 if (((PCM_HAL_BB_ARGS)batchBuffer->pPrivateData)->refCount == 1)
9014 if (batchBuffer->pPrivateData && ((PCM_HAL_BB_ARGS)batchBuffer->pPrivateData)->refCount == 1)
90179015 {
90189016 renderHal->pfnUnlockBB(renderHal, batchBuffer);
9017 }
9018 else if (batchBuffer->pPrivateData == nullptr)
9019 {
9020 eStatus = MOS_STATUS_NULL_POINTER;
90199021 }
90209022 }
90219023 }
8989 isDirty = false;
9090 isNull = false;
9191 unitVmeArraySize = 0;
92 surfIndex = nullptr;
93 aliasIndex = 0;
94 unitOffsetInPayloadOrig = 0;
95 isSet = false;
96 index = 0;
97 unitKindOrig = 0;
98 nCustomValue = 0;
99 surfaceKind = DATA_PORT_SURF;
100 unitSizeOrig = 0;
101 surfArrayArg = nullptr;
102 aliasCreated = false;
103
92104 }
93105 };
94106
119119 m_usingVirtualEngine(false),
120120 m_osSyncEvent(nullptr),
121121 m_trackerIndex(0),
122 m_fastTrackerIndex(0)
123 {
124
122 m_fastTrackerIndex(0),
123 m_streamIndex(0)
124 {
125 MOS_ZeroMemory(&m_mosVeHintParams, sizeof(m_mosVeHintParams));
125126 }
126127
127128 //*-----------------------------------------------------------------------------
550551 if ( !(MOS_QueryPerformanceCounter( (uint64_t*)&nEnqueueTime.QuadPart )))
551552 {
552553 CM_ASSERTMESSAGE("Error: Query performance counter failure.");
554 CmTaskInternal::Destroy(task);
553555 return CM_FAILURE;
554556 }
555557
628630 if ( !(MOS_QueryPerformanceCounter( (uint64_t*)&nEnqueueTime.QuadPart )))
629631 {
630632 CM_ASSERTMESSAGE("Error: Query performance counter failure.");
633 CmTaskInternal::Destroy(task);
631634 return CM_FAILURE;
632635 }
633636
739742 if ( !(MOS_QueryPerformanceCounter( (uint64_t*)&nEnqueueTime.QuadPart )) )
740743 {
741744 CM_ASSERTMESSAGE("Error: Query performance counter failure.");
745 CmTaskInternal::Destroy(task);
742746 return CM_FAILURE;
743747 }
744748
31413145 if ( !(MOS_QueryPerformanceCounter( (uint64_t*)&nEnqueueTime.QuadPart )) )
31423146 {
31433147 CM_ASSERTMESSAGE("Error: Query Performance counter failure.");
3144 return CM_FAILURE;
3148 hr = CM_FAILURE;
3149 goto finish;
31453150 }
31463151
31473152 CM_CHK_CMSTATUS_GOTOFINISH(CreateEvent(task, isEventVisible, taskDriverId, eventRT));
31623167 CM_CHK_CMSTATUS_GOTOFINISH(FlushTaskWithoutSync());
31633168
31643169 finish:
3165
3170 if (hr != CM_SUCCESS)
3171 {
3172 CmTaskInternal::Destroy(task);
3173 }
31663174 return hr;
31673175 }
31683176
169169 m_device(device),
170170 m_surfaceArraySize(0),
171171 m_surfaceArray(nullptr),
172 m_maxSurfaceIndexAllocated(0),
172173 m_surfaceSizes(nullptr),
173174 m_maxBufferCount(0),
174175 m_bufferCount(0),
192193 m_delayDestroyHead(nullptr),
193194 m_delayDestroyTail(nullptr)
194195 {
196 MOS_ZeroMemory(&m_surfaceBTIInfo, sizeof(m_surfaceBTIInfo));
195197 GetSurfaceBTIInfo();
196198 };
197199
17911791 void ** curTaskSurfResArray = nullptr;
17921792 uint32_t refSurfCnt = 0;
17931793 uint32_t *refSurfHandleArray = nullptr;
1794 CM_RETURN_CODE hr = CM_SUCCESS;
17941795
17951796 curTaskSurfResArray = (void **)MOS_AllocAndZeroMemory(sizeof(void *)*poolSize);
17961797 CM_CHK_NULL_RETURN_CMERROR(curTaskSurfResArray);
18071808
18081809 // get the last tracker
18091810 PCM_CONTEXT_DATA cmData = ( PCM_CONTEXT_DATA )m_cmDevice->GetAccelData();
1810 CM_CHK_NULL_RETURN_CMERROR(cmData);
1811 PCM_HAL_STATE state = cmData->cmHalState;
1812 CM_CHK_NULL_RETURN_CMERROR(state);
1811 PCM_HAL_STATE state = nullptr;
1812 CM_CHK_NULL_GOTOFINISH_CMERROR(cmData);
1813 state = cmData->cmHalState;
1814 CM_CHK_NULL_GOTOFINISH_CMERROR(state);
18131815
18141816 if (!m_isSurfaceUpdateDone)
18151817 {
18181820 if (m_surfaceArray[i])
18191821 {
18201822 CmSurface *surface = NULL;
1821 CM_CHK_CMSTATUS_RETURN(surfaceMgr->GetSurface(i, surface));
1823 CM_CHK_CMSTATUS_GOTOFINISH(surfaceMgr->GetSurface(i, surface));
18221824 if (surface == nullptr) // surface destroyed but not updated in kernel
18231825 {
18241826 continue;
18961898 }
18971899 else
18981900 {
1899 surfaceLock->Release();
1900 if (curTaskSurfResArray)
1901 {
1902 MOS_FreeMemory(curTaskSurfResArray);
1903 curTaskSurfResArray = nullptr;
1904 }
1905 return CM_INVALID_ARG_INDEX;
1901 hr = CM_INVALID_ARG_INDEX;
1902 goto finish;
19061903 }
19071904 break;
19081905
19151912 m_isSurfaceUpdateDone = true;
19161913 }
19171914
1918 surfaceLock->Release();
1919
19201915 // Check if there is any secure surface.
19211916 if (curTaskSurfCnt > 0 && state->osInterface && state->osInterface->osCpInterface)
19221917 {
19231918 state->osInterface->osCpInterface->PrepareResources(curTaskSurfResArray, curTaskSurfCnt, nullptr, 0);
19241919 }
19251920
1921 finish:
1922 surfaceLock->Release();
19261923 if (curTaskSurfResArray)
19271924 {
19281925 MOS_FreeMemory(curTaskSurfResArray);
19291926 curTaskSurfResArray = nullptr;
19301927 }
19311928
1932 return CM_SUCCESS;
1929 return hr;
19331930 }
19341931
19351932 #if CM_LOG_ON
3030 using namespace vISA;
3131
3232 ISAfile::ISAfile(const uint8_t *data, unsigned size) : version(0), data(data), end(data + size),
33 size(size), error(0), header(0), kernel_data_loaded(false), function_data_loaded(false) { }
33 size(size), error(0), header(0), kernel_data_loaded(false), function_data_loaded(false), errorIndex(0) { }
3434
3535 ISAfile::ISAfile(const ISAfile& other) {
3636 version = other.version;
3737 data = other.data;
3838 end = other.end;
3939 size = other.size;
40 delete[] error;
4140 char *perror = new char[std::strlen(other.error)];
4241 MOS_SecureMemcpy(perror, sizeof(perror), other.error, sizeof(other.error));
4342 error = perror;
19741974 MOS_ZeroMemory(&m_resAvcDmvBuffers, (sizeof(MOS_RESOURCE) * CODEC_AVC_NUM_DMV_BUFFERS));
19751975 MOS_ZeroMemory(&m_resInvalidRefBuffer, sizeof(MOS_RESOURCE));
19761976 MOS_ZeroMemory(&m_resMvcDummyDmvBuffer, (sizeof(MOS_RESOURCE) * 2));
1977 MOS_ZeroMemory(&m_destSurface, sizeof(MOS_SURFACE));
1978 MOS_ZeroMemory(&m_resSyncObjectWaContextInUse, sizeof(MOS_RESOURCE));
1979 MOS_ZeroMemory(&m_resSyncObjectVideoContextInUse, sizeof(MOS_RESOURCE));
19771980 m_refFrameSurface = nullptr;
19781981
19791982 m_vldSliceRecord = nullptr;
26472647 CodechalHwInterface * hwInterface,
26482648 CodechalDebugInterface *debugInterface,
26492649 PCODECHAL_STANDARD_INFO standardInfo) : CodechalDecode(hwInterface, debugInterface, standardInfo),
2650 m_minCtbSize(0),
2651 m_is10BitHevc(false),
2652 m_is12BitHevc(false),
2653 m_chromaFormatinProfile(0),
2654 m_shortFormatInUse(false),
2655 m_dataSize(0),
2656 m_dataOffset(0),
2657 m_numSlices(0),
26502658 m_is8BitFrameIn10BitHevc(false),
26512659 m_internalNv12RtIndexMapInitilized(false),
26522660 m_mfdDeblockingFilterRowStoreScratchBufferPicWidth(0),
26542662 m_saoLineBufferPicWidth(0),
26552663 m_mvBufferProgrammed(false),
26562664 m_dmemBufferIdx(0),
2665 m_dmemBufferSize(0),
2666 m_dmemTransferSize(0),
2667 m_dmemBufferProgrammed(false),
26572668 m_copyDataBufferSize(0),
2669 m_copyDataOffset(0),
26582670 m_copyDataBufferInUse(false),
2671 m_estiBytesInBitstream(0),
2672 m_curPicIntra(false),
26592673 m_mvBufferSize(0),
2674 m_hevcMvBufferIndex(0),
2675 m_frameIdx(0),
26602676 m_enableSf2DmaSubmits(false),
26612677 m_widthLastMaxAlloced(0),
26622678 m_heightLastMaxAlloced(0),
2663 m_ctbLog2SizeYMax(0)
2679 m_ctbLog2SizeYMax(0),
2680 m_hcpDecPhase(0)
26642681 {
26652682 CODECHAL_DECODE_FUNCTION_ENTER;
26662683
26792696 MOS_ZeroMemory(m_resDmemBuffer, sizeof(m_resDmemBuffer));
26802697 MOS_ZeroMemory(&m_resCopyDataBuffer, sizeof(m_resCopyDataBuffer));
26812698 MOS_ZeroMemory(&m_resSyncObjectWaContextInUse, sizeof(m_resSyncObjectWaContextInUse));
2682 MOS_ZeroMemory(&m_picMhwParams, sizeof(m_picMhwParams));
2699 MOS_ZeroMemory(&m_picMhwParams,sizeof(m_picMhwParams));
2700 MOS_ZeroMemory(&m_hevcPicParams,sizeof(m_hevcPicParams));
2701 MOS_ZeroMemory(&m_hevcSliceParams,sizeof(m_hevcSliceParams));
2702 MOS_ZeroMemory(&m_hevcIqMatrixParams,sizeof(m_hevcIqMatrixParams));
2703 MOS_ZeroMemory(&m_destSurface,sizeof(m_destSurface));
2704 MOS_ZeroMemory(&m_currPic,sizeof(m_currPic));
26832705
26842706 m_hcpInUse = true;
26852707 }
574574
575575 #ifdef _DECODE_PROCESSING_SUPPORTED
576576 // SFC
577 CodechalHevcSfcState *m_sfcState; //!< HEVC SFC State
577 CodechalHevcSfcState *m_sfcState = nullptr; //!< HEVC SFC State
578578 #endif
579579 PIC_LONG_FORMAT_MHW_PARAMS m_picMhwParams; //!< picture parameters
580580
6666 CodechalHwInterface * hwInterface,
6767 CodechalDebugInterface *debugInterface,
6868 PCODECHAL_STANDARD_INFO standardInfo) : CodechalDecode(hwInterface, debugInterface, standardInfo),
69 m_copiedDataBufferSize(0)
69 m_dataSize(0),
70 m_dataOffset(0),
71 m_copiedDataBufferSize(0),
72 m_nextCopiedDataOffset(0),
73 m_totalDataLength(0),
74 m_preNumScans(0),
75 m_copiedDataBufferInUse(false)
76
7077 {
7178 CODECHAL_DECODE_FUNCTION_ENTER;
7279
7380 MOS_ZeroMemory(&m_resCopiedDataBuffer, sizeof(m_resCopiedDataBuffer));
81 MOS_ZeroMemory(&m_destSurface, sizeof(m_destSurface));
82 MOS_ZeroMemory(&m_jpegHuffmanTable, sizeof(m_jpegHuffmanTable));
83 MOS_ZeroMemory(&m_resDataBuffer, sizeof(m_resDataBuffer));
84 MOS_ZeroMemory(&m_resSyncObjectWaContextInUse, sizeof(m_resSyncObjectWaContextInUse));
85 MOS_ZeroMemory(&m_resSyncObjectVideoContextInUse, sizeof(m_resSyncObjectVideoContextInUse));
7486 }
7587
7688 MOS_STATUS CodechalDecodeJpeg::InitializeBeginFrame()
139139 #endif
140140
141141 MOS_SURFACE m_destSurface; //!< Pointer to MOS_SURFACE of render surface
142 CodecDecodeJpegPicParams *m_jpegPicParams; //!< Picture parameter for JPEG
142 CodecDecodeJpegPicParams *m_jpegPicParams = nullptr; //!< Picture parameter for JPEG
143143
144144 #if USE_CODECHAL_DEBUG_TOOL
145145 MOS_STATUS DumpIQParams(
223223 protected:
224224 uint32_t m_dataSize; //!< Data size of the bitstream
225225 uint32_t m_dataOffset; //!< Data offset of the bitstream
226 CodecDecodeJpegScanParameter * m_jpegScanParams; //!< Scan parameter for JPEG
227 CodecJpegQuantMatrix * m_jpegQMatrix; //!< QMatrix for JPEG
226 CodecDecodeJpegScanParameter * m_jpegScanParams = nullptr; //!< Scan parameter for JPEG
227 CodecJpegQuantMatrix * m_jpegQMatrix = nullptr; //!< QMatrix for JPEG
228228 PCODECHAL_DECODE_JPEG_HUFFMAN_TABLE m_jpegHuffmanTable; //!< Huffman table for JPEG
229229
230230 MOS_RESOURCE m_resDataBuffer; //!< Handle of bitstream buffer
4040 //!
4141 //! \brief Constructor
4242 //!
43 CodechalJpegSfcState() { CODECHAL_HW_FUNCTION_ENTER; };
43 CodechalJpegSfcState()
44 {
45 CODECHAL_HW_FUNCTION_ENTER;
46 MOS_ZeroMemory(&m_sfcInSurface, sizeof(m_sfcInSurface));
47 };
4448 //!
4549 //! \brief Destructor
4650 //!
47984798 CodechalHwInterface *hwInterface,
47994799 CodechalDebugInterface* debugInterface,
48004800 PCODECHAL_STANDARD_INFO standardInfo) :
4801 CodechalDecode(hwInterface, debugInterface, standardInfo)
4801 CodechalDecode(hwInterface, debugInterface, standardInfo),
4802 m_huCCopyInUse(0)
48024803 {
48034804 CODECHAL_DECODE_FUNCTION_ENTER;
48044805
48114812 MOS_ZeroMemory(&m_itObjectBatchBuffer, sizeof(m_itObjectBatchBuffer));
48124813 MOS_ZeroMemory(m_unequalFieldSurface, sizeof(m_unequalFieldSurface));
48134814 MOS_ZeroMemory(m_unequalFieldRefListIdx, sizeof(m_unequalFieldRefListIdx));
4815 MOS_ZeroMemory(&m_destSurface, sizeof(m_destSurface));
4816 MOS_ZeroMemory(&m_deblockSurface, sizeof(m_deblockSurface));
4817 MOS_ZeroMemory(&m_resDataBuffer, sizeof(m_resDataBuffer));
4818 MOS_ZeroMemory(&m_resBitplaneBuffer, sizeof(m_resBitplaneBuffer));
4819 MOS_ZeroMemory(&m_resSyncObjectWaContextInUse, sizeof(m_resSyncObjectWaContextInUse));
4820 MOS_ZeroMemory(&m_resSyncObjectVideoContextInUse, sizeof(m_resSyncObjectVideoContextInUse));
4821
48144822 }
48154823
48164824 #if USE_CODECHAL_DEBUG_TOOL
14971497 m_picHeightInMbLastMaxAlloced(0),
14981498 m_shortFormatInUse(false),
14991499 m_dataSize(0),
1500 m_dataOffset(0),
15001501 m_vp8PicParams(nullptr),
15011502 m_vp8IqMatrixParams(nullptr),
15021503 m_presLastRefSurface(nullptr),
493493 //!
494494 void QuantSetup();
495495
496 const uint8_t *m_bufferEnd; //!< Pointer to Data Buffer End
497 const uint8_t *m_buffer; //!< Pointer to Data Buffer
498 int32_t m_count; //!< Bits Count for Bitstream Buffer
499 uint32_t m_value; //!< Entropy Value
500 uint32_t m_range; //!< Entropy Range
496 const uint8_t *m_bufferEnd = nullptr; //!< Pointer to Data Buffer End
497 const uint8_t *m_buffer = nullptr; //!< Pointer to Data Buffer
498 int32_t m_count = 0; //!< Bits Count for Bitstream Buffer
499 uint32_t m_value = 0; //!< Entropy Value
500 uint32_t m_range = 0; //!< Entropy Range
501501 };
502502
503503 using PVP8_ENTROPY_STATE = Vp8EntropyState*;
162162 CodechalHwInterface * hwInterface,
163163 CodechalDebugInterface *debugInterface,
164164 PCODECHAL_STANDARD_INFO standardInfo) : CodechalDecode(hwInterface, debugInterface, standardInfo),
165 m_usFrameWidthAlignedMinBlk(0),
166 m_usFrameHeightAlignedMinBlk(0),
167 m_vp9DepthIndicator(0),
168 m_chromaFormatinProfile(0),
169 m_dataSize(0),
170 m_dataOffset(0),
171 m_frameCtxIdx(0),
165172 m_curMvTempBufIdx(0),
166173 m_colMvTempBufIdx(0),
167174 m_copyDataBufferSize(0),
175 m_copyDataOffset(0),
168176 m_copyDataBufferInUse(false),
177 m_hcpDecPhase(0),
169178 m_prevFrmWidth(0),
170179 m_prevFrmHeight(0),
171180 m_allocatedWidthInSb(0),
172181 m_allocatedHeightInSb(0),
173182 m_mvBufferSize(0),
183 m_resetSegIdBuffer(false),
174184 m_pendingResetPartial(0),
175 m_saveInterProbs(0)
185 m_saveInterProbs(0),
186 m_fullProbBufferUpdate(false),
187 m_dmemBufferSize(0)
176188 {
177189 CODECHAL_DECODE_FUNCTION_ENTER;
178190
196208 MOS_ZeroMemory(&m_resSegmentIdBuffReset, sizeof(m_resSegmentIdBuffReset));
197209 MOS_ZeroMemory(&m_resHucSharedBuffer, sizeof(m_resHucSharedBuffer));
198210 MOS_ZeroMemory(&m_picMhwParams, sizeof(m_picMhwParams));
211 MOS_ZeroMemory(&m_destSurface, sizeof(m_destSurface));
212 MOS_ZeroMemory(&m_lastRefSurface, sizeof(m_lastRefSurface));
213 MOS_ZeroMemory(&m_goldenRefSurface, sizeof(m_goldenRefSurface));
214 MOS_ZeroMemory(&m_altRefSurface, sizeof(m_altRefSurface));
215 MOS_ZeroMemory(&m_resDataBuffer, sizeof(m_resDataBuffer));
216 MOS_ZeroMemory(&m_resCoefProbBuffer, sizeof(m_resCoefProbBuffer));
217 MOS_ZeroMemory(&m_resSyncObject, sizeof(m_resSyncObject));
218 MOS_ZeroMemory(&m_resSyncObjectWaContextInUse, sizeof(m_resSyncObjectWaContextInUse));
219 MOS_ZeroMemory(&m_resSyncObjectVideoContextInUse, sizeof(m_resSyncObjectVideoContextInUse));
199220
200221 m_prevFrameParams.value = 0;
201222
201201 uint8_t m_chromaFormatinProfile; //!< Chroma format with current profilce
202202 uint32_t m_dataSize; //!< Data size
203203 uint32_t m_dataOffset; //!< Date offset
204 PCODEC_VP9_PIC_PARAMS m_vp9PicParams; //!< Pointer to VP9 picture parameter
205 PCODEC_VP9_SEGMENT_PARAMS m_vp9SegmentParams; //!< Pointer to VP9 segment parameter
206 PCODEC_VP9_SLICE_PARAMS m_vp9SliceParams; //!< Pointer to VP9 slice parameter
204 PCODEC_VP9_PIC_PARAMS m_vp9PicParams = nullptr; //!< Pointer to VP9 picture parameter
205 PCODEC_VP9_SEGMENT_PARAMS m_vp9SegmentParams = nullptr; //!< Pointer to VP9 segment parameter
206 PCODEC_VP9_SLICE_PARAMS m_vp9SliceParams = nullptr; //!< Pointer to VP9 slice parameter
207207 MOS_SURFACE m_destSurface; //!< MOS_SURFACE of render surface
208 PMOS_RESOURCE m_presLastRefSurface; //!< Pointer to last reference surface
209 PMOS_RESOURCE m_presGoldenRefSurface; //!< Pointer to golden reference surface
210 PMOS_RESOURCE m_presAltRefSurface; //!< Pointer to alternate reference surface
208 PMOS_RESOURCE m_presLastRefSurface = nullptr; //!< Pointer to last reference surface
209 PMOS_RESOURCE m_presGoldenRefSurface = nullptr; //!< Pointer to golden reference surface
210 PMOS_RESOURCE m_presAltRefSurface = nullptr; //!< Pointer to alternate reference surface
211211 MOS_SURFACE m_lastRefSurface; //!< MOS_SURFACE of last reference surface
212212 MOS_SURFACE m_goldenRefSurface; //!< MOS_SURFACE of golden reference surface
213213 MOS_SURFACE m_altRefSurface; //!< MOS_SURFACE of alternate reference surface
228228 {
229229 CODECHAL_DECODE_FUNCTION_ENTER;
230230
231 MOS_ZeroMemory(&m_dummyReference, sizeof(MOS_SURFACE));
232
231233 CODECHAL_DECODE_CHK_NULL_NO_STATUS_RETURN(hwInterface);
232234 CODECHAL_DECODE_CHK_NULL_NO_STATUS_RETURN(hwInterface->GetOsInterface());
233235 CODECHAL_DECODE_CHK_NULL_NO_STATUS_RETURN(hwInterface->GetMiInterface());
250252
251253 m_mode = standardInfo->Mode;
252254 m_isHybridDecoder = standardInfo->bIsHybridCodec ? true : false;
253
254 MOS_ZeroMemory(&m_dummyReference, sizeof(MOS_SURFACE));
255255 }
256256
257257 MOS_STATUS CodechalDecode::SetGpuCtxCreatOption(
154154 PCODECHAL_ENCODE_BINDING_TABLE_GENERIC m_brcKernelBindingTable = nullptr; //!< BRC kernel binding table
155155 PMOS_SURFACE m_brcDistortion = nullptr; //!< Pointer to BRC distortion surface
156156 HevcEncBrcBuffers m_brcBuffers; //!< BRC buffers
157 uint32_t m_numBrcKrnStates; //!< Number of BRC kernel states
157 uint32_t m_numBrcKrnStates = 0; //!< Number of BRC kernel states
158158 uint8_t m_slidingWindowSize = 0; //!< Sliding window size in number of frames
159159 bool m_roiRegionSmoothEnabled = false; //!< ROI region smooth transition enable flag
160160 HEVC_BRC_FRAME_TYPE m_currFrameBrcLevel = HEVC_BRC_FRAME_TYPE_I; //!< frame brc level
799799 struct CODECHAL_ENCODE_BUFFER
800800 {
801801 MOS_RESOURCE sResource;
802 uint32_t dwSize;
802 uint32_t dwSize = 0;
803803 };
804804 using PCODECHAL_ENCODE_BUFFER = CODECHAL_ENCODE_BUFFER*;
805805
208208 public:
209209 static constexpr uint32_t m_hucCmdInitializerKernelDescriptor = 14; //!< VDBox Huc cmd initializer kernel descriptoer
210210
211 bool m_pakOnlyPass;
212 bool m_acqpEnabled;
213 bool m_brcEnabled;
214 bool m_streamInEnabled;
215 bool m_roundingEnabled;
216 bool m_panicEnabled;
217 bool m_roiStreamInEnabled;
211 bool m_pakOnlyPass = false;
212 bool m_acqpEnabled = false;
213 bool m_brcEnabled = false;
214 bool m_streamInEnabled = false;
215 bool m_roundingEnabled = false;
216 bool m_panicEnabled = false;
217 bool m_roiStreamInEnabled = false;
218218 int32_t m_currentPass = 0;
219219 int32_t m_cmdCount = 0 ;
220220
230230 //VP9 related changes
231231 Vp9CmdInitializerParams m_vp9Params;
232232 #endif
233 CodechalHwInterface* m_hwInterface;
233 CodechalHwInterface* m_hwInterface = nullptr;
234234 MOS_RESOURCE m_cmdInitializerDmemBuffer[CODECHAL_ENCODE_RECYCLED_BUFFER_NUM][3];
235235 MOS_RESOURCE m_cmdInitializerDataBuffer[CODECHAL_ENCODE_RECYCLED_BUFFER_NUM][3];
236 MOS_RESOURCE m_cmdInitializerDysScalingDmemBuffer;
237 MOS_RESOURCE m_cmdInitializerDysScalingDataBuffer;
236 MOS_RESOURCE m_cmdInitializerDysScalingDmemBuffer = {0};
237 MOS_RESOURCE m_cmdInitializerDysScalingDataBuffer = {0};
238238
239239 static constexpr uint32_t CODECHAL_CMD1_SIZE = 120;
240240 static constexpr uint32_t CODECHAL_CMD2_SIZE = 148;
177177 }
178178
179179 MediaMemDecompState::MediaMemDecompState() :
180 MediaMemDecompBaseState()
180 MediaMemDecompBaseState(),
181 m_currCmdBufId(0)
181182 {
182183 MHW_FUNCTION_ENTER;
183184 m_stateHeapSettings.m_ishBehavior = HeapManager::Behavior::clientControlled;
210210 bool m_renderContextUsesNullHw = false; //!< Indicate if render context use null hw or not
211211 bool m_disableDecodeSyncLock = false; //!< Indicate if decode sync lock disabled or not
212212 bool m_disableLockForTranscode = false; //!< Indicate if lock is disabled for transcode or not
213 uint32_t *m_cmdBufIdGlobal; //!< Pointer to command buffer global Id
213 uint32_t *m_cmdBufIdGlobal = nullptr; //!< Pointer to command buffer global Id
214214 MOS_RESOURCE m_resCmdBufIdGlobal; //!< Resource for command buffer global Id
215215 uint32_t m_currCmdBufId; //!< Current command buffer Id
216216 };
144144 MOS_RESOURCE m_vdencReadBatchBuffer[CODECHAL_ENCODE_RECYCLED_BUFFER_NUM][CODECHAL_VDENC_BRC_NUM_OF_PASSES]; //!< VDEnc read batch buffer
145145 MOS_RESOURCE m_vdencGroup3BatchBuffer[CODECHAL_ENCODE_RECYCLED_BUFFER_NUM][CODECHAL_VDENC_BRC_NUM_OF_PASSES]; //!< VDEnc read batch buffer for Group3
146146 MOS_RESOURCE m_vdencBrcDbgBuffer; //!< VDEnc brc debug buffer
147 uint32_t m_deltaQpRoiBufferSize; //!< VDEnc DeltaQp for ROI buffer size
148 uint32_t m_brcRoiBufferSize; //!< BRC ROI input buffer size
147 uint32_t m_deltaQpRoiBufferSize = 0; //!< VDEnc DeltaQp for ROI buffer size
148 uint32_t m_brcRoiBufferSize = 0; //!< BRC ROI input buffer size
149149
150150 // Batch Buffer for VDEnc
151151 MHW_BATCH_BUFFER m_vdenc2ndLevelBatchBuffer[CODECHAL_ENCODE_RECYCLED_BUFFER_NUM]; //!< VDEnc 2nd level batch buffer
167167
168168 PCODECHAL_CMD_INITIALIZER m_hucCmdInitializer = nullptr;
169169
170 MOS_RESOURCE m_resDelayMinus;
171 uint32_t m_numDelay;
170 MOS_RESOURCE m_resDelayMinus = {0};
171 uint32_t m_numDelay = 0;
172172
173173 protected:
174174 //!
436436 //! to the udpated value may be re-used.
437437 uint32_t *m_trackerData = nullptr;
438438 PMOS_INTERFACE m_osInterface = nullptr; //!< OS interface used for managing graphics resources
439 bool m_lockHeapsOnAllocate; //!< All heaps allocated with the keep locked flag.
439 bool m_lockHeapsOnAllocate = false; //!< All heaps allocated with the keep locked flag.
440440
441441 //! \brief Persistent storage for the sorted sizes used during AcquireSpace()
442442 std::list<SortedSizePair> m_sortedSizes;
3131 PMOS_INTERFACE osInterface)
3232 {
3333 MHW_FUNCTION_ENTER;
34
35 MOS_ZeroMemory(&UseGlobalGtt, sizeof(UseGlobalGtt));
36 MOS_ZeroMemory(&MediaResetParam, sizeof(MediaResetParam));
3437
3538 if (cpInterface == nullptr || osInterface == nullptr)
3639 {
728728 MOS_STATUS (*AddResourceToCmd) (
729729 PMOS_INTERFACE pOsInterface,
730730 PMOS_COMMAND_BUFFER cmdBuffer,
731 PMHW_RESOURCE_PARAMS params);
731 PMHW_RESOURCE_PARAMS params) = nullptr;
732732
733733 //!
734734 //! \brief Helper function to get GTT type (PGTT or GGTT)
757757 } MediaResetParam;
758758
759759 //! \brief Mmio registers address
760 MHW_MI_MMIOREGISTERS m_mmioRegisters; //!< mfx mmio registers
760 MHW_MI_MMIOREGISTERS m_mmioRegisters = {}; //!< mfx mmio registers
761761
762762 };
763763
3131 {
3232 MHW_FUNCTION_ENTER;
3333
34 MOS_ZeroMemory(&m_outputSurfCtrl, sizeof(m_outputSurfCtrl));
35 MOS_ZeroMemory(&m_avsLineBufferCtrl, sizeof(m_avsLineBufferCtrl));
36 MOS_ZeroMemory(&m_iefLineBufferCtrl, sizeof(m_iefLineBufferCtrl));
37 pfnAddResourceToCmd = nullptr;
38
3439 if (pOsInterface == nullptr)
3540 {
3641 MHW_ASSERTMESSAGE("Invalid input pointers provided");
4348 }
4449
4550 m_osInterface = pOsInterface;
46 memset(&m_outputSurfCtrl, 0, sizeof(m_outputSurfCtrl));
47 memset(&m_avsLineBufferCtrl, 0, sizeof(m_avsLineBufferCtrl));
48 memset(&m_iefLineBufferCtrl, 0, sizeof(m_iefLineBufferCtrl));
4951
5052 if (m_osInterface->bUsesGfxAddress)
5153 {
364364 {
365365 MHW_FUNCTION_ENTER;
366366
367 MOS_ZeroMemory(&m_veboxSettings, sizeof(m_veboxSettings));
368 pfnAddResourceToCmd = nullptr;
369
367370 if (pOsInterface == nullptr)
368371 {
369372 MHW_ASSERTMESSAGE("Invalid input pointers provided");
370373 return;
371374 }
372375 m_osInterface = pOsInterface;
373 memset(&m_veboxSettings, 0, sizeof(m_veboxSettings));
374376
375377 if (m_osInterface->bUsesGfxAddress)
376378 {
113113
114114 cmd.DW1.SurfaceId = params->ucSurfaceStateId;
115115 cmd.DW1.SurfacePitchMinus1 = params->psSurface->dwPitch - 1;
116
117 /* Handling of reconstructed surface is different for Y410 & AYUV formats */
118 if ((params->ucSurfaceStateId != CODECHAL_HCP_SRC_SURFACE_ID) &&
119 (params->psSurface->Format == Format_Y410))
120 cmd.DW1.SurfacePitchMinus1 = params->psSurface->dwPitch / 2 - 1;
121
122 if ((params->ucSurfaceStateId != CODECHAL_HCP_SRC_SURFACE_ID) &&
123 (params->psSurface->Format == Format_AYUV))
124 cmd.DW1.SurfacePitchMinus1 = params->psSurface->dwPitch / 4 - 1;
116125
117126 cmd.DW2.YOffsetForUCbInPixel = params->psSurface->UPlaneOffset.iYOffset;
118127
4141 //!
4242 //! \brief Constructor
4343 //!
44 GpuContext(){}
44 GpuContext()
45 {
46 m_nodeOrdinal = MOS_GPU_NODE_MAX;
47 m_gpuContextHandle = 0;
48 m_gpuContext = MOS_GPU_CONTEXT_RENDER;
49 }
4550
4651 //!
4752 //! \brief Destructor
105105
106106 MediaPerfProfiler::MediaPerfProfiler()
107107 {
108 MOS_ZeroMemory(&m_perfStoreBuffer, sizeof(m_perfStoreBuffer));
108109 m_perfDataIndex = 0;
109110 m_ref = 0;
110111 m_initialized = false;
111112
112113 m_profilerEnabled = 0;
113
114
114115 MOS_USER_FEATURE_VALUE_DATA userFeatureData;
115116 // Check whether profiler is enabled
116117 MOS_ZeroMemory(&userFeatureData, sizeof(userFeatureData));
623623 //!
624624 VphalHwStateDumper(PRENDERHAL_INTERFACE pRenderHal)
625625 : m_renderHal(pRenderHal),
626 iDebugStage(0),
627 iPhase(0),
626628 m_osInterface(pRenderHal->pOsInterface),
627629 m_hwSizes(pRenderHal->pHwSizes),
628630 m_stateHeap(pRenderHal->pStateHeap),
105105 mBatchTask(nullptr),
106106 mHasBatchedTask(false),
107107 mConditionalBatchBuffer(nullptr),
108 mCondParam({ 0 })
108 mCondParam({ 0 }),
109 mEventListener(nullptr)
109110 {
110111 VPHAL_RENDER_ASSERT(sOsContext);
111112
4848 m_pSkuTable(nullptr),
4949 m_pWaTable(nullptr),
5050 m_bDisableRender(false),
51 m_bSingleSlice(false),
5152 m_pPerfData(pPerfData),
5253 m_reporting(nullptr)
5354 {
42124212 {
42134213 FFDISurfaces[i] = nullptr;
42144214 }
4215 VeboxRGBHistogram = {};
42154216 VeboxStatisticsSurface = {}; //!< Statistics Surface for VEBOX
42164217 RenderHalVeboxStatisticsSurface = {}; //!< Statistics Surface for VEBOX for MHW
42174218 #if VEBOX_AUTO_DENOISE_SUPPORTED
42954296 bDisableTemporalDenoiseFilter = false; //!< Temporal denoise filter disable flag - read from User feature keys
42964297 bDisableTemporalDenoiseFilterUserKey = false; //!< Backup temporal denoise filter disable flag - read from User feature keys
42974298
4299 uiCurrentChannel = 0;
4300
42984301 RenderGpuContext = pOsInterface ? (pOsInterface->CurrentGpuContextOrdinal) : MOS_GPU_CONTEXT_RENDER;
42994302
4300 m_hvsDenoiser = nullptr;
4303 Vebox3DLookUpTables = { };
4304 SfcTempSurface = { };
4305
4306 m_hvsDenoiser = nullptr;
4307 m_hvsKernelBinary = nullptr;
4308 m_hvsKernelBinarySize = 0;
43014309 }
43024310
43034311 VPHAL_VEBOX_STATE::~VPHAL_VEBOX_STATE()
45014509 }
45024510 m_pVeboxIecpParams->Init();
45034511
4504 bColorPipe = false;
4505 bIECP = false;
4506 bProcamp = false;
4507
45084512 // Flags
4509 bRefValid = false;
4510 bSameSamples = false;
4511 bProgressive = false;
4512 bDenoise = false;
4513 bRefValid = false;
4514 bSameSamples = false;
4515 bProgressive = false;
4516 bDenoise = false;
45134517 #if VEBOX_AUTO_DENOISE_SUPPORTED
4514 bAutoDenoise = false;
4518 bAutoDenoise = false;
45154519 #endif
4516 bChromaDenoise = false;
4517 bOutOfBound = false;
4518 bVDIWalker = false;
4519
4520 bChromaDenoise = false;
4521 bOutOfBound = false;
4522 bVDIWalker = false;
4523 bIECP = false;
4524 bColorPipe = false;
4525 bProcamp = false;
45204526 // DNDI/Vebox
4521 bDeinterlace = false;
4522 bSingleField = false;
4523 bTFF = false;
4524 bTopField = false;
4525 bBeCsc = false;
4526 bVeboxBypass = false;
4527 b60fpsDi = false;
4528
4527 bDeinterlace = false;
4528 bSingleField = false;
4529 bTFF = false;
4530 bTopField = false;
4531 bBeCsc = false;
4532 bVeboxBypass = false;
4533 b60fpsDi = false;
4534 bQueryVariance = false;
45294535 // Surface Information
4530 iFrame0 = 0;
4531 iFrame1 = 0;
4532 iCurDNIn = 0;
4533 iCurDNOut = 0;
4534 iCurHistIn = 0;
4535 iCurHistOut = 0;
4536
4536 iFrame0 = 0;
4537 iFrame1 = 0;
4538 iCurDNIn = 0;
4539 iCurDNOut = 0;
4540 iCurHistIn = 0;
4541 iCurHistOut = 0;
45374542 // Geometry
4538 iBlocksX = 0;
4539 iBlocksY = 0;
4540 iBindingTable = 0;
4541 iMediaID0 = 0;
4542 iMediaID1 = 0;
4543
4543 iBlocksX = 0;
4544 iBlocksY = 0;
4545 iBindingTable = 0;
4546 iMediaID0 = 0;
4547 iMediaID1 = 0;
45444548 // Perf
4545 PerfTag = VPHAL_NONE;
4546
4549 PerfTag = VPHAL_NONE;
45474550 // States
4548 pMediaState = nullptr;
4549 pVeboxState = nullptr;
4550 pRenderTarget = nullptr;
4551
4552 SamplerStateParams = { };
4553
4554 VeboxDNDIParams = { };
4555
4556 pAlphaParams = nullptr;
4557
4551 pMediaState = nullptr;
4552 pVeboxState = nullptr;
4553 pRenderTarget = nullptr;
4554 SamplerStateParams = { };
4555 VeboxDNDIParams = { };
4556 pAlphaParams = nullptr;
45584557 // Batch Buffer rendering arguments
45594558 BbArgs = { };
4560
45614559 // Vebox output parameters
45624560 OutputPipe = VPHAL_OUTPUT_PIPE_MODE_COMP;
4563
45644561 // Kernel Information
4565 int i;
4566 for (i = 0; i < VPHAL_NUM_KERNEL_VEBOX; i++)
4562 for (int i = 0; i < VPHAL_NUM_KERNEL_VEBOX; i++)
45674563 {
45684564 pKernelParam[i] = nullptr;
45694565 KernelEntry[i] = { };
45704566 }
4571
4572 pDNUVParams = nullptr;
4573 iCurbeLength = 0;
4574 iInlineLength = 0;
4575
4567 pDNUVParams = nullptr;
4568 iCurbeLength = 0;
4569 iInlineLength = 0;
45764570 // Debug parameters
4577 pKernelName = nullptr;
4578 Component = COMPONENT_UNKNOWN;
4579
4571 pKernelName = nullptr;
4572 Component = COMPONENT_UNKNOWN;
45804573 // Memory compression flag
4581 bEnableMMC = false;
4582
4583 fScaleX = 0.0f; //!< X Scaling ratio
4584 fScaleY = 0.0f; //!< Y Scaling ratio
4574 bEnableMMC = false;
4575
4576 fScaleX = 0.0f;
4577 fScaleY = 0.0f;
4578
4579 bHdr3DLut = false;
4580 uiMaxDisplayLum = 4000;
4581 uiMaxContentLevelLum = 1000;
4582 hdrMode = VPHAL_HDR_MODE_NONE;
45854583
45864584 return MOS_STATUS_SUCCESS;
45874585 }
658658 public:
659659 VPHAL_VEBOX_RENDER_DATA()
660660 {
661 m_pVeboxStateParams = nullptr;
662 m_pVeboxIecpParams = nullptr;
661 // Flags
662 bRefValid = false;
663 bSameSamples = false;
664 bProgressive = false;
665 bDenoise = false;
666 #if VEBOX_AUTO_DENOISE_SUPPORTED
667 bAutoDenoise = false;
668 #endif
669 bChromaDenoise = false;
670 bOutOfBound = false;
671 bVDIWalker = false;
672 bIECP = false;
673 bColorPipe = false;
674 bProcamp = false;
675 // DNDI/Vebox
676 bDeinterlace = false;
677 bSingleField = false;
678 bTFF = false;
679 bTopField = false;
680 bBeCsc = false;
681 bVeboxBypass = false;
682 b60fpsDi = false;
683 bQueryVariance = false;
684 // Surface Information
685 iFrame0 = 0;
686 iFrame1 = 0;
687 iCurDNIn = 0;
688 iCurDNOut = 0;
689 iCurHistIn = 0;
690 iCurHistOut = 0;
691 // Geometry
692 iBlocksX = 0;
693 iBlocksY = 0;
694 iBindingTable = 0;
695 iMediaID0 = 0;
696 iMediaID1 = 0;
697 // Perf
698 PerfTag = VPHAL_NONE;
699 // States
700 pMediaState = nullptr;
701 pVeboxState = nullptr;
702 pRenderTarget = nullptr;
703 SamplerStateParams = { };
704 VeboxDNDIParams = { };
705 pAlphaParams = nullptr;
706 // Batch Buffer rendering arguments
707 BbArgs = { };
708 // Vebox output parameters
709 OutputPipe = VPHAL_OUTPUT_PIPE_MODE_COMP;
710 // Kernel Information
711 for (int i = 0; i < VPHAL_NUM_KERNEL_VEBOX; i++)
712 {
713 pKernelParam[i] = nullptr;
714 KernelEntry[i] = { };
715 }
716 pDNUVParams = nullptr;
717 iCurbeLength = 0;
718 iInlineLength = 0;
719 // Debug parameters
720 pKernelName = nullptr;
721 Component = COMPONENT_UNKNOWN;
722 // Memory compression flag
723 bEnableMMC = false;
724
725 pOutputTempField = nullptr;
726
727 fScaleX = 0.0f;
728 fScaleY = 0.0f;
729
730 bHdr3DLut = false;
731 uiMaxDisplayLum = 4000;
732 uiMaxContentLevelLum = 1000;
733 hdrMode = VPHAL_HDR_MODE_NONE;
734
735 m_pVeboxStateParams = nullptr;
736 m_pVeboxIecpParams = nullptr;
663737 }
664738 VPHAL_VEBOX_RENDER_DATA(const VPHAL_VEBOX_RENDER_DATA&) = delete;
665739 VPHAL_VEBOX_RENDER_DATA& operator=(const VPHAL_VEBOX_RENDER_DATA&) = delete;
753827 // Scaling ratio is needed to determine if SFC or VEBOX is used
754828 float fScaleX; //!< X Scaling ratio
755829 float fScaleY; //!< Y Scaling ratio
756
757 bool bHdr3DLut = false; //!< Enable 3DLut to process HDR
758 uint32_t uiMaxDisplayLum = 4000; //!< Maximum Display Luminance
759 uint32_t uiMaxContentLevelLum = 1000; //!< Maximum Content Level Luminance
760 VPHAL_HDR_MODE hdrMode = VPHAL_HDR_MODE_NONE;
830
831 bool bHdr3DLut; //!< Enable 3DLut to process HDR
832 uint32_t uiMaxDisplayLum; //!< Maximum Display Luminance
833 uint32_t uiMaxContentLevelLum; //!< Maximum Content Level Luminance
834 VPHAL_HDR_MODE hdrMode;
761835
762836 protected:
763837 // Vebox State Parameters
9761050
9771051 MOS_GPU_CONTEXT RenderGpuContext; //!< Render GPU context
9781052
979 VPHAL_SURFACE Vebox3DLookUpTables = {};
980 VPHAL_SURFACE SfcTempSurface = {};
981
982 VphalHVSDenoiser *m_hvsDenoiser = nullptr; //!< Human Vision System Based Denoiser - Media Kernel to generate DN parameter
983 uint8_t *m_hvsKernelBinary = nullptr; //!< Human Vision System Based Denoiser - Pointer to HVS kernel Binary
984 uint32_t m_hvsKernelBinarySize = 0; //!< Human Vision System Based Denoiser - Size of HVS kernel Binary
1053 VPHAL_SURFACE Vebox3DLookUpTables;
1054 VPHAL_SURFACE SfcTempSurface;
1055
1056 VphalHVSDenoiser *m_hvsDenoiser; //!< Human Vision System Based Denoiser - Media Kernel to generate DN parameter
1057 uint8_t *m_hvsKernelBinary; //!< Human Vision System Based Denoiser - Pointer to HVS kernel Binary
1058 uint32_t m_hvsKernelBinarySize; //!< Human Vision System Based Denoiser - Size of HVS kernel Binary
9851059
9861060 protected:
9871061 PVPHAL_VEBOX_IECP_RENDERER m_IECP; //!< pointer to IECP Renderer module, which contains more filters like TCC, STE.
5858 {
5959 pColorPipeParams = nullptr;
6060 pProcAmpParams = nullptr;
61 dstFormat = Format_Any;
62 srcFormat = Format_Any;
63 bCSCEnable = false;
64 pfCscCoeff = nullptr;
65 pfCscInOffset = nullptr;
66 pfCscOutOffset = nullptr;
67 bAlphaEnable = false;
68 wAlphaValue = 0;
6169 }
6270 virtual ~VPHAL_VEBOX_IECP_PARAMS()
6371 {
200200 DW1 =
201201 DW2_FlatnessThreshold =
202202 DW3_EnableMBStatSurface =
203 DW4_CscCoefficientC0 =
204 DW4_CscCoefficientC1 =
205 DW5_CscCoefficientC2 =
206 DW5_CscCoefficientC3 =
207 DW6_CscCoefficientC4 =
208 DW6_CscCoefficientC5 =
209 DW7_CscCoefficientC6 =
210 DW7_CscCoefficientC7 =
211 DW8_CscCoefficientC8 =
212 DW8_CscCoefficientC9 =
213 DW9_CscCoefficientC10 =
214 DW9_CscCoefficientC11 =
203215 DW10_Reserved =
204216 DW11_Reserved =
205217 DW12_Reserved =
223223 DW0 =
224224 DW1 =
225225 DW2 =
226 DW3_MBFlatnessThreshold = 0;
226 DW3_MBFlatnessThreshold =
227 DW4_CSC_Coefficient_C0 =
228 DW4_CSC_Coefficient_C1 =
229 DW5_CSC_Coefficient_C2 =
230 DW5_CSC_Coefficient_C3 =
231 DW6_CSC_Coefficient_C4 =
232 DW6_CSC_Coefficient_C5 =
233 DW7_CSC_Coefficient_C6 =
234 DW7_CSC_Coefficient_C7 =
235 DW8_CSC_Coefficient_C8 =
236 DW8_CSC_Coefficient_C9 =
237 DW9_CSC_Coefficient_C10 =
238 DW9_CSC_Coefficient_C11 = 0;
227239 DW10_BTI_InputSurface = cscSrcYPlane;
228240 DW11_BTI_Enc8BitSurface = cscDstConvYPlane;
229241 DW12_BTI_4xDsSurface = cscDst4xDs;
266266
267267 MOS_RESOURCE m_cmdInitializerCopyDmemBuffer[CODECHAL_ENCODE_RECYCLED_BUFFER_NUM][CODECHAL_VDENC_BRC_NUM_OF_PASSES]; //!< Dmem buffer for huc cmd initialization copy
268268 MOS_RESOURCE m_cmdInitializerCopyDataBuffer[CODECHAL_ENCODE_RECYCLED_BUFFER_NUM][CODECHAL_VDENC_BRC_NUM_OF_PASSES]; //!< Data buffer for huc cmd initialization copy
269 MHW_BATCH_BUFFER m_vdencCopyBatchBuffer; //!< SLB for huc cmd initialization copy
269 MHW_BATCH_BUFFER m_vdencCopyBatchBuffer = {}; //!< SLB for huc cmd initialization copy
270270
271271 //!
272272 //! \brief Set dmem buffer for huc cmd initialization copy
13081308 mhw_vdbox_hcp_g11_X::HCP_SURFACE_STATE_CMD *cmd =
13091309 (mhw_vdbox_hcp_g11_X::HCP_SURFACE_STATE_CMD*)cmdBuffer->pCmdPtr;
13101310
1311 MHW_MI_CHK_STATUS(MhwVdboxHcpInterfaceGeneric<mhw_vdbox_hcp_g11_X>::AddHcpDecodeSurfaceStateCmd(cmdBuffer, params));
1311 MHW_MI_CHK_STATUS(MhwVdboxHcpInterfaceGeneric<mhw_vdbox_hcp_g11_X>::AddHcpEncodeSurfaceStateCmd(cmdBuffer, params));
13121312
13131313 bool surf10bit= (params->psSurface->Format == Format_P010) ||
13141314 (params->psSurface->Format == Format_P210) ||
10691069 if (cmd.Dwords25.DW1.SurfaceFormat == vdencSurfaceFormatY416Variant ||
10701070 cmd.Dwords25.DW1.SurfaceFormat == vdencSurfaceFormatAyuvVariant)
10711071 {
1072 /* Y410/Y416 Reconstructed format handling */
1073 if (cmd.Dwords25.DW1.SurfaceFormat == vdencSurfaceFormatY416Variant)
1074 cmd.Dwords25.DW1.SurfacePitch = params->psSurface->dwPitch / 2 - 1;
1075 /* AYUV Reconstructed format handling */
1076 if (cmd.Dwords25.DW1.SurfaceFormat == vdencSurfaceFormatAyuvVariant)
1077 cmd.Dwords25.DW1.SurfacePitch = params->psSurface->dwPitch / 4 - 1;
1078
10721079 cmd.Dwords25.DW2.YOffsetForUCb = params->dwReconSurfHeight;
10731080 cmd.Dwords25.DW3.YOffsetForVCr = params->dwReconSurfHeight << 1;
10741081 }
288288 PCODECHAL_STANDARD_INFO standardInfo) :
289289 CodechalDecodeVc1(hwInterface, debugInterface, standardInfo)
290290 {
291 MOS_ZeroMemory(&m_olpBatchBuffer, sizeof(m_olpBatchBuffer));
292
291293 CODECHAL_DECODE_CHK_NULL_NO_STATUS_RETURN(hwInterface);
292294
293295 m_olpCurbeStaticDataLength = CODECHAL_DECODE_VC1_CURBE_SIZE_OLP_G8;
294
295 MOS_ZeroMemory(&m_olpBatchBuffer, sizeof(m_olpBatchBuffer));
296296
297297 MOS_STATUS eStatus = CodecHalGetKernelBinaryAndSize(
298298 (uint8_t *)IGCODECKRN_G8,
200200 DW1 =
201201 DW2_FlatnessThreshold =
202202 DW3_EnableMBStatSurface =
203 DW4_CscCoefficientC0 =
204 DW4_CscCoefficientC1 =
205 DW5_CscCoefficientC2 =
206 DW5_CscCoefficientC3 =
207 DW6_CscCoefficientC4 =
208 DW6_CscCoefficientC5 =
209 DW7_CscCoefficientC6 =
210 DW7_CscCoefficientC7 =
211 DW8_CscCoefficientC8 =
212 DW8_CscCoefficientC9 =
213 DW9_CscCoefficientC10 =
214 DW9_CscCoefficientC11 =
203215 DW10_Reserved =
204216 DW11_Reserved =
205217 DW12_Reserved =
592592
593593 private:
594594 // Resources for the render engine
595 MOS_SURFACE m_lcuQP; //!< input LCU QP surface
596
597 CodecEncodeHevcFeiPicParams *m_feiPicParams;
595 MOS_SURFACE m_lcuQP = {}; //!< input LCU QP surface
596
597 CodecEncodeHevcFeiPicParams *m_feiPicParams = nullptr;
598598
599599 //!
600600 //! \brief Get encoder kernel header and kernel size
111111 {
112112 public:
113113 CM_NOINLINE SurfaceIndex() { index = 0; extraByte = 0; };
114 CM_NOINLINE SurfaceIndex(const SurfaceIndex& src) { index = src.index; };
115 CM_NOINLINE SurfaceIndex(const unsigned int& n) { index = n; };
114 CM_NOINLINE SurfaceIndex(const SurfaceIndex& src) { index = src.index; extraByte = src.extraByte; };
115 CM_NOINLINE SurfaceIndex(const unsigned int& n) { index = n; extraByte = 0; };
116116 CM_NOINLINE SurfaceIndex& operator = (const unsigned int& n) { this->index = n; return *this; };
117117 CM_NOINLINE SurfaceIndex& operator + (const unsigned int& n) { this->index += n; return *this; };
118118 CM_NOINLINE SurfaceIndex& operator= (const SurfaceIndex& other) { this->index = other.index; return *this; };
140140 {
141141 public:
142142 CM_NOINLINE SamplerIndex() { index = 0; extraByte = 0;};
143 CM_NOINLINE SamplerIndex(SamplerIndex& src) { index = src.get_data(); };
144 CM_NOINLINE SamplerIndex(const unsigned int& n) { index = n; };
143 CM_NOINLINE SamplerIndex(SamplerIndex& src) { index = src.get_data(); extraByte = src.extraByte; };
144 CM_NOINLINE SamplerIndex(const unsigned int& n) { index = n; extraByte = 0; };
145145 CM_NOINLINE SamplerIndex& operator = (const unsigned int& n) { this->index = n; return *this; };
146146 virtual unsigned int get_data(void) { return index; };
147147 virtual ~SamplerIndex(){};
565565 snprintf(traceFile+offset, 256-offset, "%s", "/.mdf_trace");
566566
567567 FILE *traceFd = fopen(traceFile, "r");
568 uint flag = 0;
568 int flag = 0;
569569 if(traceFd )
570570 {
571571 //read data from file
4545 CM_SURFACE_FORMAT format,
4646 CmSurfaceManager* surfaceManager ,
4747 bool isCmCreated):
48 CmSurface2DRTBase(handle, width, height, pitch, format, surfaceManager, isCmCreated)
48 CmSurface2DRTBase(handle, width, height, pitch, format, surfaceManager, isCmCreated),
49 m_vaSurfaceID(0),
50 m_vaCreated(0),
51 m_vaDisplay(nullptr)
4952 {
50 m_vaSurfaceID = 0;
51 m_vaCreated = 0;
5253 }
5354
5455 //*-----------------------------------------------------------------------------
3838 m_ddiDecodeAttr = ddiDecodeAttr;
3939 m_ddiDecodeCtx = nullptr;
4040 MOS_ZeroMemory(&m_destSurface, sizeof(m_destSurface));
41 m_groupIndex = 0;
42 m_picWidthInMB = 0;
43 m_picHeightInMB = 0;
44 m_decProcessingType = 0;
45 m_width = 0;
46 m_height = 0;
47 m_streamOutEnabled = false;
48 m_sliceParamBufNum = 0;
49 m_sliceCtrlBufNum = 0;
4150 m_codechalSettings = CodechalSetting::CreateCodechalSetting();
4251 }
4352
321321
322322 uint32_t lastPackedHeaderType = 0;
323323
324 uint8_t vp9TargetUsage;
324 uint8_t vp9TargetUsage = 0;
325325 };
21612161 surfDesc->uiTile = I915_TILING_NONE;
21622162 if (surfDesc->ulBuffer % 4096 != 0)
21632163 {
2164 MOS_FreeMemory(surfDesc);
21642165 DDI_VERBOSEMESSAGE("Buffer Address is invalid");
21652166 return VA_STATUS_ERROR_INVALID_PARAMETER;
21662167 }
335335 PDDI_MEDIA_SURFACE dstSurface = (DDI_MEDIA_SURFACE *)MOS_AllocAndZeroMemory(sizeof(DDI_MEDIA_SURFACE));
336336 if (nullptr == surfaceElement)
337337 {
338 MOS_FreeMemory(dstSurface);
338339 return nullptr;
339340 }
340341
869869 uint8_t *umdContextY = dispTempBuffer;
870870 uint8_t *ptr = (uint8_t*)DdiMediaUtil_LockSurface(mediaSurface, (MOS_LOCKFLAG_READONLY | MOS_LOCKFLAG_WRITEONLY));
871871 MOS_STATUS eStatus = MOS_SecureMemcpy(umdContextY, surfaceSize, ptr, surfaceSize);
872 DDI_CHK_CONDITION((eStatus != MOS_STATUS_SUCCESS), "DDI:Failed to copy surface buffer data!", VA_STATUS_ERROR_OPERATION_FAILED);
872
873 if (eStatus != MOS_STATUS_SUCCESS)
874 {
875 MOS_FreeMemory(dispTempBuffer);
876 DDI_ASSERTMESSAGE("DDI:Failed to copy surface buffer data!");
877 return VA_STATUS_ERROR_OPERATION_FAILED;
878 }
873879
874880 Visual *visual = DefaultVisual(ctx->native_dpy, ctx->x11_screen);
875881 GC gc = (*pfn_XCreateGC)((Display*)ctx->native_dpy, (Drawable)draw, 0, nullptr);
39783978 if (ret != 0) {
39793979 MOS_DBG("DRM_IOCTL_I915_GEM_VM_CREATE failed: %s\n",
39803980 strerror(errno));
3981 free(vm);
39813982 return nullptr;
39823983 }
39833984
4545 m_cmdBufMgr = cmdBufMgr;
4646 m_gpuContext = mosGpuCtx;
4747 m_statusBufferResource = nullptr;
48 m_maxPatchLocationsize = PATCHLOCATIONLIST_SIZE;
4849
4950 if (reusedContext)
5051 {
236236 //! \brief Os context
237237 OsContext *m_osContext = nullptr;
238238
239 MOS_GPUCTX_CREATOPTIONS_ENHANCED *m_createOptionEnhanced;
239 MOS_GPUCTX_CREATOPTIONS_ENHANCED *m_createOptionEnhanced = nullptr;
240240 MOS_LINUX_CONTEXT* m_i915Context = nullptr;
241 uint32_t m_i915ExecFlag;
241 uint32_t m_i915ExecFlag = 0;
242242
243243 #if MOS_COMMAND_RESINFO_DUMP_SUPPORTED
244244 std::vector<const void *> m_cmdResPtrs; //!< Command OS resource pointers registered by pfnRegisterResource
17981798 return;
17991799 }
18001800
1801 return gpuContext->ResetGpuContextStatus();
1801 gpuContext->ResetGpuContextStatus();
1802 return;
18021803 }
18031804
18041805 pOsContext = pOsInterface->pOsContext;
12271227
12281228 if ( (eStatus = _UserFeature_DumpFile(szUserFeatureFile, &pKeyList)) != MOS_STATUS_SUCCESS )
12291229 {
1230 MOS_FreeMemory(pKeyList);
12301231 return eStatus;
12311232 }
12321233
13291330 if ( (eStatus = _UserFeature_DumpFile(szUserFeatureFile, &pKeyList)) !=
13301331 MOS_STATUS_SUCCESS )
13311332 {
1333 MOS_FreeMemory(pKeyList);
13321334 return eStatus;
13331335 }
13341336
13811383 if ( (eStatus = _UserFeature_DumpFile(szUserFeatureFile, &pKeyList)) !=
13821384 MOS_STATUS_SUCCESS )
13831385 {
1386 MOS_FreeMemory(pKeyList);
13841387 return eStatus;
13851388 }
13861389
7777 static vaDestroySurfacesFunc vaDestroySurfaces;
7878
7979 MockDevice(): vaCmExtSendReqMsg(nullptr),
80 m_cmDevice(nullptr) {}
80 m_cmDevice(nullptr)
81 {
82 MOS_ZeroMemory(&vaCmExtSendReqMsg, sizeof(vaCmExtSendReqMsg));
83 MOS_ZeroMemory(&m_vaDisplay, sizeof(m_vaDisplay));
84 }
8185
8286 ~MockDevice() { Release(); }
8387
123123
124124 public:
125125
126 VADriverContext m_ctx;
127 VADriverVTable m_vtable;
128 VADriverVTableVPP m_vtable_vpp;
126 VADriverContext m_ctx = {};
127 VADriverVTable m_vtable = {};
128 VADriverVTableVPP m_vtable_vpp = {};
129129
130130 private:
131131