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 extern struct hw_context *i965_proc_context_init(VADriverContextP, struct object_config *);
40 extern struct hw_context *g4x_dec_hw_context_init(VADriverContextP, struct object_config *);
41 extern bool genx_render_init(VADriverContextP);
43 static const struct hw_codec_info g4x_hw_codec_info = {
44 .dec_hw_context_init = g4x_dec_hw_context_init,
45 .enc_hw_context_init = NULL,
46 .proc_hw_context_init = NULL,
47 .render_init = genx_render_init,
48 .post_processing_context_init = NULL,
52 .min_linear_wpitch = 16,
53 .min_linear_hpitch = 16,
55 .has_mpeg2_decoding = 1,
60 extern struct hw_context *ironlake_dec_hw_context_init(VADriverContextP, struct object_config *);
61 extern void i965_post_processing_context_init(VADriverContextP, void *, struct intel_batchbuffer *);
63 static const struct hw_codec_info ilk_hw_codec_info = {
64 .dec_hw_context_init = ironlake_dec_hw_context_init,
65 .enc_hw_context_init = NULL,
66 .proc_hw_context_init = i965_proc_context_init,
67 .render_init = genx_render_init,
68 .post_processing_context_init = i965_post_processing_context_init,
72 .min_linear_wpitch = 16,
73 .min_linear_hpitch = 16,
75 .has_mpeg2_decoding = 1,
76 .has_h264_decoding = 1,
78 .has_accelerated_putimage = 1,
83 extern struct hw_context *gen6_dec_hw_context_init(VADriverContextP, struct object_config *);
84 extern struct hw_context *gen6_enc_hw_context_init(VADriverContextP, struct object_config *);
85 static const struct hw_codec_info snb_hw_codec_info = {
86 .dec_hw_context_init = gen6_dec_hw_context_init,
87 .enc_hw_context_init = gen6_enc_hw_context_init,
88 .proc_hw_context_init = i965_proc_context_init,
89 .render_init = genx_render_init,
90 .post_processing_context_init = i965_post_processing_context_init,
94 .min_linear_wpitch = 16,
95 .min_linear_hpitch = 16,
97 .h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
99 .has_mpeg2_decoding = 1,
100 .has_h264_decoding = 1,
101 .has_h264_encoding = 1,
102 .has_vc1_decoding = 1,
104 .has_accelerated_getimage = 1,
105 .has_accelerated_putimage = 1,
106 .has_tiled_surface = 1,
107 .has_di_motion_adptive = 1,
111 { VAProcFilterNoiseReduction, I965_RING_NULL },
112 { VAProcFilterDeinterlacing, I965_RING_NULL },
116 extern struct hw_context *gen7_dec_hw_context_init(VADriverContextP, struct object_config *);
117 extern struct hw_context *gen7_enc_hw_context_init(VADriverContextP, struct object_config *);
118 static const struct hw_codec_info ivb_hw_codec_info = {
119 .dec_hw_context_init = gen7_dec_hw_context_init,
120 .enc_hw_context_init = gen7_enc_hw_context_init,
121 .proc_hw_context_init = i965_proc_context_init,
122 .render_init = genx_render_init,
123 .post_processing_context_init = i965_post_processing_context_init,
127 .min_linear_wpitch = 64,
128 .min_linear_hpitch = 16,
130 .h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
131 .jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
133 .has_mpeg2_decoding = 1,
134 .has_mpeg2_encoding = 1,
135 .has_h264_decoding = 1,
136 .has_h264_encoding = 1,
137 .has_vc1_decoding = 1,
138 .has_jpeg_decoding = 1,
140 .has_accelerated_getimage = 1,
141 .has_accelerated_putimage = 1,
142 .has_tiled_surface = 1,
143 .has_di_motion_adptive = 1,
147 { VAProcFilterNoiseReduction, I965_RING_NULL },
148 { VAProcFilterDeinterlacing, I965_RING_NULL },
152 extern struct hw_context *gen75_dec_hw_context_init(VADriverContextP, struct object_config *);
153 extern struct hw_context *gen75_enc_hw_context_init(VADriverContextP, struct object_config *);
154 extern struct hw_context *gen75_proc_context_init(VADriverContextP, struct object_config *);
155 static const struct hw_codec_info hsw_hw_codec_info = {
156 .dec_hw_context_init = gen75_dec_hw_context_init,
157 .enc_hw_context_init = gen75_enc_hw_context_init,
158 .proc_hw_context_init = gen75_proc_context_init,
159 .render_init = genx_render_init,
160 .post_processing_context_init = i965_post_processing_context_init,
164 .min_linear_wpitch = 64,
165 .min_linear_hpitch = 16,
167 .h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
168 .jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
170 .has_mpeg2_decoding = 1,
171 .has_mpeg2_encoding = 1,
172 .has_h264_decoding = 1,
173 .has_h264_encoding = 1,
174 .has_vc1_decoding = 1,
175 .has_jpeg_decoding = 1,
177 .has_accelerated_getimage = 1,
178 .has_accelerated_putimage = 1,
179 .has_tiled_surface = 1,
180 .has_di_motion_adptive = 1,
181 .has_di_motion_compensated = 1,
182 .has_h264_mvc_decoding = 1,
183 .has_h264_mvc_encoding = 1,
187 { VAProcFilterNoiseReduction, I965_RING_VEBOX },
188 { VAProcFilterDeinterlacing, I965_RING_VEBOX },
189 { VAProcFilterSharpening, I965_RING_NULL },
190 { VAProcFilterColorBalance, I965_RING_VEBOX},
191 { VAProcFilterSkinToneEnhancement, I965_RING_VEBOX},
195 extern struct hw_context *gen8_dec_hw_context_init(VADriverContextP, struct object_config *);
196 extern struct hw_context *gen8_enc_hw_context_init(VADriverContextP, struct object_config *);
197 extern void gen8_post_processing_context_init(VADriverContextP, void *, struct intel_batchbuffer *);
198 static const struct hw_codec_info bdw_hw_codec_info = {
199 .dec_hw_context_init = gen8_dec_hw_context_init,
200 .enc_hw_context_init = gen8_enc_hw_context_init,
201 .proc_hw_context_init = gen75_proc_context_init,
202 .render_init = gen8_render_init,
203 .post_processing_context_init = gen8_post_processing_context_init,
207 .min_linear_wpitch = 64,
208 .min_linear_hpitch = 16,
210 .h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
211 .jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
213 .has_mpeg2_decoding = 1,
214 .has_mpeg2_encoding = 1,
215 .has_h264_decoding = 1,
216 .has_h264_encoding = 1,
217 .has_vc1_decoding = 1,
218 .has_jpeg_decoding = 1,
220 .has_accelerated_getimage = 1,
221 .has_accelerated_putimage = 1,
222 .has_tiled_surface = 1,
223 .has_di_motion_adptive = 1,
224 .has_di_motion_compensated = 1,
225 .has_vp8_decoding = 1,
226 .has_h264_mvc_decoding = 1,
227 .has_h264_mvc_encoding = 1,
231 { VAProcFilterNoiseReduction, I965_RING_VEBOX },
232 { VAProcFilterDeinterlacing, I965_RING_VEBOX },
233 { VAProcFilterSharpening, I965_RING_NULL }, /* need to rebuild the shader for BDW */
234 { VAProcFilterColorBalance, I965_RING_VEBOX},
235 { VAProcFilterSkinToneEnhancement, I965_RING_VEBOX},
239 const struct hw_codec_info *
240 i965_get_codec_info(int devid)
244 #define CHIPSET(id, family, dev, str) case id: return &family##_hw_codec_info;
245 #include "i965_pciids.h"
251 static const struct intel_device_info g4x_device_info = {
255 .max_wm_threads = 50, /* 10 * 5 */
260 static const struct intel_device_info ilk_device_info = {
264 .max_wm_threads = 72, /* 12 * 6 */
267 static const struct intel_device_info snb_gt1_device_info = {
272 .max_wm_threads = 40,
275 static const struct intel_device_info snb_gt2_device_info = {
280 .max_wm_threads = 80,
283 static const struct intel_device_info ivb_gt1_device_info = {
288 .max_wm_threads = 48,
293 static const struct intel_device_info ivb_gt2_device_info = {
298 .max_wm_threads = 172,
303 static const struct intel_device_info byt_device_info = {
308 .max_wm_threads = 48,
314 static const struct intel_device_info hsw_gt1_device_info = {
319 .max_wm_threads = 102,
324 static const struct intel_device_info hsw_gt2_device_info = {
329 .max_wm_threads = 204,
334 static const struct intel_device_info hsw_gt3_device_info = {
339 .max_wm_threads = 408,
344 static const struct intel_device_info bdw_device_info = {
348 .max_wm_threads = 64, /* per PSD */
351 const struct intel_device_info *
352 i965_get_device_info(int devid)
356 #define CHIPSET(id, family, dev, str) case id: return &dev##_device_info;
357 #include "i965_pciids.h"