From b701096ab9577527531db8ef0cdc1761bde4f21c Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 20 Jan 2018 23:11:37 -0800 Subject: [PATCH] iris: make iris_batch target a particular ring --- src/gallium/drivers/iris/iris_batch.c | 14 +++++++++----- src/gallium/drivers/iris/iris_batch.h | 8 ++++++-- src/gallium/drivers/iris/iris_context.c | 3 ++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index 90a24140661..edc93428b6d 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -108,13 +108,17 @@ create_batch_buffer(struct iris_bufmgr *bufmgr, } void -iris_batch_init(struct iris_batch *batch, +iris_init_batch(struct iris_batch *batch, struct iris_screen *screen, - struct pipe_debug_callback *dbg) + struct pipe_debug_callback *dbg, + uint8_t ring) { batch->screen = screen; batch->dbg = dbg; + assert((ring & ~I915_EXEC_RING_MASK) == 0); + batch->ring = ring; + init_reloc_list(&batch->cmdbuf.relocs, 256); init_reloc_list(&batch->statebuf.relocs, 256); @@ -504,10 +508,10 @@ submit_batch(struct iris_batch *batch, int in_fence_fd, int *out_fence_fd) .buffer_count = batch->exec_count, .batch_start_offset = 0, .batch_len = buffer_bytes_used(&batch->cmdbuf), - .flags = I915_EXEC_NO_RELOC | + .flags = batch->ring | + I915_EXEC_NO_RELOC | I915_EXEC_BATCH_FIRST | - I915_EXEC_HANDLE_LUT | - I915_EXEC_RENDER, + I915_EXEC_HANDLE_LUT, .rsvd1 = batch->hw_ctx_id, /* rsvd1 is actually the context ID */ }; diff --git a/src/gallium/drivers/iris/iris_batch.h b/src/gallium/drivers/iris/iris_batch.h index 10d815f839c..2074b058061 100644 --- a/src/gallium/drivers/iris/iris_batch.h +++ b/src/gallium/drivers/iris/iris_batch.h @@ -64,6 +64,9 @@ struct iris_batch { uint32_t hw_ctx_id; + /** Which ring this batch targets - a I915_EXEC_RING_MASK value */ + uint8_t ring; + bool no_wrap; /** The validation list */ @@ -79,9 +82,10 @@ struct iris_batch { struct hash_table *state_sizes; }; -void iris_batch_init(struct iris_batch *batch, +void iris_init_batch(struct iris_batch *batch, struct iris_screen *screen, - struct pipe_debug_callback *dbg); + struct pipe_debug_callback *dbg, + uint8_t ring); void iris_batch_free(struct iris_batch *batch); void iris_require_command_space(struct iris_batch *batch, unsigned size); void iris_require_state_space(struct iris_batch *batch, unsigned size); diff --git a/src/gallium/drivers/iris/iris_context.c b/src/gallium/drivers/iris/iris_context.c index ed8172ad441..a9a93c57ff4 100644 --- a/src/gallium/drivers/iris/iris_context.c +++ b/src/gallium/drivers/iris/iris_context.c @@ -28,6 +28,7 @@ #include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_upload_mgr.h" +#include "i915_drm.h" #include "iris_context.h" #include "iris_resource.h" #include "iris_screen.h" @@ -111,7 +112,7 @@ iris_create_context(struct pipe_screen *pscreen, void *priv, unsigned flags) iris_init_program_cache(ice); - iris_batch_init(&ice->render_batch, screen, &ice->dbg); + iris_init_batch(&ice->render_batch, screen, &ice->dbg, I915_EXEC_RENDER); return ctx; } -- 2.30.2