From 053251f18c9f5159f3b27145cf07013b11d05723 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 15 Nov 2021 15:59:55 -0800 Subject: [PATCH] iris: Implement iris_blorp_exec() for the blitter engine This splits iris_blorp_exec() into separate functions for executing on the render command streamer and the blitter command streamer. A future patch could add a separate iris_blorp_exec_compute() path that skips a bunch of render-specific work. Reviewed-by: Caio Oliveira Part-of: --- src/gallium/drivers/iris/iris_blorp.c | 38 +++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/iris/iris_blorp.c b/src/gallium/drivers/iris/iris_blorp.c index 11bb3f7f65d..bc465037488 100644 --- a/src/gallium/drivers/iris/iris_blorp.c +++ b/src/gallium/drivers/iris/iris_blorp.c @@ -266,8 +266,8 @@ blorp_get_l3_config(struct blorp_batch *blorp_batch) } static void -iris_blorp_exec(struct blorp_batch *blorp_batch, - const struct blorp_params *params) +iris_blorp_exec_render(struct blorp_batch *blorp_batch, + const struct blorp_params *params) { struct iris_context *ice = blorp_batch->blorp->driver_ctx; struct iris_batch *batch = blorp_batch->driver_batch; @@ -399,6 +399,40 @@ iris_blorp_exec(struct blorp_batch *blorp_batch, IRIS_DOMAIN_DEPTH_WRITE); } +static void +iris_blorp_exec_blitter(struct blorp_batch *blorp_batch, + const struct blorp_params *params) +{ + struct iris_batch *batch = blorp_batch->driver_batch; + + /* Around the length of a XY_BLOCK_COPY_BLT and MI_FLUSH_DW */ + iris_require_command_space(batch, 108); + + iris_handle_always_flush_cache(batch); + + blorp_exec(blorp_batch, params); + + iris_handle_always_flush_cache(batch); + + if (params->src.enabled) { + iris_bo_bump_seqno(params->src.addr.buffer, batch->next_seqno, + IRIS_DOMAIN_OTHER_READ); + } + + iris_bo_bump_seqno(params->dst.addr.buffer, batch->next_seqno, + IRIS_DOMAIN_OTHER_WRITE); +} + +static void +iris_blorp_exec(struct blorp_batch *blorp_batch, + const struct blorp_params *params) +{ + if (blorp_batch->flags & BLORP_BATCH_USE_BLITTER) + iris_blorp_exec_blitter(blorp_batch, params); + else + iris_blorp_exec_render(blorp_batch, params); +} + static void blorp_measure_start(struct blorp_batch *blorp_batch, const struct blorp_params *params)