iris: Set BLORP_BATCH_USE_{COMPUTE,BLITTER} flags for the target batch

This makes blits, copies, and (non-fast) clears set the appropriate
BLORP_BATCH_USE_{COMPUTE,BLITTER} flag if their batch is either
IRIS_BATCH_COMPUTE or IRIS_BATCH_BLITTER.  We ignore the other
operations for now as those don't support compute or blit yet.

Of course, there is no code to attempt to launch BLORP operations on
either the compute or blitter batches yet, but that will come in time.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
This commit is contained in:
Kenneth Graunke 2021-10-01 02:06:45 -07:00 committed by Marge Bot
parent cc03726165
commit e00985d5d4
3 changed files with 16 additions and 3 deletions

View File

@ -356,7 +356,7 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
struct iris_screen *screen = (struct iris_screen *)ctx->screen;
const struct intel_device_info *devinfo = &screen->devinfo;
struct iris_batch *batch = &ice->batches[IRIS_BATCH_RENDER];
enum blorp_batch_flags blorp_flags = 0;
enum blorp_batch_flags blorp_flags = iris_blorp_flags_for_batch(batch);
/* We don't support color masking. */
assert((info->mask & PIPE_MASK_RGBA) == PIPE_MASK_RGBA ||
@ -644,7 +644,9 @@ iris_copy_region(struct blorp_context *blorp,
if (dst->target == PIPE_BUFFER)
util_range_add(&dst_res->base.b, &dst_res->valid_buffer_range, dstx, dstx + src_box->width);
blorp_batch_init(blorp, &blorp_batch, batch, 0);
enum blorp_batch_flags blorp_flags = iris_blorp_flags_for_batch(batch);
blorp_batch_init(blorp, &blorp_batch, batch, blorp_flags);
if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
struct blorp_address src_addr = {

View File

@ -315,7 +315,7 @@ clear_color(struct iris_context *ice,
struct iris_batch *batch = &ice->batches[IRIS_BATCH_RENDER];
const struct intel_device_info *devinfo = &batch->screen->devinfo;
enum blorp_batch_flags blorp_flags = 0;
enum blorp_batch_flags blorp_flags = iris_blorp_flags_for_batch(batch);
if (render_condition_enabled) {
if (ice->state.predicate == IRIS_PREDICATE_STATE_DONT_RENDER)

View File

@ -894,6 +894,17 @@ void iris_copy_region(struct blorp_context *blorp,
unsigned src_level,
const struct pipe_box *src_box);
static inline enum blorp_batch_flags
iris_blorp_flags_for_batch(struct iris_batch *batch)
{
if (batch->name == IRIS_BATCH_COMPUTE)
return BLORP_BATCH_USE_COMPUTE;
if (batch->name == IRIS_BATCH_BLITTER)
return BLORP_BATCH_USE_BLITTER;
return 0;
}
/* iris_draw.c */