summaryrefslogtreecommitdiff
path: root/lib/media_fill_gen8.c
diff options
context:
space:
mode:
authorKatarzyna Dec <katarzyna.dec@intel.com>2018-05-15 11:09:40 +0200
committerMichaƂ Winiarski <michal.winiarski@intel.com>2018-05-21 13:02:32 +0200
commit219cc4f2b06345b124d6b69f22be3184e8c75ba3 (patch)
treef0f53cccfbda12dbeb3f7677a420b32beebf27cf /lib/media_fill_gen8.c
parent9367223d264bfba5b3aafc01d9b2b554d7d22f62 (diff)
lib/media_fill: Create common media_fill library for all gens
Let's create common media_fill library, similarly as for gpgpu_fill. This will allow to make code easier to read and maintain. Moreover we can create generic __gen9_media_fillfunc for future gens. >From gen9 media fillfunctions differ only with kernel parameter. v2: fixed indentations in files v3: Added missing copyright headers. Made __gen9_media_fillfunc static. Removed gen9 kernel (the same as for gen8). v4: rebase Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Diffstat (limited to 'lib/media_fill_gen8.c')
-rw-r--r--lib/media_fill_gen8.c96
1 files changed, 0 insertions, 96 deletions
diff --git a/lib/media_fill_gen8.c b/lib/media_fill_gen8.c
deleted file mode 100644
index a4b6f743..00000000
--- a/lib/media_fill_gen8.c
+++ /dev/null
@@ -1,96 +0,0 @@
-#include <intel_bufmgr.h>
-#include <i915_drm.h>
-
-#include "media_fill.h"
-#include "gen8_media.h"
-#include "intel_reg.h"
-#include "drmtest.h"
-#include "gpu_cmds.h"
-#include <assert.h>
-
-
-static const uint32_t media_kernel[][4] = {
- { 0x00400001, 0x20202288, 0x00000020, 0x00000000 },
- { 0x00600001, 0x20800208, 0x008d0000, 0x00000000 },
- { 0x00200001, 0x20800208, 0x00450040, 0x00000000 },
- { 0x00000001, 0x20880608, 0x00000000, 0x000f000f },
- { 0x00800001, 0x20a00208, 0x00000020, 0x00000000 },
- { 0x00800001, 0x20e00208, 0x00000020, 0x00000000 },
- { 0x00800001, 0x21200208, 0x00000020, 0x00000000 },
- { 0x00800001, 0x21600208, 0x00000020, 0x00000000 },
- { 0x0c800031, 0x24000a40, 0x0e000080, 0x120a8000 },
- { 0x00600001, 0x2e000208, 0x008d0000, 0x00000000 },
- { 0x07800031, 0x20000a40, 0x0e000e00, 0x82000010 },
-};
-
-
-
-/*
- * This sets up the media pipeline,
- *
- * +---------------+ <---- 4096
- * | ^ |
- * | | |
- * | various |
- * | state |
- * | | |
- * |_______|_______| <---- 2048 + ?
- * | ^ |
- * | | |
- * | batch |
- * | commands |
- * | | |
- * | | |
- * +---------------+ <---- 0 + ?
- *
- */
-
-#define BATCH_STATE_SPLIT 2048
-/* VFE STATE params */
-#define THREADS 1
-#define MEDIA_URB_ENTRIES 2
-#define MEDIA_URB_SIZE 2
-#define MEDIA_CURBE_SIZE 2
-
-void
-gen8_media_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
- unsigned int x, unsigned int y,
- unsigned int width, unsigned int height,
- uint8_t color)
-{
- uint32_t curbe_buffer, interface_descriptor;
- uint32_t batch_end;
-
- intel_batchbuffer_flush(batch);
-
- /* setup states */
- batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
-
- curbe_buffer = gen7_fill_curbe_buffer_data(batch, color);
- interface_descriptor = gen8_fill_interface_descriptor(batch, dst,
- media_kernel, sizeof(media_kernel));
- igt_assert(batch->ptr < &batch->buffer[4095]);
-
- /* media pipeline */
- batch->ptr = batch->buffer;
- OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
- gen8_emit_state_base_address(batch);
-
- gen8_emit_vfe_state(batch, THREADS, MEDIA_URB_ENTRIES, MEDIA_URB_SIZE,
- MEDIA_CURBE_SIZE);
-
- gen7_emit_curbe_load(batch, curbe_buffer);
-
- gen7_emit_interface_descriptor_load(batch, interface_descriptor);
-
- gen7_emit_media_objects(batch, x, y, width, height);
-
- OUT_BATCH(MI_BATCH_BUFFER_END);
-
- batch_end = intel_batchbuffer_align(batch, 8);
- igt_assert(batch_end < BATCH_STATE_SPLIT);
-
- gen7_render_flush(batch, batch_end);
- intel_batchbuffer_reset(batch);
-}