All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v5 1/2] lib/media_fill: Create common media_fill library for all gens
@ 2018-05-15  9:09 Katarzyna Dec
  2018-05-15  9:09 ` [igt-dev] [PATCH i-g-t v5 2/2] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc Katarzyna Dec
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Katarzyna Dec @ 2018-05-15  9:09 UTC (permalink / raw)
  To: igt-dev

Let's create common media_fill library, similarly as for gpgpu_fill.
This will allow to make code easier to read and maintain.
Moreover we can create generic __gen9_media_fillfunc for future gens.
From gen9 media fillfunctions differ only with kernel parameter.

v2: fixed indentations in files
v3: Added missing copyright headers. Made __gen9_media_fillfunc static.
Removed gen9 kernel (the same as for gen8).
v4: rebase

Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Ewelina Musial <ewelina.musial@intel.com>
---
 lib/Makefile.sources  |   4 +-
 lib/media_fill.c      | 247 ++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/media_fill.h      |  48 +++++++---
 lib/media_fill_gen7.c |  94 -------------------
 lib/media_fill_gen8.c |  96 --------------------
 lib/media_fill_gen9.c | 105 ---------------------
 lib/meson.build       |   4 +-
 7 files changed, 285 insertions(+), 313 deletions(-)
 create mode 100644 lib/media_fill.c
 delete mode 100644 lib/media_fill_gen7.c
 delete mode 100644 lib/media_fill_gen8.c
 delete mode 100644 lib/media_fill_gen9.c

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index c0c33206..aa064e83 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -55,10 +55,8 @@ lib_source_list =	 	\
 	intel_reg.h		\
 	ioctl_wrappers.c	\
 	ioctl_wrappers.h	\
+	media_fill.c		\
 	media_fill.h            \
-	media_fill_gen7.c       \
-	media_fill_gen8.c       \
-	media_fill_gen9.c       \
 	media_spin.h		\
 	media_spin.c		\
 	gpgpu_fill.h		\
diff --git a/lib/media_fill.c b/lib/media_fill.c
new file mode 100644
index 00000000..0223c0bb
--- /dev/null
+++ b/lib/media_fill.c
@@ -0,0 +1,247 @@
+/*
+ * Copyright © 2018 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <intel_bufmgr.h>
+#include <i915_drm.h>
+
+#include "media_fill.h"
+#include "gen7_media.h"
+#include "gen8_media.h"
+#include "intel_reg.h"
+#include "drmtest.h"
+#include "gpu_cmds.h"
+#include <assert.h>
+
+static const uint32_t gen7_media_kernel[][4] = {
+	{ 0x00400001, 0x20200231, 0x00000020, 0x00000000 },
+	{ 0x00600001, 0x20800021, 0x008d0000, 0x00000000 },
+	{ 0x00200001, 0x20800021, 0x00450040, 0x00000000 },
+	{ 0x00000001, 0x20880061, 0x00000000, 0x000f000f },
+	{ 0x00800001, 0x20a00021, 0x00000020, 0x00000000 },
+	{ 0x00800001, 0x20e00021, 0x00000020, 0x00000000 },
+	{ 0x00800001, 0x21200021, 0x00000020, 0x00000000 },
+	{ 0x00800001, 0x21600021, 0x00000020, 0x00000000 },
+	{ 0x05800031, 0x24001ca8, 0x00000080, 0x120a8000 },
+	{ 0x00600001, 0x2e000021, 0x008d0000, 0x00000000 },
+	{ 0x07800031, 0x20001ca8, 0x00000e00, 0x82000010 },
+};
+
+static const uint32_t gen8_media_kernel[][4] = {
+	{ 0x00400001, 0x20202288, 0x00000020, 0x00000000 },
+	{ 0x00600001, 0x20800208, 0x008d0000, 0x00000000 },
+	{ 0x00200001, 0x20800208, 0x00450040, 0x00000000 },
+	{ 0x00000001, 0x20880608, 0x00000000, 0x000f000f },
+	{ 0x00800001, 0x20a00208, 0x00000020, 0x00000000 },
+	{ 0x00800001, 0x20e00208, 0x00000020, 0x00000000 },
+	{ 0x00800001, 0x21200208, 0x00000020, 0x00000000 },
+	{ 0x00800001, 0x21600208, 0x00000020, 0x00000000 },
+	{ 0x0c800031, 0x24000a40, 0x0e000080, 0x120a8000 },
+	{ 0x00600001, 0x2e000208, 0x008d0000, 0x00000000 },
+	{ 0x07800031, 0x20000a40, 0x0e000e00, 0x82000010 },
+};
+
+/*
+ * This sets up the media pipeline,
+ *
+ * +---------------+ <---- 4096
+ * |       ^       |
+ * |       |       |
+ * |    various    |
+ * |      state    |
+ * |       |       |
+ * |_______|_______| <---- 2048 + ?
+ * |       ^       |
+ * |       |       |
+ * |   batch       |
+ * |    commands   |
+ * |       |       |
+ * |       |       |
+ * +---------------+ <---- 0 + ?
+ *
+ */
+
+#define BATCH_STATE_SPLIT 2048
+/* VFE STATE params */
+#define THREADS 1
+#define MEDIA_URB_ENTRIES 2
+#define MEDIA_URB_SIZE 2
+#define MEDIA_CURBE_SIZE 2
+#define GEN7_VFE_STATE_MEDIA_MODE 0
+
+void
+gen7_media_fillfunc(struct intel_batchbuffer *batch,
+		    struct igt_buf *dst,
+		    unsigned int x, unsigned int y,
+		    unsigned int width, unsigned int height,
+		    uint8_t color)
+{
+	uint32_t curbe_buffer, interface_descriptor;
+	uint32_t batch_end;
+
+	intel_batchbuffer_flush(batch);
+
+	/* setup states */
+	batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
+
+	curbe_buffer = gen7_fill_curbe_buffer_data(batch, color);
+	interface_descriptor = gen7_fill_interface_descriptor(batch, dst,
+					gen7_media_kernel,
+					sizeof(gen7_media_kernel));
+	igt_assert(batch->ptr < &batch->buffer[4095]);
+
+	/* media pipeline */
+	batch->ptr = batch->buffer;
+	OUT_BATCH(GEN7_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
+	gen7_emit_state_base_address(batch);
+
+	gen7_emit_vfe_state(batch, THREADS, MEDIA_URB_ENTRIES, MEDIA_URB_SIZE,
+			    MEDIA_CURBE_SIZE, GEN7_VFE_STATE_MEDIA_MODE);;
+
+	gen7_emit_curbe_load(batch, curbe_buffer);
+
+	gen7_emit_interface_descriptor_load(batch, interface_descriptor);
+
+	gen7_emit_media_objects(batch, x, y, width, height);
+
+	OUT_BATCH(MI_BATCH_BUFFER_END);
+
+	batch_end = intel_batchbuffer_align(batch, 8);
+	igt_assert(batch_end < BATCH_STATE_SPLIT);
+
+	gen7_render_flush(batch, batch_end);
+	intel_batchbuffer_reset(batch);
+}
+
+void
+gen8_media_fillfunc(struct intel_batchbuffer *batch,
+		    struct igt_buf *dst,
+		    unsigned int x, unsigned int y,
+		    unsigned int width, unsigned int height,
+		    uint8_t color)
+{
+	uint32_t curbe_buffer, interface_descriptor;
+	uint32_t batch_end;
+
+	intel_batchbuffer_flush(batch);
+
+	/* setup states */
+	batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
+
+	curbe_buffer = gen7_fill_curbe_buffer_data(batch, color);
+	interface_descriptor = gen8_fill_interface_descriptor(batch, dst,
+					gen8_media_kernel,
+					sizeof(gen8_media_kernel));
+	igt_assert(batch->ptr < &batch->buffer[4095]);
+
+	/* media pipeline */
+	batch->ptr = batch->buffer;
+	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
+	gen8_emit_state_base_address(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);
+
+	gen7_emit_media_objects(batch, x, y, width, height);
+
+	OUT_BATCH(MI_BATCH_BUFFER_END);
+
+	batch_end = intel_batchbuffer_align(batch, 8);
+	igt_assert(batch_end < BATCH_STATE_SPLIT);
+
+	gen7_render_flush(batch, batch_end);
+	intel_batchbuffer_reset(batch);
+}
+
+static void
+__gen9_media_fillfunc(struct intel_batchbuffer *batch,
+		      struct igt_buf *dst,
+		      unsigned int x, unsigned int y,
+		      unsigned int width, unsigned int height,
+		      uint8_t color, const uint32_t kernel[][4],
+		      size_t kernel_size)
+{
+	uint32_t curbe_buffer, interface_descriptor;
+	uint32_t batch_end;
+
+	intel_batchbuffer_flush(batch);
+
+	/* setup states */
+	batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
+
+	curbe_buffer = gen7_fill_curbe_buffer_data(batch, color);
+	interface_descriptor = gen8_fill_interface_descriptor(batch, dst,
+					kernel, kernel_size);
+	assert(batch->ptr < &batch->buffer[4095]);
+
+	/* 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);
+
+	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);
+
+	gen7_emit_media_objects(batch, x, y, 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);
+
+	batch_end = intel_batchbuffer_align(batch, 8);
+	assert(batch_end < BATCH_STATE_SPLIT);
+
+	gen7_render_flush(batch, batch_end);
+	intel_batchbuffer_reset(batch);
+}
+
+void
+gen9_media_fillfunc(struct intel_batchbuffer *batch,
+		    struct igt_buf *dst,
+		    unsigned int x, unsigned int y,
+		    unsigned int width, unsigned int height,
+		    uint8_t color)
+{
+
+	__gen9_media_fillfunc(batch, dst, x, y, width, height, color,
+			      gen8_media_kernel, sizeof(gen8_media_kernel));
+
+}
diff --git a/lib/media_fill.h b/lib/media_fill.h
index f6db734e..7863ae84 100644
--- a/lib/media_fill.h
+++ b/lib/media_fill.h
@@ -1,3 +1,27 @@
+/*
+ * Copyright © 2018 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
 #ifndef RENDE_MEDIA_FILL_H
 #define RENDE_MEDIA_FILL_H
 
@@ -6,23 +30,23 @@
 
 void
 gen8_media_fillfunc(struct intel_batchbuffer *batch,
-		struct igt_buf *dst,
-		unsigned int x, unsigned int y,
-		unsigned int width, unsigned int height,
-		uint8_t color);
+		    struct igt_buf *dst,
+		    unsigned int x, unsigned int y,
+		    unsigned int width, unsigned int height,
+		    uint8_t color);
 
 void
 gen7_media_fillfunc(struct intel_batchbuffer *batch,
-		struct igt_buf *dst,
-		unsigned int x, unsigned int y,
-		unsigned int width, unsigned int height,
-		uint8_t color);
+		    struct igt_buf *dst,
+		    unsigned int x, unsigned int y,
+		    unsigned int width, unsigned int height,
+		    uint8_t color);
 
 void
 gen9_media_fillfunc(struct intel_batchbuffer *batch,
-		struct igt_buf *dst,
-		unsigned int x, unsigned int y,
-		unsigned int width, unsigned int height,
-		uint8_t color);
+		    struct igt_buf *dst,
+		    unsigned int x, unsigned int y,
+		    unsigned int width, unsigned int height,
+		    uint8_t color);
 
 #endif /* RENDE_MEDIA_FILL_H */
diff --git a/lib/media_fill_gen7.c b/lib/media_fill_gen7.c
deleted file mode 100644
index 0301856f..00000000
--- a/lib/media_fill_gen7.c
+++ /dev/null
@@ -1,94 +0,0 @@
-#include <intel_bufmgr.h>
-#include <i915_drm.h>
-
-#include "media_fill.h"
-#include "gen7_media.h"
-#include "intel_reg.h"
-#include "drmtest.h"
-#include "gpu_cmds.h"
-#include <assert.h>
-
-static const uint32_t media_kernel[][4] = {
-	{ 0x00400001, 0x20200231, 0x00000020, 0x00000000 },
-	{ 0x00600001, 0x20800021, 0x008d0000, 0x00000000 },
-	{ 0x00200001, 0x20800021, 0x00450040, 0x00000000 },
-	{ 0x00000001, 0x20880061, 0x00000000, 0x000f000f },
-	{ 0x00800001, 0x20a00021, 0x00000020, 0x00000000 },
-	{ 0x00800001, 0x20e00021, 0x00000020, 0x00000000 },
-	{ 0x00800001, 0x21200021, 0x00000020, 0x00000000 },
-	{ 0x00800001, 0x21600021, 0x00000020, 0x00000000 },
-	{ 0x05800031, 0x24001ca8, 0x00000080, 0x120a8000 },
-	{ 0x00600001, 0x2e000021, 0x008d0000, 0x00000000 },
-	{ 0x07800031, 0x20001ca8, 0x00000e00, 0x82000010 },
-};
-
-/*
- * This sets up the media pipeline,
- *
- * +---------------+ <---- 4096
- * |       ^       |
- * |       |       |
- * |    various    |
- * |      state    |
- * |       |       |
- * |_______|_______| <---- 2048 + ?
- * |       ^       |
- * |       |       |
- * |   batch       |
- * |    commands   |
- * |       |       |
- * |       |       |
- * +---------------+ <---- 0 + ?
- *
- */
-
-#define BATCH_STATE_SPLIT 2048
-/* VFE STATE params */
-#define THREADS 1
-#define MEDIA_URB_ENTRIES 2
-#define MEDIA_URB_SIZE 2
-#define MEDIA_CURBE_SIZE 2
-#define GEN7_VFE_STATE_MEDIA_MODE 0
-
-void
-gen7_media_fillfunc(struct intel_batchbuffer *batch,
-		struct igt_buf *dst,
-		unsigned int x, unsigned int y,
-		unsigned int width, unsigned int height,
-		uint8_t color)
-{
-	uint32_t curbe_buffer, interface_descriptor;
-	uint32_t batch_end;
-
-	intel_batchbuffer_flush(batch);
-
-	/* setup states */
-	batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
-
-	curbe_buffer = gen7_fill_curbe_buffer_data(batch, color);
-	interface_descriptor = gen7_fill_interface_descriptor(batch, dst,
-					media_kernel, sizeof(media_kernel));
-	igt_assert(batch->ptr < &batch->buffer[4095]);
-
-	/* media pipeline */
-	batch->ptr = batch->buffer;
-	OUT_BATCH(GEN7_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
-	gen7_emit_state_base_address(batch);
-
-	gen7_emit_vfe_state(batch, THREADS, MEDIA_URB_ENTRIES, MEDIA_URB_SIZE,
-			    MEDIA_CURBE_SIZE, GEN7_VFE_STATE_MEDIA_MODE);
-
-	gen7_emit_curbe_load(batch, curbe_buffer);
-
-	gen7_emit_interface_descriptor_load(batch, interface_descriptor);
-
-	gen7_emit_media_objects(batch, x, y, width, height);
-
-	OUT_BATCH(MI_BATCH_BUFFER_END);
-
-	batch_end = intel_batchbuffer_align(batch, 8);
-	igt_assert(batch_end < BATCH_STATE_SPLIT);
-
-	gen7_render_flush(batch, batch_end);
-	intel_batchbuffer_reset(batch);
-}
diff --git a/lib/media_fill_gen8.c b/lib/media_fill_gen8.c
deleted file mode 100644
index a4b6f743..00000000
--- a/lib/media_fill_gen8.c
+++ /dev/null
@@ -1,96 +0,0 @@
-#include <intel_bufmgr.h>
-#include <i915_drm.h>
-
-#include "media_fill.h"
-#include "gen8_media.h"
-#include "intel_reg.h"
-#include "drmtest.h"
-#include "gpu_cmds.h"
-#include <assert.h>
-
-
-static const uint32_t media_kernel[][4] = {
-	{ 0x00400001, 0x20202288, 0x00000020, 0x00000000 },
-	{ 0x00600001, 0x20800208, 0x008d0000, 0x00000000 },
-	{ 0x00200001, 0x20800208, 0x00450040, 0x00000000 },
-	{ 0x00000001, 0x20880608, 0x00000000, 0x000f000f },
-	{ 0x00800001, 0x20a00208, 0x00000020, 0x00000000 },
-	{ 0x00800001, 0x20e00208, 0x00000020, 0x00000000 },
-	{ 0x00800001, 0x21200208, 0x00000020, 0x00000000 },
-	{ 0x00800001, 0x21600208, 0x00000020, 0x00000000 },
-	{ 0x0c800031, 0x24000a40, 0x0e000080, 0x120a8000 },
-	{ 0x00600001, 0x2e000208, 0x008d0000, 0x00000000 },
-	{ 0x07800031, 0x20000a40, 0x0e000e00, 0x82000010 },
-};
-
-
-
-/*
- * This sets up the media pipeline,
- *
- * +---------------+ <---- 4096
- * |       ^       |
- * |       |       |
- * |    various    |
- * |      state    |
- * |       |       |
- * |_______|_______| <---- 2048 + ?
- * |       ^       |
- * |       |       |
- * |   batch       |
- * |    commands   |
- * |       |       |
- * |       |       |
- * +---------------+ <---- 0 + ?
- *
- */
-
-#define BATCH_STATE_SPLIT 2048
-/* VFE STATE params */
-#define THREADS 1
-#define MEDIA_URB_ENTRIES 2
-#define MEDIA_URB_SIZE 2
-#define MEDIA_CURBE_SIZE 2
-
-void
-gen8_media_fillfunc(struct intel_batchbuffer *batch,
-		struct igt_buf *dst,
-		unsigned int x, unsigned int y,
-		unsigned int width, unsigned int height,
-		uint8_t color)
-{
-	uint32_t curbe_buffer, interface_descriptor;
-	uint32_t batch_end;
-
-	intel_batchbuffer_flush(batch);
-
-	/* setup states */
-	batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
-
-	curbe_buffer = gen7_fill_curbe_buffer_data(batch, color);
-	interface_descriptor = gen8_fill_interface_descriptor(batch, dst,
-					media_kernel, sizeof(media_kernel));
-	igt_assert(batch->ptr < &batch->buffer[4095]);
-
-	/* media pipeline */
-	batch->ptr = batch->buffer;
-	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
-	gen8_emit_state_base_address(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);
-
-	gen7_emit_media_objects(batch, x, y, width, height);
-
-	OUT_BATCH(MI_BATCH_BUFFER_END);
-
-	batch_end = intel_batchbuffer_align(batch, 8);
-	igt_assert(batch_end < BATCH_STATE_SPLIT);
-
-	gen7_render_flush(batch, batch_end);
-	intel_batchbuffer_reset(batch);
-}
diff --git a/lib/media_fill_gen9.c b/lib/media_fill_gen9.c
deleted file mode 100644
index cf510ad9..00000000
--- a/lib/media_fill_gen9.c
+++ /dev/null
@@ -1,105 +0,0 @@
-#include <intel_bufmgr.h>
-#include <i915_drm.h>
-
-#include "media_fill.h"
-#include "gen8_media.h"
-#include "intel_reg.h"
-#include "gpu_cmds.h"
-#include <assert.h>
-
-static const uint32_t media_kernel[][4] = {
-	{ 0x00400001, 0x20202288, 0x00000020, 0x00000000 },
-	{ 0x00600001, 0x20800208, 0x008d0000, 0x00000000 },
-	{ 0x00200001, 0x20800208, 0x00450040, 0x00000000 },
-	{ 0x00000001, 0x20880608, 0x00000000, 0x000f000f },
-	{ 0x00800001, 0x20a00208, 0x00000020, 0x00000000 },
-	{ 0x00800001, 0x20e00208, 0x00000020, 0x00000000 },
-	{ 0x00800001, 0x21200208, 0x00000020, 0x00000000 },
-	{ 0x00800001, 0x21600208, 0x00000020, 0x00000000 },
-	{ 0x0c800031, 0x24000a40, 0x0e000080, 0x120a8000 },
-	{ 0x00600001, 0x2e000208, 0x008d0000, 0x00000000 },
-	{ 0x07800031, 0x20000a40, 0x0e000e00, 0x82000010 },
-};
-
-
-/*
- * This sets up the media pipeline,
- *
- * +---------------+ <---- 4096
- * |       ^       |
- * |       |       |
- * |    various    |
- * |      state    |
- * |       |       |
- * |_______|_______| <---- 2048 + ?
- * |       ^       |
- * |       |       |
- * |   batch       |
- * |    commands   |
- * |       |       |
- * |       |       |
- * +---------------+ <---- 0 + ?
- *
- */
-
-#define BATCH_STATE_SPLIT 2048
-/* VFE STATE params */
-#define THREADS 1
-#define MEDIA_URB_ENTRIES 2
-#define MEDIA_URB_SIZE 2
-#define MEDIA_CURBE_SIZE 2
-
-void
-gen9_media_fillfunc(struct intel_batchbuffer *batch,
-		struct igt_buf *dst,
-		unsigned int x, unsigned int y,
-		unsigned int width, unsigned int height,
-		uint8_t color)
-{
-	uint32_t curbe_buffer, interface_descriptor;
-	uint32_t batch_end;
-
-	intel_batchbuffer_flush(batch);
-
-	/* setup states */
-	batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
-
-	curbe_buffer = gen7_fill_curbe_buffer_data(batch, color);
-	interface_descriptor = gen8_fill_interface_descriptor(batch, dst,
-					media_kernel, sizeof(media_kernel));
-	assert(batch->ptr < &batch->buffer[4095]);
-
-	/* 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);
-
-	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);
-
-	gen7_emit_media_objects(batch, x, y, 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);
-
-	batch_end = intel_batchbuffer_align(batch, 8);
-	assert(batch_end < BATCH_STATE_SPLIT);
-
-	gen7_render_flush(batch, batch_end);
-	intel_batchbuffer_reset(batch);
-}
diff --git a/lib/meson.build b/lib/meson.build
index 493874b3..312e8f0d 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -24,10 +24,8 @@ lib_sources = [
 	'intel_os.c',
 	'intel_mmio.c',
 	'ioctl_wrappers.c',
-	'media_fill_gen7.c',
-	'media_fill_gen8.c',
-	'media_fill_gen9.c',
 	'media_spin.c',
+	'media_fill.c',
 	'gpgpu_fill.c',
 	'gpu_cmds.c',
 	'rendercopy_i915.c',
-- 
2.14.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [igt-dev] [PATCH i-g-t v5 2/2] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc
  2018-05-15  9:09 [igt-dev] [PATCH i-g-t v5 1/2] lib/media_fill: Create common media_fill library for all gens Katarzyna Dec
@ 2018-05-15  9:09 ` Katarzyna Dec
  2018-05-16  7:57   ` Kalamarz, Lukasz
  2018-05-15 11:35 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v5,1/2] lib/media_fill: Create common media_fill library for all gens Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Katarzyna Dec @ 2018-05-15  9:09 UTC (permalink / raw)
  To: igt-dev

Starting from gen9 main gpgpu_fillfunc differs only with
kernel parameter. Let's prepare generic __gen9 function to
avoid duplicating all _fillfunc for future gens.

v2: fixed indentations
v3: Made __gen9_gpgpu_fillfunc static
v4: rebase

Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Ewelina Musial <ewelina.musial@intel.com>
---
 lib/gpgpu_fill.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c
index 56cab27f..26212842 100644
--- a/lib/gpgpu_fill.c
+++ b/lib/gpgpu_fill.c
@@ -200,12 +200,13 @@ gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 	intel_batchbuffer_reset(batch);
 }
 
-void
-gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
-		    struct igt_buf *dst,
-		    unsigned int x, unsigned int y,
-		    unsigned int width, unsigned int height,
-		    uint8_t color)
+static void
+__gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
+		      struct igt_buf *dst,
+		      unsigned int x, unsigned int y,
+		      unsigned int width, unsigned int height,
+		      uint8_t color, const uint32_t kernel[][4],
+		      size_t kernel_size)
 {
 	uint32_t curbe_buffer, interface_descriptor;
 	uint32_t batch_end;
@@ -223,7 +224,7 @@ gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 	curbe_buffer = gen7_fill_curbe_buffer_data(batch, color);
 
 	interface_descriptor = gen8_fill_interface_descriptor(batch, dst,
-				gen9_gpgpu_kernel, sizeof(gen9_gpgpu_kernel));
+				kernel, kernel_size);
 
 	igt_assert(batch->ptr < &batch->buffer[4095]);
 
@@ -248,3 +249,13 @@ gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 	gen7_render_flush(batch, batch_end);
 	intel_batchbuffer_reset(batch);
 }
+
+void gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
+			 struct igt_buf *dst,
+			 unsigned int x, unsigned int y,
+			 unsigned int width, unsigned int height,
+			 uint8_t color)
+{
+	__gen9_gpgpu_fillfunc(batch, dst, x, y, width, height, color,
+			      gen9_gpgpu_kernel, sizeof(gen9_gpgpu_kernel));
+}
-- 
2.14.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v5,1/2] lib/media_fill: Create common media_fill library for all gens
  2018-05-15  9:09 [igt-dev] [PATCH i-g-t v5 1/2] lib/media_fill: Create common media_fill library for all gens Katarzyna Dec
  2018-05-15  9:09 ` [igt-dev] [PATCH i-g-t v5 2/2] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc Katarzyna Dec
@ 2018-05-15 11:35 ` Patchwork
  2018-05-15 18:52 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2018-05-16  7:57 ` [igt-dev] [PATCH i-g-t v5 1/2] " Kalamarz, Lukasz
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-05-15 11:35 UTC (permalink / raw)
  To: Katarzyna Dec; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,v5,1/2] lib/media_fill: Create common media_fill library for all gens
URL   : https://patchwork.freedesktop.org/series/43182/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4183 -> IGTPW_1364 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/43182/revisions/1/mbox/

== Known issues ==

  Here are the changes found in IGTPW_1364 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_psr_sink_crc@basic:
      fi-hsw-4200u:       NOTRUN -> FAIL (fdo#106346)

    
    ==== Possible fixes ====

    igt@gem_exec_suspend@basic-s4-devices:
      fi-glk-j4005:       DMESG-WARN (fdo#106097) -> PASS

    
  fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097
  fdo#106346 https://bugs.freedesktop.org/show_bug.cgi?id=106346


== Participating hosts (38 -> 37) ==

  Additional (2): fi-hsw-peppy fi-hsw-4200u 
  Missing    (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq 


== Build changes ==

    * IGT: IGT_4480 -> IGTPW_1364
    * Piglit: piglit_4480 -> piglit_4481

  CI_DRM_4183: 9d97c6e3fd3ac8dd73f107ca85e2a12c746a2ccc @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1364: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1364/
  IGT_4480: 18fa0c11012da6aa9a5511dc9b1736064a02b429 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4480: 3ba0657bff4216d1ec7179935590261855f1651e @ git://anongit.freedesktop.org/piglit
  piglit_4481: 3ba0657bff4216d1ec7179935590261855f1651e @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1364/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,v5,1/2] lib/media_fill: Create common media_fill library for all gens
  2018-05-15  9:09 [igt-dev] [PATCH i-g-t v5 1/2] lib/media_fill: Create common media_fill library for all gens Katarzyna Dec
  2018-05-15  9:09 ` [igt-dev] [PATCH i-g-t v5 2/2] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc Katarzyna Dec
  2018-05-15 11:35 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v5,1/2] lib/media_fill: Create common media_fill library for all gens Patchwork
@ 2018-05-15 18:52 ` Patchwork
  2018-05-16  7:57 ` [igt-dev] [PATCH i-g-t v5 1/2] " Kalamarz, Lukasz
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-05-15 18:52 UTC (permalink / raw)
  To: Katarzyna Dec; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,v5,1/2] lib/media_fill: Create common media_fill library for all gens
URL   : https://patchwork.freedesktop.org/series/43182/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4480_full -> IGTPW_1364_full =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/43182/revisions/1/mbox/

== Known issues ==

  Here are the changes found in IGTPW_1364_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_eio@in-flight-1us:
      shard-apl:          PASS -> DMESG-WARN (fdo#106523) +3

    igt@gem_eio@in-flight-contexts-immediate:
      shard-glk:          NOTRUN -> DMESG-WARN (fdo#106523)

    igt@gem_eio@suspend:
      shard-glk:          PASS -> DMESG-WARN (fdo#106523)

    igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic:
      shard-glk:          NOTRUN -> FAIL (fdo#105454)

    igt@kms_cursor_legacy@flip-vs-cursor-varying-size:
      shard-hsw:          PASS -> FAIL (fdo#102670)

    igt@kms_flip@dpms-vs-vblank-race-interruptible:
      shard-hsw:          PASS -> FAIL (fdo#103060)

    igt@kms_flip_tiling@flip-x-tiled:
      shard-glk:          NOTRUN -> FAIL (fdo#104724)

    igt@kms_setmode@basic:
      shard-glk:          NOTRUN -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@gem_eio@execbuf:
      shard-glk:          DMESG-WARN (fdo#106523) -> PASS +5

    igt@gem_eio@in-flight-contexts-immediate:
      shard-hsw:          DMESG-WARN (fdo#106523) -> PASS +5

    igt@gem_eio@throttle:
      shard-snb:          DMESG-WARN (fdo#106523) -> PASS +6

    igt@gem_eio@wait-wedge-10ms:
      shard-apl:          DMESG-WARN (fdo#106523) -> PASS +1

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-glk:          FAIL (fdo#105363) -> PASS

    igt@kms_flip@flip-vs-panning-vs-hang:
      shard-snb:          DMESG-WARN (fdo#103821) -> PASS

    igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
      shard-snb:          FAIL (fdo#103166, fdo#104724) -> PASS

    igt@kms_rotation_crc@sprite-rotation-180:
      shard-snb:          FAIL (fdo#103925, fdo#104724) -> PASS

    igt@kms_rotation_crc@sprite-rotation-270:
      shard-apl:          FAIL (fdo#103925, fdo#104724) -> PASS

    
  fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
  fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103821 https://bugs.freedesktop.org/show_bug.cgi?id=103821
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
  fdo#106523 https://bugs.freedesktop.org/show_bug.cgi?id=106523
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (5 -> 4) ==

  Missing    (1): shard-kbl 


== Build changes ==

    * IGT: IGT_4480 -> IGTPW_1364
    * Linux: CI_DRM_4182 -> CI_DRM_4183
    * Piglit: piglit_4480 -> piglit_4481

  CI_DRM_4182: 74146e495c113f6cf8721bb55feec6b459199cd4 @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4183: 9d97c6e3fd3ac8dd73f107ca85e2a12c746a2ccc @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1364: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1364/
  IGT_4480: 18fa0c11012da6aa9a5511dc9b1736064a02b429 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4480: 3ba0657bff4216d1ec7179935590261855f1651e @ git://anongit.freedesktop.org/piglit
  piglit_4481: 3ba0657bff4216d1ec7179935590261855f1651e @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1364/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 1/2] lib/media_fill: Create common media_fill library for all gens
  2018-05-15  9:09 [igt-dev] [PATCH i-g-t v5 1/2] lib/media_fill: Create common media_fill library for all gens Katarzyna Dec
                   ` (2 preceding siblings ...)
  2018-05-15 18:52 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2018-05-16  7:57 ` Kalamarz, Lukasz
  3 siblings, 0 replies; 6+ messages in thread
From: Kalamarz, Lukasz @ 2018-05-16  7:57 UTC (permalink / raw)
  To: Dec, Katarzyna, igt-dev

On Tue, 2018-05-15 at 11:09 +0200, Katarzyna Dec wrote:
> Let's create common media_fill library, similarly as for gpgpu_fill.
> This will allow to make code easier to read and maintain.
> Moreover we can create generic __gen9_media_fillfunc for future gens.
> From gen9 media fillfunctions differ only with kernel parameter.
> 
> v2: fixed indentations in files
> v3: Added missing copyright headers. Made __gen9_media_fillfunc
> static.
> Removed gen9 kernel (the same as for gen8).
> v4: rebase
> 
> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
> Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Ewelina Musial <ewelina.musial@intel.com>

LGTM,
Rewieved-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 2/2] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc
  2018-05-15  9:09 ` [igt-dev] [PATCH i-g-t v5 2/2] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc Katarzyna Dec
@ 2018-05-16  7:57   ` Kalamarz, Lukasz
  0 siblings, 0 replies; 6+ messages in thread
From: Kalamarz, Lukasz @ 2018-05-16  7:57 UTC (permalink / raw)
  To: Dec, Katarzyna, igt-dev

On Tue, 2018-05-15 at 11:09 +0200, Katarzyna Dec wrote:
> Starting from gen9 main gpgpu_fillfunc differs only with
> kernel parameter. Let's prepare generic __gen9 function to
> avoid duplicating all _fillfunc for future gens.
> 
> v2: fixed indentations
> v3: Made __gen9_gpgpu_fillfunc static
> v4: rebase
> 
> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> Cc: Ewelina Musial <ewelina.musial@intel.com>
> ---

LGTM,
Rewieved-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-16  7:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15  9:09 [igt-dev] [PATCH i-g-t v5 1/2] lib/media_fill: Create common media_fill library for all gens Katarzyna Dec
2018-05-15  9:09 ` [igt-dev] [PATCH i-g-t v5 2/2] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc Katarzyna Dec
2018-05-16  7:57   ` Kalamarz, Lukasz
2018-05-15 11:35 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v5,1/2] lib/media_fill: Create common media_fill library for all gens Patchwork
2018-05-15 18:52 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-05-16  7:57 ` [igt-dev] [PATCH i-g-t v5 1/2] " Kalamarz, Lukasz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.