2 * Copyright © 2014 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sub license, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 #include "i965_drv_video.h"
30 /* Extra set of chroma formats supported for H.264 decoding (beyond YUV 4:2:0) */
31 #define EXTRA_H264_DEC_CHROMA_FORMATS \
34 /* Extra set of chroma formats supported for JPEG decoding (beyond YUV 4:2:0) */
35 #define EXTRA_JPEG_DEC_CHROMA_FORMATS \
36 (VA_RT_FORMAT_YUV400 | VA_RT_FORMAT_YUV411 | VA_RT_FORMAT_YUV422 | \
39 /* Defines VA profile as a 32-bit unsigned integer mask */
40 #define VA_PROFILE_MASK(PROFILE) \
41 (1U << VAProfile##PROFILE)
43 extern struct hw_context *i965_proc_context_init(VADriverContextP, struct object_config *);
44 extern struct hw_context *g4x_dec_hw_context_init(VADriverContextP, struct object_config *);
45 extern bool genx_render_init(VADriverContextP);
47 static const struct hw_codec_info g4x_hw_codec_info = {
48 .dec_hw_context_init = g4x_dec_hw_context_init,
49 .enc_hw_context_init = NULL,
50 .proc_hw_context_init = NULL,
51 .render_init = genx_render_init,
52 .post_processing_context_init = NULL,
56 .min_linear_wpitch = 16,
57 .min_linear_hpitch = 16,
59 .has_mpeg2_decoding = 1,
64 extern struct hw_context *ironlake_dec_hw_context_init(VADriverContextP, struct object_config *);
65 extern void i965_post_processing_context_init(VADriverContextP, void *, struct intel_batchbuffer *);
67 static const struct hw_codec_info ilk_hw_codec_info = {
68 .dec_hw_context_init = ironlake_dec_hw_context_init,
69 .enc_hw_context_init = NULL,
70 .proc_hw_context_init = i965_proc_context_init,
71 .render_init = genx_render_init,
72 .post_processing_context_init = i965_post_processing_context_init,
76 .min_linear_wpitch = 16,
77 .min_linear_hpitch = 16,
79 .has_mpeg2_decoding = 1,
80 .has_h264_decoding = 1,
82 .has_accelerated_putimage = 1,
87 extern struct hw_context *gen6_dec_hw_context_init(VADriverContextP, struct object_config *);
88 extern struct hw_context *gen6_enc_hw_context_init(VADriverContextP, struct object_config *);
89 static const struct hw_codec_info snb_hw_codec_info = {
90 .dec_hw_context_init = gen6_dec_hw_context_init,
91 .enc_hw_context_init = gen6_enc_hw_context_init,
92 .proc_hw_context_init = i965_proc_context_init,
93 .render_init = genx_render_init,
94 .post_processing_context_init = i965_post_processing_context_init,
98 .min_linear_wpitch = 16,
99 .min_linear_hpitch = 16,
101 .h264_mvc_dec_profiles = VA_PROFILE_MASK(H264StereoHigh),
102 .h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
104 .has_mpeg2_decoding = 1,
105 .has_h264_decoding = 1,
106 .has_h264_encoding = 1,
107 .has_vc1_decoding = 1,
109 .has_accelerated_getimage = 1,
110 .has_accelerated_putimage = 1,
111 .has_tiled_surface = 1,
112 .has_di_motion_adptive = 1,
116 { VAProcFilterNoiseReduction, I965_RING_NULL },
117 { VAProcFilterDeinterlacing, I965_RING_NULL },
121 extern struct hw_context *gen7_dec_hw_context_init(VADriverContextP, struct object_config *);
122 extern struct hw_context *gen7_enc_hw_context_init(VADriverContextP, struct object_config *);
123 static const struct hw_codec_info ivb_hw_codec_info = {
124 .dec_hw_context_init = gen7_dec_hw_context_init,
125 .enc_hw_context_init = gen7_enc_hw_context_init,
126 .proc_hw_context_init = i965_proc_context_init,
127 .render_init = genx_render_init,
128 .post_processing_context_init = i965_post_processing_context_init,
132 .min_linear_wpitch = 64,
133 .min_linear_hpitch = 16,
135 .h264_mvc_dec_profiles = VA_PROFILE_MASK(H264StereoHigh),
136 .h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
137 .jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
139 .has_mpeg2_decoding = 1,
140 .has_mpeg2_encoding = 1,
141 .has_h264_decoding = 1,
142 .has_h264_encoding = 1,
143 .has_vc1_decoding = 1,
144 .has_jpeg_decoding = 1,
146 .has_accelerated_getimage = 1,
147 .has_accelerated_putimage = 1,
148 .has_tiled_surface = 1,
149 .has_di_motion_adptive = 1,
153 { VAProcFilterNoiseReduction, I965_RING_NULL },
154 { VAProcFilterDeinterlacing, I965_RING_NULL },
158 extern struct hw_context *gen75_dec_hw_context_init(VADriverContextP, struct object_config *);
159 extern struct hw_context *gen75_enc_hw_context_init(VADriverContextP, struct object_config *);
160 extern struct hw_context *gen75_proc_context_init(VADriverContextP, struct object_config *);
161 static const struct hw_codec_info hsw_hw_codec_info = {
162 .dec_hw_context_init = gen75_dec_hw_context_init,
163 .enc_hw_context_init = gen75_enc_hw_context_init,
164 .proc_hw_context_init = gen75_proc_context_init,
165 .render_init = genx_render_init,
166 .post_processing_context_init = i965_post_processing_context_init,
170 .min_linear_wpitch = 64,
171 .min_linear_hpitch = 16,
173 .h264_mvc_dec_profiles = (VA_PROFILE_MASK(H264StereoHigh) |
174 VA_PROFILE_MASK(H264MultiviewHigh)),
175 .h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
176 .jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
178 .has_mpeg2_decoding = 1,
179 .has_mpeg2_encoding = 1,
180 .has_h264_decoding = 1,
181 .has_h264_encoding = 1,
182 .has_vc1_decoding = 1,
183 .has_jpeg_decoding = 1,
185 .has_accelerated_getimage = 1,
186 .has_accelerated_putimage = 1,
187 .has_tiled_surface = 1,
188 .has_di_motion_adptive = 1,
189 .has_di_motion_compensated = 1,
190 .has_h264_mvc_encoding = 1,
194 { VAProcFilterNoiseReduction, I965_RING_VEBOX },
195 { VAProcFilterDeinterlacing, I965_RING_VEBOX },
196 { VAProcFilterSharpening, I965_RING_NULL },
197 { VAProcFilterColorBalance, I965_RING_VEBOX},
198 { VAProcFilterSkinToneEnhancement, I965_RING_VEBOX},
202 extern struct hw_context *gen8_dec_hw_context_init(VADriverContextP, struct object_config *);
203 extern struct hw_context *gen8_enc_hw_context_init(VADriverContextP, struct object_config *);
204 extern void gen8_post_processing_context_init(VADriverContextP, void *, struct intel_batchbuffer *);
205 static const struct hw_codec_info bdw_hw_codec_info = {
206 .dec_hw_context_init = gen8_dec_hw_context_init,
207 .enc_hw_context_init = gen8_enc_hw_context_init,
208 .proc_hw_context_init = gen75_proc_context_init,
209 .render_init = gen8_render_init,
210 .post_processing_context_init = gen8_post_processing_context_init,
214 .min_linear_wpitch = 64,
215 .min_linear_hpitch = 16,
217 .h264_mvc_dec_profiles = (VA_PROFILE_MASK(H264StereoHigh) |
218 VA_PROFILE_MASK(H264MultiviewHigh)),
219 .h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
220 .jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
222 .has_mpeg2_decoding = 1,
223 .has_mpeg2_encoding = 1,
224 .has_h264_decoding = 1,
225 .has_h264_encoding = 1,
226 .has_vc1_decoding = 1,
227 .has_jpeg_decoding = 1,
229 .has_accelerated_getimage = 1,
230 .has_accelerated_putimage = 1,
231 .has_tiled_surface = 1,
232 .has_di_motion_adptive = 1,
233 .has_di_motion_compensated = 1,
234 .has_vp8_decoding = 1,
235 .has_h264_mvc_encoding = 1,
239 { VAProcFilterNoiseReduction, I965_RING_VEBOX },
240 { VAProcFilterDeinterlacing, I965_RING_VEBOX },
241 { VAProcFilterSharpening, I965_RING_NULL }, /* need to rebuild the shader for BDW */
242 { VAProcFilterColorBalance, I965_RING_VEBOX},
243 { VAProcFilterSkinToneEnhancement, I965_RING_VEBOX},
247 static const struct hw_codec_info chv_hw_codec_info = {
248 .dec_hw_context_init = gen8_dec_hw_context_init,
249 .enc_hw_context_init = gen8_enc_hw_context_init,
250 .proc_hw_context_init = gen75_proc_context_init,
251 .render_init = gen8_render_init,
252 .post_processing_context_init = gen8_post_processing_context_init,
256 .min_linear_wpitch = 64,
257 .min_linear_hpitch = 16,
259 .h264_mvc_dec_profiles = (VA_PROFILE_MASK(H264StereoHigh) |
260 VA_PROFILE_MASK(H264MultiviewHigh)),
261 .h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
262 .jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
264 .has_mpeg2_decoding = 1,
265 .has_mpeg2_encoding = 1,
266 .has_h264_decoding = 1,
267 .has_h264_encoding = 1,
268 .has_vc1_decoding = 1,
269 .has_jpeg_decoding = 1,
271 .has_accelerated_getimage = 1,
272 .has_accelerated_putimage = 1,
273 .has_tiled_surface = 1,
274 .has_di_motion_adptive = 1,
275 .has_di_motion_compensated = 1,
276 .has_vp8_decoding = 1,
277 .has_h264_mvc_encoding = 1,
281 { VAProcFilterNoiseReduction, I965_RING_VEBOX },
282 { VAProcFilterDeinterlacing, I965_RING_VEBOX },
283 { VAProcFilterSharpening, I965_RING_NULL }, /* need to rebuild the shader for BDW */
284 { VAProcFilterColorBalance, I965_RING_VEBOX},
285 { VAProcFilterSkinToneEnhancement, I965_RING_VEBOX},
289 const struct hw_codec_info *
290 i965_get_codec_info(int devid)
294 #define CHIPSET(id, family, dev, str) case id: return &family##_hw_codec_info;
295 #include "i965_pciids.h"
301 static const struct intel_device_info g4x_device_info = {
305 .max_wm_threads = 50, /* 10 * 5 */
310 static const struct intel_device_info ilk_device_info = {
314 .max_wm_threads = 72, /* 12 * 6 */
317 static const struct intel_device_info snb_gt1_device_info = {
322 .max_wm_threads = 40,
325 static const struct intel_device_info snb_gt2_device_info = {
330 .max_wm_threads = 80,
333 static const struct intel_device_info ivb_gt1_device_info = {
338 .max_wm_threads = 48,
343 static const struct intel_device_info ivb_gt2_device_info = {
348 .max_wm_threads = 172,
353 static const struct intel_device_info byt_device_info = {
358 .max_wm_threads = 48,
364 static const struct intel_device_info hsw_gt1_device_info = {
369 .max_wm_threads = 102,
374 static const struct intel_device_info hsw_gt2_device_info = {
379 .max_wm_threads = 204,
384 static const struct intel_device_info hsw_gt3_device_info = {
389 .max_wm_threads = 408,
394 static const struct intel_device_info bdw_device_info = {
398 .max_wm_threads = 64, /* per PSD */
401 static const struct intel_device_info chv_device_info = {
405 .max_wm_threads = 64, /* per PSD */
410 const struct intel_device_info *
411 i965_get_device_info(int devid)
415 #define CHIPSET(id, family, dev, str) case id: return &dev##_device_info;
416 #include "i965_pciids.h"