summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Makefile.sources1
-rw-r--r--lib/gpgpu_fill.c2
-rw-r--r--lib/gpu_fill.c172
-rw-r--r--lib/gpu_fill.h38
-rw-r--r--lib/intel_batchbuffer.c4
-rw-r--r--lib/media_fill.h7
-rw-r--r--lib/media_fill_gen8.c10
-rw-r--r--lib/media_fill_gen8lp.c87
-rw-r--r--lib/media_fill_gen9.c10
-rw-r--r--lib/meson.build1
10 files changed, 39 insertions, 293 deletions
diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 45e65dd7..9c0150c1 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -58,7 +58,6 @@ lib_source_list = \
media_fill.h \
media_fill_gen7.c \
media_fill_gen8.c \
- media_fill_gen8lp.c \
media_fill_gen9.c \
media_spin.h \
media_spin.c \
diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c
index f2765fd6..579ce78d 100644
--- a/lib/gpgpu_fill.c
+++ b/lib/gpgpu_fill.c
@@ -180,7 +180,7 @@ gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
gen8_emit_state_base_address(batch);
gen8_emit_vfe_state_gpgpu(batch);
gen7_emit_curbe_load(batch, curbe_buffer);
- gen8_emit_interface_descriptor_load(batch, interface_descriptor);
+ gen7_emit_interface_descriptor_load(batch, interface_descriptor);
gen8_emit_gpgpu_walk(batch, x, y, width, height);
OUT_BATCH(MI_BATCH_BUFFER_END);
diff --git a/lib/gpu_fill.c b/lib/gpu_fill.c
index d7a2dd4c..a53e5533 100644
--- a/lib/gpu_fill.c
+++ b/lib/gpu_fill.c
@@ -142,26 +142,18 @@ gen7_fill_binding_table(struct intel_batchbuffer *batch,
binding_table = batch_alloc(batch, 32, 64);
offset = batch_offset(batch, binding_table);
- binding_table[0] = gen7_fill_surface_state(batch, dst,
+ if (IS_GEN7(batch->devid))
+ binding_table[0] = gen7_fill_surface_state(batch, dst,
GEN7_SURFACEFORMAT_R8_UNORM, 1);
+ else
+ binding_table[0] = gen8_fill_surface_state(batch, dst,
+ GEN8_SURFACEFORMAT_R8_UNORM, 1);
return offset;
}
uint32_t
-gen7_fill_media_kernel(struct intel_batchbuffer *batch,
- const uint32_t kernel[][4],
- size_t size)
-{
- uint32_t offset;
-
- offset = batch_copy(batch, kernel, size, 64);
-
- return offset;
-}
-
-uint32_t
-gen8_fill_media_kernel(struct intel_batchbuffer *batch,
+gen7_fill_kernel(struct intel_batchbuffer *batch,
const uint32_t kernel[][4],
size_t size)
{
@@ -181,7 +173,7 @@ gen7_fill_interface_descriptor(struct intel_batchbuffer *batch, struct igt_buf *
uint32_t binding_table_offset, kernel_offset;
binding_table_offset = gen7_fill_binding_table(batch, dst);
- kernel_offset = gen7_fill_media_kernel(batch, kernel, size);
+ kernel_offset = gen7_fill_kernel(batch, kernel, size);
idd = batch_alloc(batch, sizeof(*idd), 64);
offset = batch_offset(batch, idd);
@@ -296,7 +288,10 @@ gen7_emit_interface_descriptor_load(struct intel_batchbuffer *batch, uint32_t in
OUT_BATCH(GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD | (4 - 2));
OUT_BATCH(0);
/* interface descriptor data length */
- OUT_BATCH(sizeof(struct gen7_interface_descriptor_data));
+ if (IS_GEN7(batch->devid))
+ OUT_BATCH(sizeof(struct gen7_interface_descriptor_data));
+ else
+ OUT_BATCH(sizeof(struct gen8_interface_descriptor_data));
/* interface descriptor address, is relative to the dynamics base address */
OUT_BATCH(interface_descriptor);
}
@@ -326,6 +321,8 @@ gen7_emit_media_objects(struct intel_batchbuffer *batch,
/* inline data (xoffset, yoffset) */
OUT_BATCH(x + i * 16);
OUT_BATCH(y + j * 16);
+ if (AT_LEAST_GEN(batch->devid, 8) && !IS_CHERRYVIEW(batch->devid))
+ gen8_emit_media_state_flush(batch);
}
}
}
@@ -387,33 +384,6 @@ gen7_emit_gpgpu_walk(struct intel_batchbuffer *batch,
OUT_BATCH(0xffffffff);
}
-void
-gen8_render_flush(struct intel_batchbuffer *batch, uint32_t batch_end)
-{
- int ret;
-
- ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
- if (ret == 0)
- ret = drm_intel_bo_mrb_exec(batch->bo, batch_end,
- NULL, 0, 0, 0);
- igt_assert(ret == 0);
-}
-
-
-uint32_t
-gen8_fill_curbe_buffer_data(struct intel_batchbuffer *batch,
- uint8_t color)
-{
- uint8_t *curbe_buffer;
- uint32_t offset;
-
- curbe_buffer = batch_alloc(batch, sizeof(uint32_t) * 8, 64);
- offset = batch_offset(batch, curbe_buffer);
- *curbe_buffer = color;
-
- return offset;
-}
-
uint32_t
gen8_fill_surface_state(struct intel_batchbuffer *batch,
struct igt_buf *buf,
@@ -466,29 +436,14 @@ gen8_fill_surface_state(struct intel_batchbuffer *batch,
}
uint32_t
-gen8_fill_binding_table(struct intel_batchbuffer *batch,
- struct igt_buf *dst)
-{
- uint32_t *binding_table, offset;
-
- binding_table = batch_alloc(batch, 32, 64);
- offset = batch_offset(batch, binding_table);
-
- binding_table[0] = gen8_fill_surface_state(batch, dst,
- GEN8_SURFACEFORMAT_R8_UNORM, 1);
-
- return offset;
-}
-
-uint32_t
gen8_fill_interface_descriptor(struct intel_batchbuffer *batch, struct igt_buf *dst, const uint32_t kernel[][4], size_t size)
{
struct gen8_interface_descriptor_data *idd;
uint32_t offset;
uint32_t binding_table_offset, kernel_offset;
- binding_table_offset = gen8_fill_binding_table(batch, dst);
- kernel_offset = gen8_fill_media_kernel(batch, kernel, size);
+ binding_table_offset = gen7_fill_binding_table(batch, dst);
+ kernel_offset = gen7_fill_kernel(batch, kernel, size);
idd = batch_alloc(batch, sizeof(*idd), 64);
offset = batch_offset(batch, idd);
@@ -547,9 +502,16 @@ gen8_emit_state_base_address(struct intel_batchbuffer *batch)
}
void
+gen8_emit_media_state_flush(struct intel_batchbuffer *batch)
+{
+ OUT_BATCH(GEN8_MEDIA_STATE_FLUSH | (2 - 2));
+ OUT_BATCH(0);
+}
+
+void
gen8_emit_vfe_state(struct intel_batchbuffer *batch)
{
- OUT_BATCH(GEN8_MEDIA_VFE_STATE | (9 - 2));
+ OUT_BATCH(GEN7_MEDIA_VFE_STATE | (9 - 2));
/* scratch buffer */
OUT_BATCH(0);
@@ -574,7 +536,7 @@ gen8_emit_vfe_state(struct intel_batchbuffer *batch)
void
gen8_emit_vfe_state_gpgpu(struct intel_batchbuffer *batch)
{
- OUT_BATCH(GEN8_MEDIA_VFE_STATE | (9 - 2));
+ OUT_BATCH(GEN7_MEDIA_VFE_STATE | (9 - 2));
/* scratch buffer */
OUT_BATCH(0);
@@ -595,92 +557,6 @@ gen8_emit_vfe_state_gpgpu(struct intel_batchbuffer *batch)
}
void
-gen8_emit_curbe_load(struct intel_batchbuffer *batch, uint32_t curbe_buffer)
-{
- OUT_BATCH(GEN8_MEDIA_CURBE_LOAD | (4 - 2));
- OUT_BATCH(0);
- /* curbe total data length */
- OUT_BATCH(64);
- /* curbe data start address, is relative to the dynamics base address */
- OUT_BATCH(curbe_buffer);
-}
-
-void
-gen8_emit_interface_descriptor_load(struct intel_batchbuffer *batch, uint32_t interface_descriptor)
-{
- OUT_BATCH(GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD | (4 - 2));
- OUT_BATCH(0);
- /* interface descriptor data length */
- OUT_BATCH(sizeof(struct gen8_interface_descriptor_data));
- /* interface descriptor address, is relative to the dynamics base address */
- OUT_BATCH(interface_descriptor);
-}
-
-void
-gen8_emit_media_state_flush(struct intel_batchbuffer *batch)
-{
- OUT_BATCH(GEN8_MEDIA_STATE_FLUSH | (2 - 2));
- OUT_BATCH(0);
-}
-
-void
-gen8_emit_media_objects(struct intel_batchbuffer *batch,
- unsigned x, unsigned y,
- unsigned width, unsigned height)
-{
- int i, j;
-
- for (i = 0; i < width / 16; i++) {
- for (j = 0; j < height / 16; j++) {
- OUT_BATCH(GEN8_MEDIA_OBJECT | (8 - 2));
-
- /* interface descriptor offset */
- OUT_BATCH(0);
-
- /* without indirect data */
- OUT_BATCH(0);
- OUT_BATCH(0);
-
- /* scoreboard */
- OUT_BATCH(0);
- OUT_BATCH(0);
-
- /* inline data (xoffset, yoffset) */
- OUT_BATCH(x + i * 16);
- OUT_BATCH(y + j * 16);
- gen8_emit_media_state_flush(batch);
- }
- }
-}
-void
-gen8lp_emit_media_objects(struct intel_batchbuffer *batch,
- unsigned x, unsigned y,
- unsigned width, unsigned height)
-{
- int i, j;
-
- for (i = 0; i < width / 16; i++) {
- for (j = 0; j < height / 16; j++) {
- OUT_BATCH(GEN8_MEDIA_OBJECT | (8 - 2));
-
- /* interface descriptor offset */
- OUT_BATCH(0);
-
- /* without indirect data */
- OUT_BATCH(0);
- OUT_BATCH(0);
-
- /* scoreboard */
- OUT_BATCH(0);
- OUT_BATCH(0);
-
- /* inline data (xoffset, yoffset) */
- OUT_BATCH(x + i * 16);
- OUT_BATCH(y + j * 16);
- }
- }
-}
-void
gen8_emit_gpgpu_walk(struct intel_batchbuffer *batch,
unsigned x, unsigned y,
unsigned width, unsigned height)
diff --git a/lib/gpu_fill.h b/lib/gpu_fill.h
index 87e62c86..072e9f7c 100644
--- a/lib/gpu_fill.h
+++ b/lib/gpu_fill.h
@@ -70,12 +70,7 @@ gen7_fill_binding_table(struct intel_batchbuffer *batch,
struct igt_buf *dst);
uint32_t
-gen7_fill_media_kernel(struct intel_batchbuffer *batch,
- const uint32_t kernel[][4],
- size_t size);
-
-uint32_t
-gen8_fill_media_kernel(struct intel_batchbuffer *batch,
+gen7_fill_kernel(struct intel_batchbuffer *batch,
const uint32_t kernel[][4],
size_t size);
@@ -108,13 +103,6 @@ gen7_emit_gpgpu_walk(struct intel_batchbuffer *batch,
unsigned x, unsigned y,
unsigned width, unsigned height);
-void
-gen8_render_flush(struct intel_batchbuffer *batch, uint32_t batch_end);
-
-uint32_t
-gen8_fill_curbe_buffer_data(struct intel_batchbuffer *batch,
- uint8_t color);
-
uint32_t
gen8_fill_surface_state(struct intel_batchbuffer *batch,
struct igt_buf *buf,
@@ -122,39 +110,19 @@ gen8_fill_surface_state(struct intel_batchbuffer *batch,
int is_dst);
uint32_t
-gen8_fill_binding_table(struct intel_batchbuffer *batch,
- struct igt_buf *dst);
-
-uint32_t
gen8_fill_interface_descriptor(struct intel_batchbuffer *batch, struct igt_buf *dst, const uint32_t kernel[][4], size_t size);
void
gen8_emit_state_base_address(struct intel_batchbuffer *batch);
void
-gen8_emit_vfe_state(struct intel_batchbuffer *batch);
-
-void
-gen8_emit_vfe_state_gpgpu(struct intel_batchbuffer *batch);
-
-void
-gen8_emit_curbe_load(struct intel_batchbuffer *batch, uint32_t curbe_buffer);
-
-void
-gen8_emit_interface_descriptor_load(struct intel_batchbuffer *batch, uint32_t interface_descriptor);
-
-void
gen8_emit_media_state_flush(struct intel_batchbuffer *batch);
void
-gen8_emit_media_objects(struct intel_batchbuffer *batch,
- unsigned x, unsigned y,
- unsigned width, unsigned height);
+gen8_emit_vfe_state(struct intel_batchbuffer *batch);
void
-gen8lp_emit_media_objects(struct intel_batchbuffer *batch,
- unsigned x, unsigned y,
- unsigned width, unsigned height);
+gen8_emit_vfe_state_gpgpu(struct intel_batchbuffer *batch);
void
gen8_emit_gpgpu_walk(struct intel_batchbuffer *batch,
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 7c04ccf3..10d4dce8 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -796,12 +796,10 @@ igt_fillfunc_t igt_get_media_fillfunc(int devid)
if (IS_GEN9(devid))
fill = gen9_media_fillfunc;
- else if (IS_BROADWELL(devid))
+ else if (IS_GEN8(devid))
fill = gen8_media_fillfunc;
else if (IS_GEN7(devid))
fill = gen7_media_fillfunc;
- else if (IS_CHERRYVIEW(devid))
- fill = gen8lp_media_fillfunc;
return fill;
}
diff --git a/lib/media_fill.h b/lib/media_fill.h
index 226489cb..161af8cf 100644
--- a/lib/media_fill.h
+++ b/lib/media_fill.h
@@ -19,13 +19,6 @@ gen7_media_fillfunc(struct intel_batchbuffer *batch,
uint8_t color);
void
-gen8lp_media_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
- unsigned x, unsigned y,
- unsigned width, unsigned height,
- uint8_t color);
-
-void
gen9_media_fillfunc(struct intel_batchbuffer *batch,
struct igt_buf *dst,
unsigned x, unsigned y,
diff --git a/lib/media_fill_gen8.c b/lib/media_fill_gen8.c
index 4270997e..362abd61 100644
--- a/lib/media_fill_gen8.c
+++ b/lib/media_fill_gen8.c
@@ -62,7 +62,7 @@ gen8_media_fillfunc(struct intel_batchbuffer *batch,
/* setup states */
batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
- curbe_buffer = gen8_fill_curbe_buffer_data(batch, color);
+ 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]);
@@ -73,17 +73,17 @@ gen8_media_fillfunc(struct intel_batchbuffer *batch,
gen8_emit_vfe_state(batch);
- gen8_emit_curbe_load(batch, curbe_buffer);
+ gen7_emit_curbe_load(batch, curbe_buffer);
- gen8_emit_interface_descriptor_load(batch, interface_descriptor);
+ gen7_emit_interface_descriptor_load(batch, interface_descriptor);
- gen8_emit_media_objects(batch, x, y, width, height);
+ gen7_emit_media_objects(batch, x, y, width, height);
OUT_BATCH(MI_BATCH_BUFFER_END);
batch_end = batch_align(batch, 8);
igt_assert(batch_end < BATCH_STATE_SPLIT);
- gen8_render_flush(batch, batch_end);
+ gen7_render_flush(batch, batch_end);
intel_batchbuffer_reset(batch);
}
diff --git a/lib/media_fill_gen8lp.c b/lib/media_fill_gen8lp.c
deleted file mode 100644
index dcc11982..00000000
--- a/lib/media_fill_gen8lp.c
+++ /dev/null
@@ -1,87 +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
-gen8lp_media_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
- unsigned x, unsigned y,
- unsigned width, unsigned 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 = gen8_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);
-
- gen8_emit_curbe_load(batch, curbe_buffer);
-
- gen8_emit_interface_descriptor_load(batch, interface_descriptor);
-
- gen8lp_emit_media_objects(batch, x, y, width, height);
-
- OUT_BATCH(MI_BATCH_BUFFER_END);
-
- batch_end = batch_align(batch, 8);
- igt_assert(batch_end < BATCH_STATE_SPLIT);
-
- gen8_render_flush(batch, batch_end);
- intel_batchbuffer_reset(batch);
-}
diff --git a/lib/media_fill_gen9.c b/lib/media_fill_gen9.c
index 6accdbe4..d1335fe6 100644
--- a/lib/media_fill_gen9.c
+++ b/lib/media_fill_gen9.c
@@ -59,7 +59,7 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
/* setup states */
batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
- curbe_buffer = gen8_fill_curbe_buffer_data(batch, color);
+ 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]);
@@ -75,11 +75,11 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
gen8_emit_vfe_state(batch);
- gen8_emit_curbe_load(batch, curbe_buffer);
+ gen7_emit_curbe_load(batch, curbe_buffer);
- gen8_emit_interface_descriptor_load(batch, interface_descriptor);
+ gen7_emit_interface_descriptor_load(batch, interface_descriptor);
- gen8_emit_media_objects(batch, x, y, width, height);
+ gen7_emit_media_objects(batch, x, y, width, height);
OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA |
GEN9_FORCE_MEDIA_AWAKE_DISABLE |
@@ -93,6 +93,6 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch,
batch_end = batch_align(batch, 8);
assert(batch_end < BATCH_STATE_SPLIT);
- gen8_render_flush(batch, batch_end);
+ gen7_render_flush(batch, batch_end);
intel_batchbuffer_reset(batch);
}
diff --git a/lib/meson.build b/lib/meson.build
index 385e08b9..5f2567fb 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,7 +26,6 @@ lib_sources = [
'ioctl_wrappers.c',
'media_fill_gen7.c',
'media_fill_gen8.c',
- 'media_fill_gen8lp.c',
'media_fill_gen9.c',
'media_spin.c',
'gpgpu_fill.c',