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 <katarzyna.dec@intel.com>
Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Ewelina Musial <ewelina.musial@intel.com>
Reviewed-By: Ewelina Musial <ewelina.musial@intel.com>
diff --git a/lib/media_spin.c b/lib/media_spin.c
index 3592e0d..c3a8d57 100644
--- a/lib/media_spin.c
+++ b/lib/media_spin.c
@@ -67,6 +67,17 @@
  */
 
 #define BATCH_STATE_SPLIT 2048
+/* VFE STATE params */
+#define THREADS 0
+#define MEDIA_URB_ENTRIES 2
+#define MEDIA_URB_SIZE 2
+#define MEDIA_CURBE_SIZE 2
+
+/* Offsets needed in gen_emit_media_object. In media_spin library this
+ * values do not matter.
+ */
+#define xoffset 0
+#define yoffset 0
 
 void
 gen8_media_spinfunc(struct intel_batchbuffer *batch,
@@ -90,13 +101,14 @@
 	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
 	gen8_emit_state_base_address(batch);
 
-	gen8_emit_vfe_state_spin(batch);
+	gen8_emit_vfe_state(batch, THREADS, MEDIA_URB_ENTRIES,
+			    MEDIA_URB_SIZE, MEDIA_CURBE_SIZE);
 
 	gen7_emit_curbe_load(batch, curbe_buffer);
 
 	gen7_emit_interface_descriptor_load(batch, interface_descriptor);
 
-	gen8_emit_media_objects_spin(batch);
+	gen_emit_media_object(batch, xoffset, yoffset);
 
 	OUT_BATCH(MI_BATCH_BUFFER_END);
 
@@ -134,13 +146,14 @@
 		  GEN9_FORCE_MEDIA_AWAKE_MASK);
 	gen9_emit_state_base_address(batch);
 
-	gen8_emit_vfe_state_spin(batch);
+	gen8_emit_vfe_state(batch, THREADS, MEDIA_URB_ENTRIES,
+			    MEDIA_URB_SIZE, MEDIA_CURBE_SIZE);
 
 	gen7_emit_curbe_load(batch, curbe_buffer);
 
 	gen7_emit_interface_descriptor_load(batch, interface_descriptor);
 
-	gen8_emit_media_objects_spin(batch);
+	gen_emit_media_object(batch, xoffset, yoffset);
 
 	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA |
 		  GEN9_FORCE_MEDIA_AWAKE_DISABLE |