mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-22 05:43:02 +00:00
rendercopy: Pass context to rendercopy functions
rendercopy does the batch buffer flush internally, so if we want to use it with multiple contexts, we need to pass the context in from caller. v2: Modify rendercopy_gen8 as well Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
@@ -147,14 +147,15 @@ batch_copy(struct intel_batchbuffer *batch, const void *ptr, uint32_t size, uint
|
||||
}
|
||||
|
||||
static void
|
||||
gen6_render_flush(struct intel_batchbuffer *batch, uint32_t batch_end)
|
||||
gen6_render_flush(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context, 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);
|
||||
ret = drm_intel_gem_bo_context_exec(batch->bo, context,
|
||||
batch_end, 0);
|
||||
assert(ret == 0);
|
||||
}
|
||||
|
||||
@@ -848,6 +849,7 @@ static void gen8_emit_primitive(struct intel_batchbuffer *batch, uint32_t offset
|
||||
#define BATCH_STATE_SPLIT 2048
|
||||
|
||||
void gen8_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
@@ -857,7 +859,7 @@ void gen8_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
uint32_t vertex_buffer;
|
||||
uint32_t batch_end;
|
||||
|
||||
intel_batchbuffer_flush(batch);
|
||||
intel_batchbuffer_flush_with_context(batch, context);
|
||||
|
||||
batch_align(batch, 8);
|
||||
|
||||
@@ -947,6 +949,6 @@ void gen8_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
|
||||
annotation_flush(&aub_annotations, batch);
|
||||
|
||||
gen6_render_flush(batch, batch_end);
|
||||
gen6_render_flush(batch, context, batch_end);
|
||||
intel_batchbuffer_reset(batch);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user