diff options
author | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2020-05-26 10:14:48 +0200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-05-26 15:05:49 +0100 |
commit | 93639b4e52140826c24da21865e912a280f9aefb (patch) | |
tree | f84cacc9f89d34b0b8c13b7d8f550dcf3b198775 /lib | |
parent | 1c181c2cd48ab45d519744fd1fb4f05d2e6a672b (diff) |
lib/media_fill: Migrate gen11 media pipeline creation to intel_bb
Function is now libdrm-free, but mixes calls to replaced and "_v2"
versions. This cleanup and old code removal will be addressed
in the another commit.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/intel_batchbuffer.h | 7 | ||||
-rw-r--r-- | lib/media_fill.c | 78 | ||||
-rw-r--r-- | lib/media_fill.h | 7 |
3 files changed, 49 insertions, 43 deletions
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h index e7ac58fa7..162e7f0cb 100644 --- a/lib/intel_batchbuffer.h +++ b/lib/intel_batchbuffer.h @@ -403,10 +403,11 @@ igt_fillfunc_t igt_get_gpgpu_fillfunc(int devid); igt_fillfunc_v2_t igt_get_gpgpu_fillfunc_v2(int devid); igt_fillfunc_v2_t igt_get_media_fillfunc_v2(int devid); -typedef void (*igt_vme_func_t)(struct intel_batchbuffer *batch, - const struct igt_buf *src, +typedef void (*igt_vme_func_t)(int i915, + uint32_t ctx, + struct intel_buf *src, unsigned int width, unsigned int height, - const struct igt_buf *dst); + struct intel_buf *dst); igt_vme_func_t igt_get_media_vme_func(int devid); diff --git a/lib/media_fill.c b/lib/media_fill.c index bac3b9bf0..53d63b4b3 100644 --- a/lib/media_fill.c +++ b/lib/media_fill.c @@ -457,68 +457,72 @@ gen9_media_fillfunc_v2(int i915, } static void -__gen11_media_vme_func(struct intel_batchbuffer *batch, - const struct igt_buf *src, +__gen11_media_vme_func(int i915, + uint32_t ctx, + struct intel_buf *src, unsigned int width, unsigned int height, - const struct igt_buf *dst, + struct intel_buf *dst, const uint32_t kernel[][4], size_t kernel_size) { + struct intel_bb *ibb; uint32_t curbe_buffer, interface_descriptor; - uint32_t batch_end; - intel_batchbuffer_flush(batch); + ibb = intel_bb_create(i915, PAGE_SIZE); + intel_bb_add_object(ibb, dst->handle, 0, true); + intel_bb_add_object(ibb, src->handle, 0, false); /* setup states */ - batch->ptr = &batch->buffer[BATCH_STATE_SPLIT]; + intel_bb_ptr_set(ibb, BATCH_STATE_SPLIT); - curbe_buffer = gen11_fill_curbe_buffer_data(batch); - interface_descriptor = gen11_fill_interface_descriptor(batch, src, dst, + curbe_buffer = gen11_fill_curbe_buffer_data(ibb); + interface_descriptor = gen11_fill_interface_descriptor(ibb, src, dst, kernel, kernel_size); - assert(batch->ptr < &batch->buffer[4095]); + + intel_bb_ptr_set(ibb, 0); /* media pipeline */ - batch->ptr = batch->buffer; - OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA | - GEN9_FORCE_MEDIA_AWAKE_ENABLE | - GEN9_SAMPLER_DOP_GATE_DISABLE | - GEN9_PIPELINE_SELECTION_MASK | - GEN9_SAMPLER_DOP_GATE_MASK | - GEN9_FORCE_MEDIA_AWAKE_MASK); - gen9_emit_state_base_address(batch); + intel_bb_out(ibb, GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA | + GEN9_FORCE_MEDIA_AWAKE_ENABLE | + GEN9_SAMPLER_DOP_GATE_DISABLE | + GEN9_PIPELINE_SELECTION_MASK | + GEN9_SAMPLER_DOP_GATE_MASK | + GEN9_FORCE_MEDIA_AWAKE_MASK); + gen9_emit_state_base_address_v2(ibb); - gen8_emit_vfe_state(batch, THREADS, MEDIA_URB_ENTRIES, MEDIA_URB_SIZE, + gen8_emit_vfe_state_v2(ibb, THREADS, MEDIA_URB_ENTRIES, MEDIA_URB_SIZE, MEDIA_CURBE_SIZE); - gen7_emit_curbe_load(batch, curbe_buffer); + gen7_emit_curbe_load_v2(ibb, curbe_buffer); - gen7_emit_interface_descriptor_load(batch, interface_descriptor); + gen7_emit_interface_descriptor_load_v2(ibb, interface_descriptor); - gen7_emit_media_objects(batch, 0, 0, width, height); + gen7_emit_media_objects_v2(ibb, 0, 0, width, height); - OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA | - GEN9_FORCE_MEDIA_AWAKE_DISABLE | - GEN9_SAMPLER_DOP_GATE_ENABLE | - GEN9_PIPELINE_SELECTION_MASK | - GEN9_SAMPLER_DOP_GATE_MASK | - GEN9_FORCE_MEDIA_AWAKE_MASK); - - OUT_BATCH(MI_BATCH_BUFFER_END); + intel_bb_out(ibb, GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA | + GEN9_FORCE_MEDIA_AWAKE_DISABLE | + GEN9_SAMPLER_DOP_GATE_ENABLE | + GEN9_PIPELINE_SELECTION_MASK | + GEN9_SAMPLER_DOP_GATE_MASK | + GEN9_FORCE_MEDIA_AWAKE_MASK); - batch_end = intel_batchbuffer_align(batch, 8); - assert(batch_end < BATCH_STATE_SPLIT); + intel_bb_out(ibb, MI_BATCH_BUFFER_END); + intel_bb_ptr_align(ibb, 32); - gen7_render_context_flush(batch, batch_end); - intel_batchbuffer_reset(batch); + intel_bb_exec_with_context(ibb, intel_bb_offset(ibb), ctx, + I915_EXEC_DEFAULT | I915_EXEC_NO_RELOC, + false); + intel_bb_destroy(ibb); } void -gen11_media_vme_func(struct intel_batchbuffer *batch, - const struct igt_buf *src, +gen11_media_vme_func(int i915, + uint32_t ctx, + struct intel_buf *src, unsigned int width, unsigned int height, - const struct igt_buf *dst) + struct intel_buf *dst) { - __gen11_media_vme_func(batch, + __gen11_media_vme_func(i915, ctx, src, width, height, dst, diff --git a/lib/media_fill.h b/lib/media_fill.h index 84fd460b3..851a9915a 100644 --- a/lib/media_fill.h +++ b/lib/media_fill.h @@ -72,10 +72,11 @@ gen9_media_fillfunc_v2(int i915, uint8_t color); void -gen11_media_vme_func(struct intel_batchbuffer *batch, - const struct igt_buf *src, +gen11_media_vme_func(int i915, + uint32_t ctx, + struct intel_buf *src, unsigned int width, unsigned int height, - const struct igt_buf *dst); + struct intel_buf *dst); void gen12_media_fillfunc(struct intel_batchbuffer *batch, |