* [igt-dev] [PATCH i-g-t v3 0/4] *_fill libraries refactoring part2
@ 2018-05-09 14:21 Katarzyna Dec
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 1/4] lib/media_fill: Create common media_fill library for all gens Katarzyna Dec
` (5 more replies)
0 siblings, 6 replies; 13+ messages in thread
From: Katarzyna Dec @ 2018-05-09 14:21 UTC (permalink / raw)
To: igt-dev
When I started implementing fillfuncs for future gens, reviewers
suggested to make a wrapper on gen9 functions. Future gens differ
with kernel parameter only. This series is implementing such
wrapper and introduces gen10 functions based on it.
Patches with generic gen9 functions were previously pushed to ML.
I made a series with gen10 to show how this impacts code.
v2, v3: fixed indentations in whole series
Katarzyna Dec (4):
lib/media_fill: Create common media_fill library for all gens
lib/media_fill: Add media_fillfunc for Gen10
lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc
lib/gpgpu_fill: Add gpgpu_fillfunc for Gen10
lib/Makefile.sources | 4 +-
lib/gpgpu_fill.c | 33 +++++--
lib/gpgpu_fill.h | 15 +++
lib/intel_batchbuffer.c | 8 +-
lib/media_fill.c | 239 ++++++++++++++++++++++++++++++++++++++++++++++++
lib/media_fill.h | 39 +++++---
lib/media_fill_gen7.c | 87 ------------------
lib/media_fill_gen8.c | 90 ------------------
lib/media_fill_gen9.c | 99 --------------------
lib/meson.build | 4 +-
10 files changed, 316 insertions(+), 302 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
--
2.14.3
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 13+ messages in thread
* [igt-dev] [PATCH i-g-t v3 1/4] lib/media_fill: Create common media_fill library for all gens
2018-05-09 14:21 [igt-dev] [PATCH i-g-t v3 0/4] *_fill libraries refactoring part2 Katarzyna Dec
@ 2018-05-09 14:21 ` Katarzyna Dec
2018-05-09 21:16 ` Daniele Ceraolo Spurio
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 2/4] lib/media_fill: Add media_fillfunc for Gen10 Katarzyna Dec
` (4 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Katarzyna Dec @ 2018-05-09 14:21 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
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>
Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
---
lib/Makefile.sources | 4 +-
lib/media_fill.c | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++
lib/media_fill.h | 32 ++++---
lib/media_fill_gen7.c | 87 -------------------
lib/media_fill_gen8.c | 90 --------------------
lib/media_fill_gen9.c | 99 ----------------------
lib/meson.build | 4 +-
7 files changed, 249 insertions(+), 294 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 9c0150c1..4e5e9292 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -56,9 +56,7 @@ lib_source_list = \
ioctl_wrappers.c \
ioctl_wrappers.h \
media_fill.h \
- media_fill_gen7.c \
- media_fill_gen8.c \
- media_fill_gen9.c \
+ media_fill.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..872faf5a
--- /dev/null
+++ b/lib/media_fill.c
@@ -0,0 +1,227 @@
+#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_fill.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 },
+};
+
+static const uint32_t gen9_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
+
+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);
+
+ 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);
+
+ 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
+__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);
+
+ 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,
+ gen9_media_kernel, sizeof(gen9_media_kernel));
+}
diff --git a/lib/media_fill.h b/lib/media_fill.h
index f6db734e..42f8cb6a 100644
--- a/lib/media_fill.h
+++ b/lib/media_fill.h
@@ -6,23 +6,31 @@
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, const uint32_t kernel[][4],
+ size_t kernel_size);
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 3dc5617e..00000000
--- a/lib/media_fill_gen7.c
+++ /dev/null
@@ -1,87 +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_fill.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
-
-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);
-
- 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 63fe72eb..00000000
--- a/lib/media_fill_gen8.c
+++ /dev/null
@@ -1,90 +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_fill.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
-
-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);
-
- 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 78e892f2..00000000
--- a/lib/media_fill_gen9.c
+++ /dev/null
@@ -1,99 +0,0 @@
-#include <intel_bufmgr.h>
-#include <i915_drm.h>
-
-#include "media_fill.h"
-#include "gen8_media.h"
-#include "intel_reg.h"
-#include "gpu_fill.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
-
-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);
-
- 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 04d550fa..3d5a04b0 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -24,9 +24,7 @@ lib_sources = [
'intel_os.c',
'intel_mmio.c',
'ioctl_wrappers.c',
- 'media_fill_gen7.c',
- 'media_fill_gen8.c',
- 'media_fill_gen9.c',
+ 'media_fill.c',
'media_spin.c',
'gpgpu_fill.c',
'gpu_fill.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] 13+ messages in thread
* [igt-dev] [PATCH i-g-t v3 2/4] lib/media_fill: Add media_fillfunc for Gen10
2018-05-09 14:21 [igt-dev] [PATCH i-g-t v3 0/4] *_fill libraries refactoring part2 Katarzyna Dec
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 1/4] lib/media_fill: Create common media_fill library for all gens Katarzyna Dec
@ 2018-05-09 14:21 ` Katarzyna Dec
2018-05-09 21:20 ` Daniele Ceraolo Spurio
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 3/4] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc Katarzyna Dec
` (3 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Katarzyna Dec @ 2018-05-09 14:21 UTC (permalink / raw)
To: igt-dev
Gen10 media_fillfunc so far was the same as for gen9.
Let's add proper gen10 function to make this code more
clear. There are no changes in gen10 code.
v2: fixed indentations in few functions
v3: fixed few more indentations
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Ewelina Musial <ewelina.musial@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
---
lib/intel_batchbuffer.c | 4 +++-
lib/media_fill.c | 12 ++++++++++++
lib/media_fill.h | 7 +++++++
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index f87e6bed..42ec4f35 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -858,7 +858,9 @@ igt_fillfunc_t igt_get_media_fillfunc(int devid)
{
igt_fillfunc_t fill = NULL;
- if (IS_GEN9(devid) || IS_GEN10(devid))
+ if (IS_GEN10(devid))
+ fill = gen10_media_fillfunc;
+ else if (IS_GEN9(devid))
fill = gen9_media_fillfunc;
else if (IS_GEN8(devid))
fill = gen8_media_fillfunc;
diff --git a/lib/media_fill.c b/lib/media_fill.c
index 872faf5a..fbcb9b28 100644
--- a/lib/media_fill.c
+++ b/lib/media_fill.c
@@ -225,3 +225,15 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
__gen9_media_fillfunc(batch, dst, x, y, width, height, color,
gen9_media_kernel, sizeof(gen9_media_kernel));
}
+
+void
+gen10_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,
+ gen9_media_kernel, sizeof(gen9_media_kernel));
+}
diff --git a/lib/media_fill.h b/lib/media_fill.h
index 42f8cb6a..ba352443 100644
--- a/lib/media_fill.h
+++ b/lib/media_fill.h
@@ -33,4 +33,11 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
unsigned int width, unsigned int height,
uint8_t color);
+void
+gen10_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);
+
#endif /* RENDE_MEDIA_FILL_H */
--
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] 13+ messages in thread
* [igt-dev] [PATCH i-g-t v3 3/4] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc
2018-05-09 14:21 [igt-dev] [PATCH i-g-t v3 0/4] *_fill libraries refactoring part2 Katarzyna Dec
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 1/4] lib/media_fill: Create common media_fill library for all gens Katarzyna Dec
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 2/4] lib/media_fill: Add media_fillfunc for Gen10 Katarzyna Dec
@ 2018-05-09 14:21 ` Katarzyna Dec
2018-05-09 21:21 ` Daniele Ceraolo Spurio
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 4/4] lib/gpgpu_fill: Add gpgpu_fillfunc for Gen10 Katarzyna Dec
` (2 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Katarzyna Dec @ 2018-05-09 14:21 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
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>
Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
---
lib/gpgpu_fill.c | 23 +++++++++++++++++------
lib/gpgpu_fill.h | 8 ++++++++
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c
index 010dde06..c44acb1f 100644
--- a/lib/gpgpu_fill.c
+++ b/lib/gpgpu_fill.c
@@ -193,11 +193,12 @@ gen8_gpgpu_fillfunc(struct intel_batchbuffer *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(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;
@@ -216,7 +217,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]);
@@ -240,3 +241,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));
+}
diff --git a/lib/gpgpu_fill.h b/lib/gpgpu_fill.h
index 0190bfc1..7260c4fa 100644
--- a/lib/gpgpu_fill.h
+++ b/lib/gpgpu_fill.h
@@ -43,6 +43,14 @@ gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
unsigned int width, unsigned int height,
uint8_t color);
+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);
+
void
gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
struct igt_buf *dst,
--
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] 13+ messages in thread
* [igt-dev] [PATCH i-g-t v3 4/4] lib/gpgpu_fill: Add gpgpu_fillfunc for Gen10
2018-05-09 14:21 [igt-dev] [PATCH i-g-t v3 0/4] *_fill libraries refactoring part2 Katarzyna Dec
` (2 preceding siblings ...)
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 3/4] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc Katarzyna Dec
@ 2018-05-09 14:21 ` Katarzyna Dec
2018-05-09 15:37 ` [igt-dev] ✓ Fi.CI.BAT: success for *_fill libraries refactoring part2 (rev4) Patchwork
2018-05-09 18:33 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
5 siblings, 0 replies; 13+ messages in thread
From: Katarzyna Dec @ 2018-05-09 14:21 UTC (permalink / raw)
To: igt-dev
Gen10 gpgpu_fillfunc so far was the same as for gen9. Let's add
proper gen10 function to make this code more clear. There are
no changes in gen10 code.
v2: Fixed indentations in gen9 and gen10 functions
v3: Fixed few more indentations (after rebase on fixed indentation
in media_fill patches.
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
---
lib/gpgpu_fill.c | 10 ++++++++++
lib/gpgpu_fill.h | 7 +++++++
lib/intel_batchbuffer.c | 4 +++-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c
index c44acb1f..76728ca6 100644
--- a/lib/gpgpu_fill.c
+++ b/lib/gpgpu_fill.c
@@ -251,3 +251,13 @@ void gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
__gen9_gpgpu_fillfunc(batch, dst, x, y, width, height, color,
gen9_gpgpu_kernel, sizeof(gen9_gpgpu_kernel));
}
+
+void gen10_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));
+}
diff --git a/lib/gpgpu_fill.h b/lib/gpgpu_fill.h
index 7260c4fa..369837e4 100644
--- a/lib/gpgpu_fill.h
+++ b/lib/gpgpu_fill.h
@@ -58,4 +58,11 @@ gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
unsigned int width, unsigned int height,
uint8_t color);
+void
+gen10_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);
+
#endif /* GPGPU_FILL_H */
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 42ec4f35..ec7f4f19 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -887,8 +887,10 @@ igt_fillfunc_t igt_get_gpgpu_fillfunc(int devid)
fill = gen7_gpgpu_fillfunc;
else if (IS_BROADWELL(devid))
fill = gen8_gpgpu_fillfunc;
- else if (IS_GEN9(devid) || IS_GEN10(devid))
+ else if (IS_GEN9(devid))
fill = gen9_gpgpu_fillfunc;
+ else if (IS_GEN10(devid))
+ fill = gen10_gpgpu_fillfunc;
return fill;
}
--
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] 13+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for *_fill libraries refactoring part2 (rev4)
2018-05-09 14:21 [igt-dev] [PATCH i-g-t v3 0/4] *_fill libraries refactoring part2 Katarzyna Dec
` (3 preceding siblings ...)
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 4/4] lib/gpgpu_fill: Add gpgpu_fillfunc for Gen10 Katarzyna Dec
@ 2018-05-09 15:37 ` Patchwork
2018-05-09 18:33 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
5 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2018-05-09 15:37 UTC (permalink / raw)
To: Katarzyna Dec; +Cc: igt-dev
== Series Details ==
Series: *_fill libraries refactoring part2 (rev4)
URL : https://patchwork.freedesktop.org/series/42943/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4163 -> IGTPW_1333 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/42943/revisions/4/mbox/
== Known issues ==
Here are the changes found in IGTPW_1333 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@debugfs_test@read_all_entries:
fi-snb-2520m: PASS -> INCOMPLETE (fdo#103713)
igt@gem_exec_suspend@basic-s4-devices:
fi-kbl-7500u: PASS -> DMESG-WARN (fdo#105128)
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-cfl-s3: PASS -> FAIL (fdo#103928, fdo#100368)
igt@kms_frontbuffer_tracking@basic:
fi-hsw-4200u: PASS -> DMESG-FAIL (fdo#106103, fdo#102614)
==== Possible fixes ====
igt@drv_module_reload@basic-reload-inject:
fi-glk-j4005: DMESG-WARN (fdo#106248) -> PASS
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-hsw-4770r: FAIL (fdo#100368) -> PASS
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
fdo#106103 https://bugs.freedesktop.org/show_bug.cgi?id=106103
fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
== Participating hosts (41 -> 36) ==
Missing (5): fi-byt-j1900 fi-byt-squawks fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq
== Build changes ==
* IGT: IGT_4468 -> IGTPW_1333
CI_DRM_4163: 8e1dab6e913be7d014eb9bc355ec65b6b56dcd56 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1333: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1333/
IGT_4468: 548a894dc904c4628522dbbc77cb179a4c965ebc @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4468: 1e60f1499e5b71b6d5a747189d7c28f57359a87f @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1333/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 13+ messages in thread
* [igt-dev] ✓ Fi.CI.IGT: success for *_fill libraries refactoring part2 (rev4)
2018-05-09 14:21 [igt-dev] [PATCH i-g-t v3 0/4] *_fill libraries refactoring part2 Katarzyna Dec
` (4 preceding siblings ...)
2018-05-09 15:37 ` [igt-dev] ✓ Fi.CI.BAT: success for *_fill libraries refactoring part2 (rev4) Patchwork
@ 2018-05-09 18:33 ` Patchwork
5 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2018-05-09 18:33 UTC (permalink / raw)
To: Katarzyna Dec; +Cc: igt-dev
== Series Details ==
Series: *_fill libraries refactoring part2 (rev4)
URL : https://patchwork.freedesktop.org/series/42943/
State : success
== Summary ==
= CI Bug Log - changes from IGT_4468_full -> IGTPW_1333_full =
== Summary - WARNING ==
Minor unknown changes coming with IGTPW_1333_full need to be verified
manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_1333_full, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/42943/revisions/4/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in IGTPW_1333_full:
=== IGT changes ===
==== Warnings ====
igt@drv_selftest@live_execlists:
shard-glk: SKIP -> PASS +1
shard-apl: SKIP -> PASS +1
igt@gem_exec_schedule@deep-blt:
shard-kbl: SKIP -> PASS +2
igt@gem_mocs_settings@mocs-rc6-render:
shard-kbl: PASS -> SKIP +1
== Known issues ==
Here are the changes found in IGTPW_1333_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_suspend@forcewake:
shard-kbl: PASS -> INCOMPLETE (fdo#103665)
igt@kms_flip@plain-flip-fb-recreate:
shard-glk: PASS -> FAIL (fdo#100368) +1
igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
shard-snb: PASS -> FAIL (fdo#104724, fdo#103166)
igt@kms_setmode@basic:
shard-glk: PASS -> FAIL (fdo#99912)
==== Possible fixes ====
igt@drv_selftest@live_hangcheck:
shard-kbl: DMESG-FAIL (fdo#106453) -> PASS
shard-apl: DMESG-FAIL (fdo#106453) -> PASS
shard-glk: DMESG-FAIL (fdo#106453) -> PASS
igt@drv_selftest@mock_breadcrumbs:
shard-hsw: DMESG-WARN (fdo#106453) -> PASS +7
igt@drv_selftest@mock_dmabuf:
shard-glk: DMESG-WARN (fdo#106453) -> PASS +7
igt@drv_selftest@mock_evict:
shard-snb: DMESG-WARN (fdo#106453) -> PASS +7
igt@drv_selftest@mock_requests:
shard-kbl: DMESG-WARN (fdo#106453) -> PASS +7
igt@drv_selftest@mock_vma:
shard-apl: DMESG-WARN (fdo#106453) -> PASS +7
igt@drv_suspend@debugfs-reader:
shard-glk: INCOMPLETE (k.org#198133, fdo#103359) -> PASS
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-glk: FAIL (fdo#102887) -> PASS
igt@kms_flip@flip-vs-wf_vblank-interruptible:
shard-glk: FAIL (fdo#100368) -> PASS
igt@kms_flip@plain-flip-fb-recreate-interruptible:
shard-hsw: FAIL (fdo#100368) -> PASS
igt@kms_setmode@basic:
shard-kbl: FAIL (fdo#99912) -> PASS
igt@kms_sysfs_edid_timing:
shard-apl: WARN (fdo#100047) -> PASS
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#106453 https://bugs.freedesktop.org/show_bug.cgi?id=106453
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133
== Participating hosts (9 -> 5) ==
Missing (4): pig-snb-2600 pig-glk-j5005 pig-skl-6600 pig-hsw-4770r
== Build changes ==
* IGT: IGT_4468 -> IGTPW_1333
* Linux: CI_DRM_4160 -> CI_DRM_4163
CI_DRM_4160: 6d9a2ccf9fca7c006f24b7ff6193ee356b6d3503 @ git://anongit.freedesktop.org/gfx-ci/linux
CI_DRM_4163: 8e1dab6e913be7d014eb9bc355ec65b6b56dcd56 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1333: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1333/
IGT_4468: 548a894dc904c4628522dbbc77cb179a4c965ebc @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4468: 1e60f1499e5b71b6d5a747189d7c28f57359a87f @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1333/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3 1/4] lib/media_fill: Create common media_fill library for all gens
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 1/4] lib/media_fill: Create common media_fill library for all gens Katarzyna Dec
@ 2018-05-09 21:16 ` Daniele Ceraolo Spurio
2018-05-10 12:45 ` Katarzyna Dec
0 siblings, 1 reply; 13+ messages in thread
From: Daniele Ceraolo Spurio @ 2018-05-09 21:16 UTC (permalink / raw)
To: Katarzyna Dec, igt-dev
On 09/05/18 07:21, 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
>
> 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>
> Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
> ---
> lib/Makefile.sources | 4 +-
> lib/media_fill.c | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++
> lib/media_fill.h | 32 ++++---
> lib/media_fill_gen7.c | 87 -------------------
> lib/media_fill_gen8.c | 90 --------------------
> lib/media_fill_gen9.c | 99 ----------------------
> lib/meson.build | 4 +-
> 7 files changed, 249 insertions(+), 294 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 9c0150c1..4e5e9292 100644
> --- a/lib/Makefile.sources
> +++ b/lib/Makefile.sources
> @@ -56,9 +56,7 @@ lib_source_list = \
> ioctl_wrappers.c \
> ioctl_wrappers.h \
> media_fill.h \
> - media_fill_gen7.c \
> - media_fill_gen8.c \
> - media_fill_gen9.c \
> + media_fill.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..872faf5a
> --- /dev/null
> +++ b/lib/media_fill.c
> @@ -0,0 +1,227 @@
> +#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_fill.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 },
> +};
> +
> +static const uint32_t gen9_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 },
> +};
gen8_media_kernel and gen9_media_kernel are identical, no need to have both.
> +
> +/*
> + * This sets up the media pipeline,
> + *
> + * +---------------+ <---- 4096
> + * | ^ |
> + * | | |
> + * | various |
> + * | state |
> + * | | |
> + * |_______|_______| <---- 2048 + ?
> + * | ^ |
> + * | | |
> + * | batch |
> + * | commands |
> + * | | |
> + * | | |
> + * +---------------+ <---- 0 + ?
> + *
> + */
> +
> +#define BATCH_STATE_SPLIT 2048
> +
> +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);
> +
> + 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);
> +
> + 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
This should be static and...
> +__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)
> +{
<snip>
> +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);
... not be added here in the header.
Daniele
>
> 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 3dc5617e..00000000
> --- a/lib/media_fill_gen7.c
> +++ /dev/null
> @@ -1,87 +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_fill.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
> -
> -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);
> -
> - 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 63fe72eb..00000000
> --- a/lib/media_fill_gen8.c
> +++ /dev/null
> @@ -1,90 +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_fill.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
> -
> -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);
> -
> - 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 78e892f2..00000000
> --- a/lib/media_fill_gen9.c
> +++ /dev/null
> @@ -1,99 +0,0 @@
> -#include <intel_bufmgr.h>
> -#include <i915_drm.h>
> -
> -#include "media_fill.h"
> -#include "gen8_media.h"
> -#include "intel_reg.h"
> -#include "gpu_fill.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
> -
> -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);
> -
> - 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 04d550fa..3d5a04b0 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -24,9 +24,7 @@ lib_sources = [
> 'intel_os.c',
> 'intel_mmio.c',
> 'ioctl_wrappers.c',
> - 'media_fill_gen7.c',
> - 'media_fill_gen8.c',
> - 'media_fill_gen9.c',
> + 'media_fill.c',
> 'media_spin.c',
> 'gpgpu_fill.c',
> 'gpu_fill.c',
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3 2/4] lib/media_fill: Add media_fillfunc for Gen10
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 2/4] lib/media_fill: Add media_fillfunc for Gen10 Katarzyna Dec
@ 2018-05-09 21:20 ` Daniele Ceraolo Spurio
2018-05-10 12:57 ` Katarzyna Dec
0 siblings, 1 reply; 13+ messages in thread
From: Daniele Ceraolo Spurio @ 2018-05-09 21:20 UTC (permalink / raw)
To: Katarzyna Dec, igt-dev
On 09/05/18 07:21, Katarzyna Dec wrote:
> Gen10 media_fillfunc so far was the same as for gen9.
> Let's add proper gen10 function to make this code more
> clear. There are no changes in gen10 code.
>
I personally disagree with this. It looks to me like we're making things
less clear here by hiding the fact that gen10 is actually re-using the
gen9 code with no changes. I would personally drop this patch (and
likewise patch 4/4), but will leave the judgment to the maintainers.
Daniele
> v2: fixed indentations in few functions
> v3: fixed few more indentations
>
> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
> Cc: Ewelina Musial <ewelina.musial@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
> lib/intel_batchbuffer.c | 4 +++-
> lib/media_fill.c | 12 ++++++++++++
> lib/media_fill.h | 7 +++++++
> 3 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
> index f87e6bed..42ec4f35 100644
> --- a/lib/intel_batchbuffer.c
> +++ b/lib/intel_batchbuffer.c
> @@ -858,7 +858,9 @@ igt_fillfunc_t igt_get_media_fillfunc(int devid)
> {
> igt_fillfunc_t fill = NULL;
>
> - if (IS_GEN9(devid) || IS_GEN10(devid))
> + if (IS_GEN10(devid))
> + fill = gen10_media_fillfunc;
> + else if (IS_GEN9(devid))
> fill = gen9_media_fillfunc;
> else if (IS_GEN8(devid))
> fill = gen8_media_fillfunc;
> diff --git a/lib/media_fill.c b/lib/media_fill.c
> index 872faf5a..fbcb9b28 100644
> --- a/lib/media_fill.c
> +++ b/lib/media_fill.c
> @@ -225,3 +225,15 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
> __gen9_media_fillfunc(batch, dst, x, y, width, height, color,
> gen9_media_kernel, sizeof(gen9_media_kernel));
> }
> +
> +void
> +gen10_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,
> + gen9_media_kernel, sizeof(gen9_media_kernel));
> +}
> diff --git a/lib/media_fill.h b/lib/media_fill.h
> index 42f8cb6a..ba352443 100644
> --- a/lib/media_fill.h
> +++ b/lib/media_fill.h
> @@ -33,4 +33,11 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
> unsigned int width, unsigned int height,
> uint8_t color);
>
> +void
> +gen10_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);
> +
> #endif /* RENDE_MEDIA_FILL_H */
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3 3/4] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 3/4] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc Katarzyna Dec
@ 2018-05-09 21:21 ` Daniele Ceraolo Spurio
2018-05-10 12:43 ` Katarzyna Dec
0 siblings, 1 reply; 13+ messages in thread
From: Daniele Ceraolo Spurio @ 2018-05-09 21:21 UTC (permalink / raw)
To: Katarzyna Dec, igt-dev
On 09/05/18 07:21, 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
>
> 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>
> Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
> ---
> lib/gpgpu_fill.c | 23 +++++++++++++++++------
> lib/gpgpu_fill.h | 8 ++++++++
> 2 files changed, 25 insertions(+), 6 deletions(-)
>
> diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c
> index 010dde06..c44acb1f 100644
> --- a/lib/gpgpu_fill.c
> +++ b/lib/gpgpu_fill.c
> @@ -193,11 +193,12 @@ gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
> }
>
> void
As with the media_fill one, this function should be static and not
exposed in the header.
Daniele
> -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(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;
> @@ -216,7 +217,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]);
>
> @@ -240,3 +241,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));
> +}
> diff --git a/lib/gpgpu_fill.h b/lib/gpgpu_fill.h
> index 0190bfc1..7260c4fa 100644
> --- a/lib/gpgpu_fill.h
> +++ b/lib/gpgpu_fill.h
> @@ -43,6 +43,14 @@ gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
> unsigned int width, unsigned int height,
> uint8_t color);
>
> +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);
> +
> void
> gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
> struct igt_buf *dst,
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3 3/4] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc
2018-05-09 21:21 ` Daniele Ceraolo Spurio
@ 2018-05-10 12:43 ` Katarzyna Dec
0 siblings, 0 replies; 13+ messages in thread
From: Katarzyna Dec @ 2018-05-10 12:43 UTC (permalink / raw)
To: Daniele Ceraolo Spurio; +Cc: igt-dev
On Wed, May 09, 2018 at 02:21:30PM -0700, Daniele Ceraolo Spurio wrote:
>
>
> On 09/05/18 07:21, 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
> >
> > 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>
> > Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
> > ---
> > lib/gpgpu_fill.c | 23 +++++++++++++++++------
> > lib/gpgpu_fill.h | 8 ++++++++
> > 2 files changed, 25 insertions(+), 6 deletions(-)
> >
> > diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c
> > index 010dde06..c44acb1f 100644
> > --- a/lib/gpgpu_fill.c
> > +++ b/lib/gpgpu_fill.c
> > @@ -193,11 +193,12 @@ gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
> > }
> > void
>
> As with the media_fill one, this function should be static and not exposed
> in the header.
>
> Daniele
>
I will change that in v3.
Kasia
> > -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(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;
> > @@ -216,7 +217,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]);
> > @@ -240,3 +241,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));
> > +}
> > diff --git a/lib/gpgpu_fill.h b/lib/gpgpu_fill.h
> > index 0190bfc1..7260c4fa 100644
> > --- a/lib/gpgpu_fill.h
> > +++ b/lib/gpgpu_fill.h
> > @@ -43,6 +43,14 @@ gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
> > unsigned int width, unsigned int height,
> > uint8_t color);
> > +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);
> > +
> > void
> > gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
> > struct igt_buf *dst,
> >
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3 1/4] lib/media_fill: Create common media_fill library for all gens
2018-05-09 21:16 ` Daniele Ceraolo Spurio
@ 2018-05-10 12:45 ` Katarzyna Dec
0 siblings, 0 replies; 13+ messages in thread
From: Katarzyna Dec @ 2018-05-10 12:45 UTC (permalink / raw)
To: Daniele Ceraolo Spurio; +Cc: igt-dev
On Wed, May 09, 2018 at 02:16:34PM -0700, Daniele Ceraolo Spurio wrote:
>
>
> On 09/05/18 07:21, 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
> >
> > 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>
> > Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
> > ---
> > lib/Makefile.sources | 4 +-
> > lib/media_fill.c | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++
> > lib/media_fill.h | 32 ++++---
> > lib/media_fill_gen7.c | 87 -------------------
> > lib/media_fill_gen8.c | 90 --------------------
> > lib/media_fill_gen9.c | 99 ----------------------
> > lib/meson.build | 4 +-
> > 7 files changed, 249 insertions(+), 294 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 9c0150c1..4e5e9292 100644
> > --- a/lib/Makefile.sources
> > +++ b/lib/Makefile.sources
> > @@ -56,9 +56,7 @@ lib_source_list = \
> > ioctl_wrappers.c \
> > ioctl_wrappers.h \
> > media_fill.h \
> > - media_fill_gen7.c \
> > - media_fill_gen8.c \
> > - media_fill_gen9.c \
> > + media_fill.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..872faf5a
> > --- /dev/null
> > +++ b/lib/media_fill.c
> > @@ -0,0 +1,227 @@
> > +#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_fill.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 },
> > +};
> > +
> > +static const uint32_t gen9_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 },
> > +};
>
> gen8_media_kernel and gen9_media_kernel are identical, no need to have both.
>
I will check that and remove if it is a duplication.
> > +
> > +/*
> > + * This sets up the media pipeline,
> > + *
> > + * +---------------+ <---- 4096
> > + * | ^ |
> > + * | | |
> > + * | various |
> > + * | state |
> > + * | | |
> > + * |_______|_______| <---- 2048 + ?
> > + * | ^ |
> > + * | | |
> > + * | batch |
> > + * | commands |
> > + * | | |
> > + * | | |
> > + * +---------------+ <---- 0 + ?
> > + *
> > + */
> > +
> > +#define BATCH_STATE_SPLIT 2048
> > +
> > +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);
> > +
> > + 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);
> > +
> > + 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
>
> This should be static and...
>
> > +__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)
> > +{
>
> <snip>
>
> > +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);
>
> ... not be added here in the header.
>
> Daniele
>
You're right, I have missed that somehow... I will fix it in next version.
Kasia
> > 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 3dc5617e..00000000
> > --- a/lib/media_fill_gen7.c
> > +++ /dev/null
> > @@ -1,87 +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_fill.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
> > -
> > -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);
> > -
> > - 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 63fe72eb..00000000
> > --- a/lib/media_fill_gen8.c
> > +++ /dev/null
> > @@ -1,90 +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_fill.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
> > -
> > -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);
> > -
> > - 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 78e892f2..00000000
> > --- a/lib/media_fill_gen9.c
> > +++ /dev/null
> > @@ -1,99 +0,0 @@
> > -#include <intel_bufmgr.h>
> > -#include <i915_drm.h>
> > -
> > -#include "media_fill.h"
> > -#include "gen8_media.h"
> > -#include "intel_reg.h"
> > -#include "gpu_fill.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
> > -
> > -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);
> > -
> > - 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 04d550fa..3d5a04b0 100644
> > --- a/lib/meson.build
> > +++ b/lib/meson.build
> > @@ -24,9 +24,7 @@ lib_sources = [
> > 'intel_os.c',
> > 'intel_mmio.c',
> > 'ioctl_wrappers.c',
> > - 'media_fill_gen7.c',
> > - 'media_fill_gen8.c',
> > - 'media_fill_gen9.c',
> > + 'media_fill.c',
> > 'media_spin.c',
> > 'gpgpu_fill.c',
> > 'gpu_fill.c',
> >
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3 2/4] lib/media_fill: Add media_fillfunc for Gen10
2018-05-09 21:20 ` Daniele Ceraolo Spurio
@ 2018-05-10 12:57 ` Katarzyna Dec
0 siblings, 0 replies; 13+ messages in thread
From: Katarzyna Dec @ 2018-05-10 12:57 UTC (permalink / raw)
To: Daniele Ceraolo Spurio; +Cc: igt-dev
On Wed, May 09, 2018 at 02:20:10PM -0700, Daniele Ceraolo Spurio wrote:
>
>
> On 09/05/18 07:21, Katarzyna Dec wrote:
> > Gen10 media_fillfunc so far was the same as for gen9.
> > Let's add proper gen10 function to make this code more
> > clear. There are no changes in gen10 code.
> >
>
> I personally disagree with this. It looks to me like we're making things
> less clear here by hiding the fact that gen10 is actually re-using the gen9
> code with no changes. I would personally drop this patch (and likewise patch
> 4/4), but will leave the judgment to the maintainers.
>
> Daniele
>
Patches for gen10 were added after consultation with Michal Winiarski. He suggested
to add gen10 to show actual context and benefit from this change.
However, we didn't realized that we are creating another duplication.
I guess I had the same reason in my head - I didn't send gen10 changes together with v1
of this patches. I will remove gen10 patches. It looks like review process in
this case succeeded (not double checking - patches would be merged with
such duplication).
Kasia
> > v2: fixed indentations in few functions
> > v3: fixed few more indentations
> >
> > Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
> > Cc: Ewelina Musial <ewelina.musial@intel.com>
> > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> > Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> > ---
> > lib/intel_batchbuffer.c | 4 +++-
> > lib/media_fill.c | 12 ++++++++++++
> > lib/media_fill.h | 7 +++++++
> > 3 files changed, 22 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
> > index f87e6bed..42ec4f35 100644
> > --- a/lib/intel_batchbuffer.c
> > +++ b/lib/intel_batchbuffer.c
> > @@ -858,7 +858,9 @@ igt_fillfunc_t igt_get_media_fillfunc(int devid)
> > {
> > igt_fillfunc_t fill = NULL;
> > - if (IS_GEN9(devid) || IS_GEN10(devid))
> > + if (IS_GEN10(devid))
> > + fill = gen10_media_fillfunc;
> > + else if (IS_GEN9(devid))
> > fill = gen9_media_fillfunc;
> > else if (IS_GEN8(devid))
> > fill = gen8_media_fillfunc;
> > diff --git a/lib/media_fill.c b/lib/media_fill.c
> > index 872faf5a..fbcb9b28 100644
> > --- a/lib/media_fill.c
> > +++ b/lib/media_fill.c
> > @@ -225,3 +225,15 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
> > __gen9_media_fillfunc(batch, dst, x, y, width, height, color,
> > gen9_media_kernel, sizeof(gen9_media_kernel));
> > }
> > +
> > +void
> > +gen10_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,
> > + gen9_media_kernel, sizeof(gen9_media_kernel));
> > +}
> > diff --git a/lib/media_fill.h b/lib/media_fill.h
> > index 42f8cb6a..ba352443 100644
> > --- a/lib/media_fill.h
> > +++ b/lib/media_fill.h
> > @@ -33,4 +33,11 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
> > unsigned int width, unsigned int height,
> > uint8_t color);
> > +void
> > +gen10_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);
> > +
> > #endif /* RENDE_MEDIA_FILL_H */
> >
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2018-05-10 12:57 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09 14:21 [igt-dev] [PATCH i-g-t v3 0/4] *_fill libraries refactoring part2 Katarzyna Dec
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 1/4] lib/media_fill: Create common media_fill library for all gens Katarzyna Dec
2018-05-09 21:16 ` Daniele Ceraolo Spurio
2018-05-10 12:45 ` Katarzyna Dec
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 2/4] lib/media_fill: Add media_fillfunc for Gen10 Katarzyna Dec
2018-05-09 21:20 ` Daniele Ceraolo Spurio
2018-05-10 12:57 ` Katarzyna Dec
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 3/4] lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfunc Katarzyna Dec
2018-05-09 21:21 ` Daniele Ceraolo Spurio
2018-05-10 12:43 ` Katarzyna Dec
2018-05-09 14:21 ` [igt-dev] [PATCH i-g-t v3 4/4] lib/gpgpu_fill: Add gpgpu_fillfunc for Gen10 Katarzyna Dec
2018-05-09 15:37 ` [igt-dev] ✓ Fi.CI.BAT: success for *_fill libraries refactoring part2 (rev4) Patchwork
2018-05-09 18:33 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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.