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:
@@ -84,7 +84,7 @@ static void *work(void *arg)
|
||||
|
||||
if (uncontexted) {
|
||||
igt_assert(rendercopy);
|
||||
rendercopy(batch, &src, 0, 0, 0, 0, &dst, 0, 0);
|
||||
rendercopy(batch, NULL, &src, 0, 0, 0, 0, &dst, 0, 0);
|
||||
} else {
|
||||
int ret;
|
||||
ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
|
||||
|
||||
@@ -156,7 +156,7 @@ int main(int argc, char **argv)
|
||||
drm_intel_bufmgr_gem_set_aub_dump(data.bufmgr, true);
|
||||
}
|
||||
|
||||
render_copy(batch,
|
||||
render_copy(batch, NULL,
|
||||
&src, 0, 0, WIDTH, HEIGHT,
|
||||
&dst, WIDTH / 2, HEIGHT / 2);
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
|
||||
dst.tiling = I915_TILING_NONE;
|
||||
dst.size = SIZE;
|
||||
|
||||
render_copy(batch, &src, 0, 0, WIDTH, HEIGHT, &dst, 0, 0);
|
||||
render_copy(batch, NULL, &src, 0, 0, WIDTH, HEIGHT, &dst, 0, 0);
|
||||
start_val[(i + 1) % count] = start_val[i % count];
|
||||
}
|
||||
for (i = 0; i < count; i++)
|
||||
@@ -151,7 +151,7 @@ int main(int argc, char **argv)
|
||||
dst.tiling = I915_TILING_NONE;
|
||||
dst.size = SIZE;
|
||||
|
||||
render_copy(batch, &src, 0, 0, WIDTH, HEIGHT, &dst, 0, 0);
|
||||
render_copy(batch, NULL, &src, 0, 0, WIDTH, HEIGHT, &dst, 0, 0);
|
||||
start_val[i % count] = start_val[(i + 1) % count];
|
||||
}
|
||||
for (i = 0; i < count; i++)
|
||||
@@ -176,7 +176,7 @@ int main(int argc, char **argv)
|
||||
dst.tiling = I915_TILING_NONE;
|
||||
dst.size = SIZE;
|
||||
|
||||
render_copy(batch, &src, 0, 0, WIDTH, HEIGHT, &dst, 0, 0);
|
||||
render_copy(batch, NULL, &src, 0, 0, WIDTH, HEIGHT, &dst, 0, 0);
|
||||
start_val[d] = start_val[s];
|
||||
}
|
||||
for (i = 0; i < count; i++)
|
||||
|
||||
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
|
||||
int src = i % count;
|
||||
int dst = (i + 1) % count;
|
||||
|
||||
render_copy(batch, buf+src, 0, 0, WIDTH, HEIGHT, buf+dst, 0, 0);
|
||||
render_copy(batch, NULL, buf+src, 0, 0, WIDTH, HEIGHT, buf+dst, 0, 0);
|
||||
start_val[dst] = start_val[src];
|
||||
}
|
||||
for (i = 0; i < count; i++)
|
||||
@@ -141,7 +141,7 @@ int main(int argc, char **argv)
|
||||
int src = (i + 1) % count;
|
||||
int dst = i % count;
|
||||
|
||||
render_copy(batch, buf+src, 0, 0, WIDTH, HEIGHT, buf+dst, 0, 0);
|
||||
render_copy(batch, NULL, buf+src, 0, 0, WIDTH, HEIGHT, buf+dst, 0, 0);
|
||||
start_val[dst] = start_val[src];
|
||||
}
|
||||
for (i = 0; i < count; i++)
|
||||
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
|
||||
if (src == dst)
|
||||
continue;
|
||||
|
||||
render_copy(batch, buf+src, 0, 0, WIDTH, HEIGHT, buf+dst, 0, 0);
|
||||
render_copy(batch, NULL, buf+src, 0, 0, WIDTH, HEIGHT, buf+dst, 0, 0);
|
||||
start_val[dst] = start_val[src];
|
||||
}
|
||||
for (i = 0; i < count; i++)
|
||||
|
||||
@@ -159,9 +159,9 @@ static int check_ring(drm_intel_bufmgr *bufmgr,
|
||||
igt_assert(y < height);
|
||||
|
||||
/* Dummy load to fill the ring */
|
||||
copy(batch, &src, 0, 0, width, height, &tmp, 0, 0);
|
||||
copy(batch, NULL, &src, 0, 0, width, height, &tmp, 0, 0);
|
||||
/* And copy the src into dst, pixel by pixel */
|
||||
copy(batch, &src, x, y, 1, 1, &dst, x, y);
|
||||
copy(batch, NULL, &src, x, y, 1, 1, &dst, x, y);
|
||||
}
|
||||
|
||||
/* verify */
|
||||
@@ -173,6 +173,7 @@ static int check_ring(drm_intel_bufmgr *bufmgr,
|
||||
}
|
||||
|
||||
static void blt_copy(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned w, unsigned h,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
|
||||
@@ -148,7 +148,7 @@ static void render_copyfunc(struct scratch_buf *src,
|
||||
static int warned = 0;
|
||||
|
||||
if (rendercopy) {
|
||||
rendercopy(batch_3d,
|
||||
rendercopy(batch_3d, NULL,
|
||||
src, src_x, src_y,
|
||||
width, height,
|
||||
dst, dst_x, dst_y);
|
||||
|
||||
+1
-1
@@ -328,7 +328,7 @@ static void render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned sr
|
||||
keep_gpu_busy();
|
||||
|
||||
if (rendercopy)
|
||||
rendercopy(batch, src, src_x, src_y,
|
||||
rendercopy(batch, NULL, src, src_x, src_y,
|
||||
options.tile_size, options.tile_size,
|
||||
dst, dst_x, dst_y);
|
||||
else
|
||||
|
||||
+1
-1
@@ -234,7 +234,7 @@ static void emit_dummy_load__rcs(struct test_output *o)
|
||||
for (i = 0; i < limit; i++) {
|
||||
struct scratch_buf *tmp;
|
||||
|
||||
copyfunc(batch,
|
||||
copyfunc(batch, NULL,
|
||||
src, 0, 0,
|
||||
o->fb_width, o->fb_height,
|
||||
dst, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user