mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-20 06:16:13 +00:00
lib: extract get_render_copyfunc
Otherwise we won't update all the tests if we add new render copyfuncs. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
d79414f64a
commit
64f669f7a9
@ -63,6 +63,8 @@ typedef void (*render_copyfunc_t)(struct intel_batchbuffer *batch,
|
|||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y);
|
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||||
|
|
||||||
|
render_copyfunc_t get_render_copyfunc(int devid);
|
||||||
|
|
||||||
void gen7_render_copyfunc(struct intel_batchbuffer *batch,
|
void gen7_render_copyfunc(struct intel_batchbuffer *batch,
|
||||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
|
@ -227,3 +227,19 @@ void gen2_render_copyfunc(struct intel_batchbuffer *batch,
|
|||||||
|
|
||||||
intel_batchbuffer_flush(batch);
|
intel_batchbuffer_flush(batch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
render_copyfunc_t get_render_copyfunc(int devid)
|
||||||
|
{
|
||||||
|
render_copyfunc_t copy = NULL;
|
||||||
|
|
||||||
|
if (IS_GEN2(devid))
|
||||||
|
copy = gen2_render_copyfunc;
|
||||||
|
else if (IS_GEN3(devid))
|
||||||
|
copy = gen3_render_copyfunc;
|
||||||
|
else if (IS_GEN6(devid))
|
||||||
|
copy = gen6_render_copyfunc;
|
||||||
|
else if (IS_GEN7(devid))
|
||||||
|
copy = gen7_render_copyfunc;
|
||||||
|
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
@ -58,6 +58,7 @@ static void init_buffer(drm_intel_bufmgr *bufmgr,
|
|||||||
static void *work(void *arg)
|
static void *work(void *arg)
|
||||||
{
|
{
|
||||||
struct intel_batchbuffer *batch;
|
struct intel_batchbuffer *batch;
|
||||||
|
render_copyfunc_t rendercopy = get_render_copyfunc(devid);
|
||||||
drm_intel_context *context;
|
drm_intel_context *context;
|
||||||
drm_intel_bufmgr *bufmgr;
|
drm_intel_bufmgr *bufmgr;
|
||||||
int thread_id = *(int *)arg;
|
int thread_id = *(int *)arg;
|
||||||
@ -88,7 +89,8 @@ static void *work(void *arg)
|
|||||||
|
|
||||||
|
|
||||||
if (uncontexted) {
|
if (uncontexted) {
|
||||||
gen6_render_copyfunc(batch, &src, 0, 0, 0, 0, &dst, 0, 0);
|
assert(rendercopy);
|
||||||
|
rendercopy(batch, &src, 0, 0, 0, 0, &dst, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
int ret;
|
int ret;
|
||||||
ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
|
ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
|
||||||
|
@ -219,13 +219,7 @@ int main(int argc, char **argv)
|
|||||||
/* Strictly only required on architectures with a separate BLT ring,
|
/* Strictly only required on architectures with a separate BLT ring,
|
||||||
* but lets stress everybody.
|
* but lets stress everybody.
|
||||||
*/
|
*/
|
||||||
copy = NULL;
|
copy = get_render_copyfunc(batch->devid);
|
||||||
if (IS_GEN2(batch->devid))
|
|
||||||
copy = gen2_render_copyfunc;
|
|
||||||
else if (IS_GEN3(batch->devid))
|
|
||||||
copy = gen3_render_copyfunc;
|
|
||||||
else if (IS_GEN6(batch->devid))
|
|
||||||
copy = gen6_render_copyfunc;
|
|
||||||
|
|
||||||
if (drmtest_run_subtest("render") && copy)
|
if (drmtest_run_subtest("render") && copy)
|
||||||
fails += check_ring(bufmgr, batch, "render", copy);
|
fails += check_ring(bufmgr, batch, "render", copy);
|
||||||
|
@ -323,31 +323,16 @@ static void render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned sr
|
|||||||
unsigned logical_tile_no)
|
unsigned logical_tile_no)
|
||||||
{
|
{
|
||||||
static unsigned keep_gpu_busy_counter = 0;
|
static unsigned keep_gpu_busy_counter = 0;
|
||||||
|
render_copyfunc_t rendercopy = get_render_copyfunc(devid);
|
||||||
|
|
||||||
/* check both edges of the fence usage */
|
/* check both edges of the fence usage */
|
||||||
if (keep_gpu_busy_counter & 1)
|
if (keep_gpu_busy_counter & 1)
|
||||||
keep_gpu_busy();
|
keep_gpu_busy();
|
||||||
|
|
||||||
if (IS_GEN2(devid))
|
if (rendercopy)
|
||||||
gen2_render_copyfunc(batch,
|
rendercopy(batch, src, src_x, src_y,
|
||||||
src, src_x, src_y,
|
options.tile_size, options.tile_size,
|
||||||
options.tile_size, options.tile_size,
|
dst, dst_x, dst_y);
|
||||||
dst, dst_x, dst_y);
|
|
||||||
else if (IS_GEN3(devid))
|
|
||||||
gen3_render_copyfunc(batch,
|
|
||||||
src, src_x, src_y,
|
|
||||||
options.tile_size, options.tile_size,
|
|
||||||
dst, dst_x, dst_y);
|
|
||||||
else if (IS_GEN6(devid))
|
|
||||||
gen6_render_copyfunc(batch,
|
|
||||||
src, src_x, src_y,
|
|
||||||
options.tile_size, options.tile_size,
|
|
||||||
dst, dst_x, dst_y);
|
|
||||||
else if (IS_GEN7(devid))
|
|
||||||
gen7_render_copyfunc(batch,
|
|
||||||
src, src_x, src_y,
|
|
||||||
options.tile_size, options.tile_size,
|
|
||||||
dst, dst_x, dst_y);
|
|
||||||
else
|
else
|
||||||
blitter_copyfunc(src, src_x, src_y,
|
blitter_copyfunc(src, src_x, src_y,
|
||||||
dst, dst_x, dst_y,
|
dst, dst_x, dst_y,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user