hardware/intel/intel-driver
Revision | 5fb654b2577be19005bd9792a0b62c3ac1d2395b (tree) |
---|---|
Zeit | 2016-01-29 14:44:34 |
Autor | Peng Chen <peng.c.chen@inte...> |
Commiter | Xiang, Haihao |
KBL driver enabling
v2:
remove the file mode change
v1:
initial
Signed-off-by: peng.chen <peng.c.chen@intel.com>
@@ -152,13 +152,24 @@ gen9_hcpe_pipe_mode_select(VADriverContextP ctx, | ||
152 | 152 | int standard_select, |
153 | 153 | struct intel_encoder_context *encoder_context) |
154 | 154 | { |
155 | + struct i965_driver_data *i965 = i965_driver_data(ctx); | |
155 | 156 | struct intel_batchbuffer *batch = encoder_context->base.batch; |
156 | 157 | |
157 | 158 | assert(standard_select == HCP_CODEC_HEVC); |
158 | 159 | |
159 | - BEGIN_BCS_BATCH(batch, 4); | |
160 | + if(IS_KBL(i965->intel.device_info)) | |
161 | + { | |
162 | + BEGIN_BCS_BATCH(batch, 6); | |
163 | + | |
164 | + OUT_BCS_BATCH(batch, HCP_PIPE_MODE_SELECT | (6 - 2)); | |
165 | + } | |
166 | + else | |
167 | + { | |
168 | + BEGIN_BCS_BATCH(batch, 4); | |
169 | + | |
170 | + OUT_BCS_BATCH(batch, HCP_PIPE_MODE_SELECT | (4 - 2)); | |
171 | + } | |
160 | 172 | |
161 | - OUT_BCS_BATCH(batch, HCP_PIPE_MODE_SELECT | (4 - 2)); | |
162 | 173 | OUT_BCS_BATCH(batch, |
163 | 174 | (standard_select << 5) | |
164 | 175 | (0 << 3) | /* disable Pic Status / Error Report */ |
@@ -166,6 +177,12 @@ gen9_hcpe_pipe_mode_select(VADriverContextP ctx, | ||
166 | 177 | OUT_BCS_BATCH(batch, 0); |
167 | 178 | OUT_BCS_BATCH(batch, 0); |
168 | 179 | |
180 | + if(IS_KBL(i965->intel.device_info)) | |
181 | + { | |
182 | + OUT_BCS_BATCH(batch, 0); | |
183 | + OUT_BCS_BATCH(batch, 0); | |
184 | + } | |
185 | + | |
169 | 186 | ADVANCE_BCS_BATCH(batch); |
170 | 187 | } |
171 | 188 |
@@ -209,6 +226,7 @@ static void | ||
209 | 226 | gen9_hcpe_pipe_buf_addr_state(VADriverContextP ctx, struct encode_state *encode_state, |
210 | 227 | struct intel_encoder_context *encoder_context) |
211 | 228 | { |
229 | + struct i965_driver_data *i965 = i965_driver_data(ctx); | |
212 | 230 | struct intel_batchbuffer *batch = encoder_context->base.batch; |
213 | 231 | struct gen9_hcpe_context *mfc_context = encoder_context->mfc_context; |
214 | 232 | struct object_surface *obj_surface; |
@@ -216,9 +234,18 @@ gen9_hcpe_pipe_buf_addr_state(VADriverContextP ctx, struct encode_state *encode_ | ||
216 | 234 | dri_bo *bo; |
217 | 235 | unsigned int i; |
218 | 236 | |
219 | - BEGIN_BCS_BATCH(batch, 95); | |
237 | + if(IS_KBL(i965->intel.device_info)) | |
238 | + { | |
239 | + BEGIN_BCS_BATCH(batch, 104); | |
220 | 240 | |
221 | - OUT_BCS_BATCH(batch, HCP_PIPE_BUF_ADDR_STATE | (95 - 2)); | |
241 | + OUT_BCS_BATCH(batch, HCP_PIPE_BUF_ADDR_STATE | (104 - 2)); | |
242 | + } | |
243 | + else | |
244 | + { | |
245 | + BEGIN_BCS_BATCH(batch, 95); | |
246 | + | |
247 | + OUT_BCS_BATCH(batch, HCP_PIPE_BUF_ADDR_STATE | (95 - 2)); | |
248 | + } | |
222 | 249 | |
223 | 250 | obj_surface = encode_state->reconstructed_object; |
224 | 251 | assert(obj_surface && obj_surface->bo); |
@@ -269,6 +296,12 @@ gen9_hcpe_pipe_buf_addr_state(VADriverContextP ctx, struct encode_state *encode_ | ||
269 | 296 | OUT_BUFFER_MA_TARGET(NULL); /* DW 89..91, ignore for HEVC */ |
270 | 297 | OUT_BUFFER_MA_TARGET(NULL); /* DW 92..94, ignore for HEVC */ |
271 | 298 | |
299 | + if(IS_KBL(i965->intel.device_info)) | |
300 | + { | |
301 | + for(i = 0;i < 9;i++) | |
302 | + OUT_BCS_BATCH(batch, 0); | |
303 | + } | |
304 | + | |
272 | 305 | ADVANCE_BCS_BATCH(batch); |
273 | 306 | } |
274 | 307 |
@@ -459,6 +492,7 @@ static void | ||
459 | 492 | gen9_hcpe_hevc_pic_state(VADriverContextP ctx, struct encode_state *encode_state, |
460 | 493 | struct intel_encoder_context *encoder_context) |
461 | 494 | { |
495 | + struct i965_driver_data *i965 = i965_driver_data(ctx); | |
462 | 496 | struct intel_batchbuffer *batch = encoder_context->base.batch; |
463 | 497 | struct gen9_hcpe_context *mfc_context = encoder_context->mfc_context; |
464 | 498 | VAEncPictureParameterBufferHEVC *pic_param ; |
@@ -504,9 +538,18 @@ gen9_hcpe_hevc_pic_state(VADriverContextP ctx, struct encode_state *encode_state | ||
504 | 538 | /* set zero for encoder */ |
505 | 539 | loop_filter_across_tiles_enabled_flag = 0; |
506 | 540 | |
507 | - BEGIN_BCS_BATCH(batch, 19); | |
541 | + if(IS_KBL(i965->intel.device_info)) | |
542 | + { | |
543 | + BEGIN_BCS_BATCH(batch, 31); | |
508 | 544 | |
509 | - OUT_BCS_BATCH(batch, HCP_PIC_STATE | (19 - 2)); | |
545 | + OUT_BCS_BATCH(batch, HCP_PIC_STATE | (31 - 2)); | |
546 | + } | |
547 | + else | |
548 | + { | |
549 | + BEGIN_BCS_BATCH(batch, 19); | |
550 | + | |
551 | + OUT_BCS_BATCH(batch, HCP_PIC_STATE | (19 - 2)); | |
552 | + } | |
510 | 553 | |
511 | 554 | OUT_BCS_BATCH(batch, |
512 | 555 | mfc_context->pic_size.picture_height_in_min_cb_minus1 << 16 | |
@@ -523,7 +566,7 @@ gen9_hcpe_hevc_pic_state(VADriverContextP ctx, struct encode_state *encode_state | ||
523 | 566 | seq_param->log2_min_luma_coding_block_size_minus3); |
524 | 567 | OUT_BCS_BATCH(batch, 0); /* DW 3, ignored */ |
525 | 568 | OUT_BCS_BATCH(batch, |
526 | - 0 << 27 | /* CU packet structure is 0 for SKL */ | |
569 | + (IS_KBL(i965->intel.device_info)? 1 : 0) << 27 | /* CU packet structure is 0 for SKL */ | |
527 | 570 | seq_param->seq_fields.bits.strong_intra_smoothing_enabled_flag << 26 | |
528 | 571 | pic_param->pic_fields.bits.transquant_bypass_enabled_flag << 25 | |
529 | 572 | seq_param->seq_fields.bits.amp_enabled_flag << 23 | |
@@ -577,6 +620,14 @@ gen9_hcpe_hevc_pic_state(VADriverContextP ctx, struct encode_state *encode_state | ||
577 | 620 | 0 << 30 | |
578 | 621 | minframesize); /* DW 18, min frame size units */ |
579 | 622 | |
623 | + if(IS_KBL(i965->intel.device_info)) | |
624 | + { | |
625 | + int i = 0; | |
626 | + | |
627 | + for(i = 0;i < 12;i++) | |
628 | + OUT_BCS_BATCH(batch, 0); | |
629 | + } | |
630 | + | |
580 | 631 | ADVANCE_BCS_BATCH(batch); |
581 | 632 | } |
582 | 633 |
@@ -723,6 +774,7 @@ gen9_hcpe_hevc_slice_state(VADriverContextP ctx, | ||
723 | 774 | struct intel_encoder_context *encoder_context, |
724 | 775 | struct intel_batchbuffer *batch) |
725 | 776 | { |
777 | + struct i965_driver_data *i965 = i965_driver_data(ctx); | |
726 | 778 | VAEncSequenceParameterBufferHEVC *pSequenceParameter = (VAEncSequenceParameterBufferHEVC *)encode_state->seq_param_ext->buffer; |
727 | 779 | int slice_type = slice_param->slice_type; |
728 | 780 |
@@ -754,9 +806,18 @@ gen9_hcpe_hevc_slice_state(VADriverContextP ctx, | ||
754 | 806 | } |
755 | 807 | } |
756 | 808 | |
757 | - BEGIN_BCS_BATCH(batch, 9); | |
809 | + if(IS_KBL(i965->intel.device_info)) | |
810 | + { | |
811 | + BEGIN_BCS_BATCH(batch, 11); | |
812 | + | |
813 | + OUT_BCS_BATCH(batch, HCP_SLICE_STATE | (11 - 2)); | |
814 | + } | |
815 | + else | |
816 | + { | |
817 | + BEGIN_BCS_BATCH(batch, 9); | |
758 | 818 | |
759 | - OUT_BCS_BATCH(batch, HCP_SLICE_STATE | (9 - 2)); | |
819 | + OUT_BCS_BATCH(batch, HCP_SLICE_STATE | (9 - 2)); | |
820 | + } | |
760 | 821 | |
761 | 822 | OUT_BCS_BATCH(batch, |
762 | 823 | slice_ver_pos << 16 | |
@@ -801,6 +862,12 @@ gen9_hcpe_hevc_slice_state(VADriverContextP ctx, | ||
801 | 862 | 0); /* Ignored for decoding */ |
802 | 863 | OUT_BCS_BATCH(batch, 0); /* PAK-BSE data start offset */ |
803 | 864 | |
865 | + if(IS_KBL(i965->intel.device_info)) | |
866 | + { | |
867 | + OUT_BCS_BATCH(batch, 0); | |
868 | + OUT_BCS_BATCH(batch, 0); | |
869 | + } | |
870 | + | |
804 | 871 | ADVANCE_BCS_BATCH(batch); |
805 | 872 | } |
806 | 873 |
@@ -1097,8 +1164,12 @@ gen9_hcpe_hevc_pak_object(VADriverContextP ctx, int lcu_x, int lcu_y, int isLast | ||
1097 | 1164 | int cu_count_in_lcu, unsigned int split_coding_unit_flag, |
1098 | 1165 | struct intel_batchbuffer *batch) |
1099 | 1166 | { |
1167 | + struct i965_driver_data *i965 = i965_driver_data(ctx); | |
1100 | 1168 | int len_in_dwords = 3; |
1101 | 1169 | |
1170 | + if(IS_KBL(i965->intel.device_info)) | |
1171 | + len_in_dwords = 5; | |
1172 | + | |
1102 | 1173 | if (batch == NULL) |
1103 | 1174 | batch = encoder_context->base.batch; |
1104 | 1175 |
@@ -1112,6 +1183,12 @@ gen9_hcpe_hevc_pak_object(VADriverContextP ctx, int lcu_x, int lcu_y, int isLast | ||
1112 | 1183 | |
1113 | 1184 | OUT_BCS_BATCH(batch, (lcu_y << 16) | lcu_x); /* LCU for Y*/ |
1114 | 1185 | |
1186 | + if(IS_KBL(i965->intel.device_info)) | |
1187 | + { | |
1188 | + OUT_BCS_BATCH(batch, 0); | |
1189 | + OUT_BCS_BATCH(batch, 0); | |
1190 | + } | |
1191 | + | |
1115 | 1192 | ADVANCE_BCS_BATCH(batch); |
1116 | 1193 | |
1117 | 1194 | return len_in_dwords; |
@@ -413,6 +413,57 @@ static struct hw_codec_info bxt_hw_codec_info = { | ||
413 | 413 | }, |
414 | 414 | }; |
415 | 415 | |
416 | +static struct hw_codec_info kbl_hw_codec_info = { | |
417 | + .dec_hw_context_init = gen9_dec_hw_context_init, | |
418 | + .enc_hw_context_init = gen9_enc_hw_context_init, | |
419 | + .proc_hw_context_init = gen75_proc_context_init, | |
420 | + .render_init = gen9_render_init, | |
421 | + .post_processing_context_init = gen9_post_processing_context_init, | |
422 | + | |
423 | + .max_width = 4096, | |
424 | + .max_height = 4096, | |
425 | + .min_linear_wpitch = 64, | |
426 | + .min_linear_hpitch = 16, | |
427 | + | |
428 | + .h264_mvc_dec_profiles = (VA_PROFILE_MASK(H264StereoHigh) | | |
429 | + VA_PROFILE_MASK(H264MultiviewHigh)), | |
430 | + .h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS, | |
431 | + .jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS, | |
432 | + .jpeg_enc_chroma_formats = EXTRA_JPEG_ENC_CHROMA_FORMATS, | |
433 | + .hevc_dec_chroma_formats = EXTRA_HEVC_DEC_CHROMA_FORMATS, | |
434 | + | |
435 | + .has_mpeg2_decoding = 1, | |
436 | + .has_mpeg2_encoding = 1, | |
437 | + .has_h264_decoding = 1, | |
438 | + .has_h264_encoding = 1, | |
439 | + .has_vc1_decoding = 1, | |
440 | + .has_jpeg_decoding = 1, | |
441 | + .has_jpeg_encoding = 1, | |
442 | + .has_vpp = 1, | |
443 | + .has_accelerated_getimage = 1, | |
444 | + .has_accelerated_putimage = 1, | |
445 | + .has_tiled_surface = 1, | |
446 | + .has_di_motion_adptive = 1, | |
447 | + .has_di_motion_compensated = 1, | |
448 | + .has_vp8_decoding = 1, | |
449 | + .has_vp8_encoding = 1, | |
450 | + .has_h264_mvc_encoding = 1, | |
451 | + .has_hevc_decoding = 1, | |
452 | + .has_hevc_encoding = 1, | |
453 | + .has_hevc10_decoding = 1, | |
454 | + .has_vp9_decoding = 1, | |
455 | + .has_vpp_p010 = 1, | |
456 | + | |
457 | + .num_filters = 5, | |
458 | + .filters = { | |
459 | + { VAProcFilterNoiseReduction, I965_RING_VEBOX }, | |
460 | + { VAProcFilterDeinterlacing, I965_RING_VEBOX }, | |
461 | + { VAProcFilterSharpening, I965_RING_NULL }, | |
462 | + { VAProcFilterColorBalance, I965_RING_VEBOX}, | |
463 | + { VAProcFilterSkinToneEnhancement, I965_RING_VEBOX}, | |
464 | + }, | |
465 | +}; | |
466 | + | |
416 | 467 | struct hw_codec_info * |
417 | 468 | i965_get_codec_info(int devid) |
418 | 469 | { |
@@ -549,6 +600,15 @@ static const struct intel_device_info bxt_device_info = { | ||
549 | 600 | .is_broxton = 1, |
550 | 601 | }; |
551 | 602 | |
603 | +static const struct intel_device_info kbl_device_info = { | |
604 | + .gen = 9, | |
605 | + | |
606 | + .urb_size = 4096, | |
607 | + .max_wm_threads = 64, /* per PSD */ | |
608 | + | |
609 | + .is_kabylake = 1, | |
610 | +}; | |
611 | + | |
552 | 612 | const struct intel_device_info * |
553 | 613 | i965_get_device_info(int devid) |
554 | 614 | { |
@@ -158,3 +158,25 @@ CHIPSET(0x193D, skl, skl, "Intel(R) Skylake") | ||
158 | 158 | CHIPSET(0x0A84, bxt, bxt, "Intel(R) Broxton") |
159 | 159 | CHIPSET(0x1A84, bxt, bxt, "Intel(R) Broxton") |
160 | 160 | CHIPSET(0x5A84, bxt, bxt, "Intel(R) Broxton") |
161 | +CHIPSET(0x5916, kbl, kbl, "Intel(R) Kabylake") | |
162 | +CHIPSET(0x5913, kbl, kbl, "Intel(R) Kabylake") | |
163 | +CHIPSET(0x5906, kbl, kbl, "Intel(R) Kabylake") | |
164 | +CHIPSET(0x5926, kbl, kbl, "Intel(R) Kabylake") | |
165 | +CHIPSET(0x5921, kbl, kbl, "Intel(R) Kabylake") | |
166 | +CHIPSET(0x5915, kbl, kbl, "Intel(R) Kabylake") | |
167 | +CHIPSET(0x590E, kbl, kbl, "Intel(R) Kabylake") | |
168 | +CHIPSET(0x591E, kbl, kbl, "Intel(R) Kabylake") | |
169 | +CHIPSET(0x5912, kbl, kbl, "Intel(R) Kabylake") | |
170 | +CHIPSET(0x5917, kbl, kbl, "Intel(R) Kabylake") | |
171 | +CHIPSET(0x5902, kbl, kbl, "Intel(R) Kabylake") | |
172 | +CHIPSET(0x5932, kbl, kbl, "Intel(R) Kabylake") | |
173 | +CHIPSET(0x591B, kbl, kbl, "Intel(R) Kabylake") | |
174 | +CHIPSET(0x592B, kbl, kbl, "Intel(R) Kabylake") | |
175 | +CHIPSET(0x593B, kbl, kbl, "Intel(R) Kabylake") | |
176 | +CHIPSET(0x590B, kbl, kbl, "Intel(R) Kabylake") | |
177 | +CHIPSET(0x591A, kbl, kbl, "Intel(R) Kabylake") | |
178 | +CHIPSET(0x592A, kbl, kbl, "Intel(R) Kabylake") | |
179 | +CHIPSET(0x593A, kbl, kbl, "Intel(R) Kabylake") | |
180 | +CHIPSET(0x590A, kbl, kbl, "Intel(R) Kabylake") | |
181 | +CHIPSET(0x591D, kbl, kbl, "Intel(R) Kabylake") | |
182 | +CHIPSET(0x593D, kbl, kbl, "Intel(R) Kabylake") | |
\ No newline at end of file |
@@ -137,6 +137,7 @@ struct intel_device_info | ||
137 | 137 | unsigned int is_haswell : 1; /* gen7 */ |
138 | 138 | unsigned int is_cherryview : 1; /* gen8 */ |
139 | 139 | unsigned int is_broxton : 1; /* gen9 */ |
140 | + unsigned int is_kabylake : 1; /* gen9p5 */ | |
140 | 141 | }; |
141 | 142 | |
142 | 143 | struct intel_driver_data |
@@ -198,4 +199,6 @@ struct intel_region | ||
198 | 199 | |
199 | 200 | #define IS_GEN9(device_info) (device_info->gen == 9) |
200 | 201 | |
202 | +#define IS_KBL(device_info) (device_info->is_kabylake) | |
203 | + | |
201 | 204 | #endif /* _INTEL_DRIVER_H_ */ |