hardware/intel/intel-driver
Revisión | e4612c31f70c73e817be64192e7855c88f8ff8c4 (tree) |
---|---|
Tiempo | 2014-12-14 01:42:16 |
Autor | Xiang, Haihao <haihao.xiang@inte...> |
Commiter | Xiang, Haihao |
Fix SKL media pipeline for VPP
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit 2433a174971266c092b8db59943557e000dcbb4e)
Conflicts:
src/gen8_post_processing.c
@@ -1006,7 +1006,7 @@ gen8_pp_plx_avs_initialize(VADriverContextP ctx, struct i965_post_processing_con | ||
1006 | 1006 | return VA_STATUS_SUCCESS; |
1007 | 1007 | } |
1008 | 1008 | |
1009 | -static VAStatus | |
1009 | +VAStatus | |
1010 | 1010 | gen8_pp_initialize( |
1011 | 1011 | VADriverContextP ctx, |
1012 | 1012 | struct i965_post_processing_context *pp_context, |
@@ -1151,7 +1151,7 @@ gen8_pp_upload_constants(VADriverContextP ctx, | ||
1151 | 1151 | return; |
1152 | 1152 | } |
1153 | 1153 | |
1154 | -static void | |
1154 | +void | |
1155 | 1155 | gen8_pp_states_setup(VADriverContextP ctx, |
1156 | 1156 | struct i965_post_processing_context *pp_context) |
1157 | 1157 | { |
@@ -1205,7 +1205,7 @@ gen8_pp_state_base_address(VADriverContextP ctx, | ||
1205 | 1205 | ADVANCE_BATCH(batch); |
1206 | 1206 | } |
1207 | 1207 | |
1208 | -static void | |
1208 | +void | |
1209 | 1209 | gen8_pp_vfe_state(VADriverContextP ctx, |
1210 | 1210 | struct i965_post_processing_context *pp_context) |
1211 | 1211 | { |
@@ -1230,7 +1230,7 @@ gen8_pp_vfe_state(VADriverContextP ctx, | ||
1230 | 1230 | ADVANCE_BATCH(batch); |
1231 | 1231 | } |
1232 | 1232 | |
1233 | -static void | |
1233 | +void | |
1234 | 1234 | gen8_interface_descriptor_load(VADriverContextP ctx, |
1235 | 1235 | struct i965_post_processing_context *pp_context) |
1236 | 1236 | { |
@@ -1249,7 +1249,7 @@ gen8_interface_descriptor_load(VADriverContextP ctx, | ||
1249 | 1249 | ADVANCE_BATCH(batch); |
1250 | 1250 | } |
1251 | 1251 | |
1252 | -static void | |
1252 | +void | |
1253 | 1253 | gen8_pp_curbe_load(VADriverContextP ctx, |
1254 | 1254 | struct i965_post_processing_context *pp_context) |
1255 | 1255 | { |
@@ -1268,7 +1268,7 @@ gen8_pp_curbe_load(VADriverContextP ctx, | ||
1268 | 1268 | ADVANCE_BATCH(batch); |
1269 | 1269 | } |
1270 | 1270 | |
1271 | -static void | |
1271 | +void | |
1272 | 1272 | gen8_pp_object_walker(VADriverContextP ctx, |
1273 | 1273 | struct i965_post_processing_context *pp_context) |
1274 | 1274 | { |
@@ -50,6 +50,36 @@ gen8_pp_nv12_blending_initialize(VADriverContextP ctx, struct i965_post_processi | ||
50 | 50 | void *filter_param); |
51 | 51 | |
52 | 52 | void |
53 | +gen8_pp_vfe_state(VADriverContextP ctx, | |
54 | + struct i965_post_processing_context *pp_context); | |
55 | + | |
56 | +void | |
57 | +gen8_interface_descriptor_load(VADriverContextP ctx, | |
58 | + struct i965_post_processing_context *pp_context); | |
59 | + | |
60 | +void | |
61 | +gen8_pp_curbe_load(VADriverContextP ctx, | |
62 | + struct i965_post_processing_context *pp_context); | |
63 | + | |
64 | +void | |
65 | +gen8_pp_object_walker(VADriverContextP ctx, | |
66 | + struct i965_post_processing_context *pp_context); | |
67 | + | |
68 | +void | |
69 | +gen8_pp_states_setup(VADriverContextP ctx, | |
70 | + struct i965_post_processing_context *pp_context); | |
71 | + | |
72 | +VAStatus | |
73 | +gen8_pp_initialize(VADriverContextP ctx, | |
74 | + struct i965_post_processing_context *pp_context, | |
75 | + const struct i965_surface *src_surface, | |
76 | + const VARectangle *src_rect, | |
77 | + struct i965_surface *dst_surface, | |
78 | + const VARectangle *dst_rect, | |
79 | + int pp_index, | |
80 | + void *filter_param); | |
81 | + | |
82 | +void | |
53 | 83 | gen8_post_processing_context_common_init(VADriverContextP ctx, |
54 | 84 | void *data, |
55 | 85 | struct pp_module *pp_modules, |
@@ -295,10 +295,137 @@ static struct pp_module pp_modules_gen9[] = { | ||
295 | 295 | }, |
296 | 296 | }; |
297 | 297 | |
298 | +static void | |
299 | +gen9_pp_pipeline_select(VADriverContextP ctx, | |
300 | + struct i965_post_processing_context *pp_context) | |
301 | +{ | |
302 | + struct intel_batchbuffer *batch = pp_context->batch; | |
303 | + | |
304 | + BEGIN_BATCH(batch, 1); | |
305 | + OUT_BATCH(batch, | |
306 | + CMD_PIPELINE_SELECT | | |
307 | + PIPELINE_SELECT_MEDIA | | |
308 | + GEN9_FORCE_MEDIA_AWAKE_ON | | |
309 | + GEN9_MEDIA_DOP_GATE_OFF | | |
310 | + GEN9_PIPELINE_SELECTION_MASK | | |
311 | + GEN9_MEDIA_DOP_GATE_MASK | | |
312 | + GEN9_FORCE_MEDIA_AWAKE_MASK); | |
313 | + ADVANCE_BATCH(batch); | |
314 | +} | |
315 | + | |
316 | +static void | |
317 | +gen9_pp_state_base_address(VADriverContextP ctx, | |
318 | + struct i965_post_processing_context *pp_context) | |
319 | +{ | |
320 | + struct intel_batchbuffer *batch = pp_context->batch; | |
321 | + | |
322 | + BEGIN_BATCH(batch, 19); | |
323 | + OUT_BATCH(batch, CMD_STATE_BASE_ADDRESS | (19 - 2)); | |
324 | + /* DW1 Generate state address */ | |
325 | + OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY); | |
326 | + OUT_BATCH(batch, 0); | |
327 | + OUT_BATCH(batch, 0); | |
328 | + /* DW4. Surface state address */ | |
329 | + OUT_RELOC(batch, pp_context->surface_state_binding_table.bo, I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); /* Surface state base address */ | |
330 | + OUT_BATCH(batch, 0); | |
331 | + /* DW6. Dynamic state address */ | |
332 | + OUT_RELOC(batch, pp_context->dynamic_state.bo, I915_GEM_DOMAIN_RENDER | I915_GEM_DOMAIN_SAMPLER, | |
333 | + 0, 0 | BASE_ADDRESS_MODIFY); | |
334 | + OUT_BATCH(batch, 0); | |
335 | + | |
336 | + /* DW8. Indirect object address */ | |
337 | + OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY); | |
338 | + OUT_BATCH(batch, 0); | |
339 | + | |
340 | + /* DW10. Instruction base address */ | |
341 | + OUT_RELOC(batch, pp_context->instruction_state.bo, I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); | |
342 | + OUT_BATCH(batch, 0); | |
343 | + | |
344 | + OUT_BATCH(batch, 0xFFFF0000 | BASE_ADDRESS_MODIFY); | |
345 | + OUT_BATCH(batch, 0xFFFF0000 | BASE_ADDRESS_MODIFY); | |
346 | + OUT_BATCH(batch, 0xFFFF0000 | BASE_ADDRESS_MODIFY); | |
347 | + OUT_BATCH(batch, 0xFFFF0000 | BASE_ADDRESS_MODIFY); | |
348 | + | |
349 | + /* Bindless surface state base address */ | |
350 | + OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY); | |
351 | + OUT_BATCH(batch, 0); | |
352 | + OUT_BATCH(batch, 0xfffff000); | |
353 | + | |
354 | + ADVANCE_BATCH(batch); | |
355 | +} | |
356 | + | |
357 | +static void | |
358 | +gen9_pp_end_pipeline(VADriverContextP ctx, | |
359 | + struct i965_post_processing_context *pp_context) | |
360 | +{ | |
361 | + struct intel_batchbuffer *batch = pp_context->batch; | |
362 | + | |
363 | + BEGIN_BATCH(batch, 1); | |
364 | + OUT_BATCH(batch, | |
365 | + CMD_PIPELINE_SELECT | | |
366 | + PIPELINE_SELECT_MEDIA | | |
367 | + GEN9_FORCE_MEDIA_AWAKE_OFF | | |
368 | + GEN9_MEDIA_DOP_GATE_ON | | |
369 | + GEN9_PIPELINE_SELECTION_MASK | | |
370 | + GEN9_MEDIA_DOP_GATE_MASK | | |
371 | + GEN9_FORCE_MEDIA_AWAKE_MASK); | |
372 | + ADVANCE_BATCH(batch); | |
373 | +} | |
374 | + | |
375 | +static void | |
376 | +gen9_pp_pipeline_setup(VADriverContextP ctx, | |
377 | + struct i965_post_processing_context *pp_context) | |
378 | +{ | |
379 | + struct intel_batchbuffer *batch = pp_context->batch; | |
380 | + | |
381 | + intel_batchbuffer_start_atomic(batch, 0x1000); | |
382 | + intel_batchbuffer_emit_mi_flush(batch); | |
383 | + gen9_pp_pipeline_select(ctx, pp_context); | |
384 | + gen9_pp_state_base_address(ctx, pp_context); | |
385 | + gen8_pp_vfe_state(ctx, pp_context); | |
386 | + gen8_pp_curbe_load(ctx, pp_context); | |
387 | + gen8_interface_descriptor_load(ctx, pp_context); | |
388 | + gen8_pp_object_walker(ctx, pp_context); | |
389 | + gen9_pp_end_pipeline(ctx, pp_context); | |
390 | + intel_batchbuffer_end_atomic(batch); | |
391 | +} | |
392 | + | |
393 | +static VAStatus | |
394 | +gen9_post_processing(VADriverContextP ctx, | |
395 | + struct i965_post_processing_context *pp_context, | |
396 | + const struct i965_surface *src_surface, | |
397 | + const VARectangle *src_rect, | |
398 | + struct i965_surface *dst_surface, | |
399 | + const VARectangle *dst_rect, | |
400 | + int pp_index, | |
401 | + void * filter_param) | |
402 | +{ | |
403 | + VAStatus va_status; | |
404 | + | |
405 | + va_status = gen8_pp_initialize(ctx, pp_context, | |
406 | + src_surface, | |
407 | + src_rect, | |
408 | + dst_surface, | |
409 | + dst_rect, | |
410 | + pp_index, | |
411 | + filter_param); | |
412 | + | |
413 | + if (va_status == VA_STATUS_SUCCESS) { | |
414 | + gen8_pp_states_setup(ctx, pp_context); | |
415 | + gen9_pp_pipeline_setup(ctx, pp_context); | |
416 | + } | |
417 | + | |
418 | + return va_status; | |
419 | +} | |
420 | + | |
298 | 421 | void |
299 | 422 | gen9_post_processing_context_init(VADriverContextP ctx, |
300 | 423 | void *data, |
301 | 424 | struct intel_batchbuffer *batch) |
302 | 425 | { |
426 | + struct i965_post_processing_context *pp_context = data; | |
427 | + | |
303 | 428 | gen8_post_processing_context_common_init(ctx, data, pp_modules_gen9, ARRAY_ELEMS(pp_modules_gen9), batch); |
429 | + | |
430 | + pp_context->intel_post_processing = gen9_post_processing; | |
304 | 431 | } |