From b8fdb26250064ae7de0e82a02428278196c19afb Mon Sep 17 00:00:00 2001 From: Katarzyna Dec Date: Fri, 11 May 2018 08:46:29 +0200 Subject: lib/gpu_fill: Further code unification in gpu_fill We can unify gen7_emit_vfe_state and gen8_emit_vfe_state functions for gpgpu/media_fill and media_spin by adding parameters. gen8_emit_media_object was renamed to gen_* and extended with additional offset parameters - we can have one gen7_emit_media_objects for all tests. I have renamed gen8_emit_media_object to gen_emit_*, because function belongs to all gens and it would be odd to have all named genX_* and only one without this prefix. v2: Use #defines instead of variables as emit_vfe_state parameters. Fixed gen7_emit_media_objects. Unified vfe state parameters in media_spin library for gen8 and gen9 (gen9 had different values by mistake). v3: Fixed bug in emit_vfe_state for gen8 and gen9 in gpgpu_fill. Moved #defines for emit_vfe_state to particular libraries. v4: Fixed indentations in media_spin v5: Few more style changes. Signed-off-by: Katarzyna Dec Cc: Lukasz Kalamarz Cc: Antonio Argenziano Reviewed-by: Daniele Ceraolo Spurio Cc: Ewelina Musial Reviewed-By: Ewelina Musial --- lib/gpgpu_fill.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'lib/gpgpu_fill.c') diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c index 52925a5c..9a2598bc 100644 --- a/lib/gpgpu_fill.c +++ b/lib/gpgpu_fill.c @@ -95,6 +95,13 @@ static const uint32_t gen9_gpgpu_kernel[][4] = { */ #define BATCH_STATE_SPLIT 2048 +/* VFE STATE params */ +#define THREADS 1 +#define GEN7_GPGPU_URB_ENTRIES 0 +#define GEN8_GPGPU_URB_ENTRIES 1 +#define GPGPU_URB_SIZE 0 +#define GPGPU_CURBE_SIZE 1 +#define GEN7_VFE_STATE_GPGPU_MODE 1 void gen7_gpgpu_fillfunc(struct intel_batchbuffer *batch, @@ -129,7 +136,9 @@ gen7_gpgpu_fillfunc(struct intel_batchbuffer *batch, OUT_BATCH(GEN7_PIPELINE_SELECT | PIPELINE_SELECT_GPGPU); gen7_emit_state_base_address(batch); - gen7_emit_vfe_state_gpgpu(batch); + gen7_emit_vfe_state(batch, THREADS, GEN7_GPGPU_URB_ENTRIES, + GPGPU_URB_SIZE, GPGPU_CURBE_SIZE, + GEN7_VFE_STATE_GPGPU_MODE); gen7_emit_curbe_load(batch, curbe_buffer); gen7_emit_interface_descriptor_load(batch, interface_descriptor); gen7_emit_gpgpu_walk(batch, x, y, width, height); @@ -176,7 +185,8 @@ gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch, OUT_BATCH(GEN7_PIPELINE_SELECT | PIPELINE_SELECT_GPGPU); gen8_emit_state_base_address(batch); - gen8_emit_vfe_state_gpgpu(batch); + gen8_emit_vfe_state(batch, THREADS, GEN8_GPGPU_URB_ENTRIES, + GPGPU_URB_SIZE, GPGPU_CURBE_SIZE); gen7_emit_curbe_load(batch, curbe_buffer); gen7_emit_interface_descriptor_load(batch, interface_descriptor); gen8_emit_gpgpu_walk(batch, x, y, width, height); @@ -224,7 +234,8 @@ gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch, PIPELINE_SELECT_GPGPU); gen9_emit_state_base_address(batch); - gen8_emit_vfe_state_gpgpu(batch); + gen8_emit_vfe_state(batch, THREADS, GEN8_GPGPU_URB_ENTRIES, + GPGPU_URB_SIZE, GPGPU_CURBE_SIZE); gen7_emit_curbe_load(batch, curbe_buffer); gen7_emit_interface_descriptor_load(batch, interface_descriptor); gen8_emit_gpgpu_walk(batch, x, y, width, height); -- cgit v1.2.3