summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-22 15:44:48 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-22 15:44:48 +0100
commit83a4c7d3eb6347f9b743144611b08a2869f11f94 (patch)
tree45136688d8bc1ff98a5aacf50e68dfb4846a6e3a /tests
parent82c6dffe9fdc75a7ef3b9a7e53e1c20d8a9b3703 (diff)
lib/intel_batchbuffer: igt_ namespace for the buffer structure
Step one to properly namespace the rendercpy/mediafill functions. Als give the buf_height/width helpers a proper igt_ prefix. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_ctx_basic.c4
-rw-r--r--tests/gem_media_fill.c6
-rw-r--r--tests/gem_render_copy.c12
-rw-r--r--tests/gem_render_linear_blits.c6
-rw-r--r--tests/gem_render_tiled_blits.c2
-rw-r--r--tests/gem_ring_sync_copy.c12
-rw-r--r--tests/gem_ringfill.c6
-rw-r--r--tests/gem_seqno_wrap.c8
-rw-r--r--tests/gem_stress.c64
-rw-r--r--tests/kms_fbc_crc.c4
-rw-r--r--tests/kms_flip.c4
11 files changed, 64 insertions, 64 deletions
diff --git a/tests/gem_ctx_basic.c b/tests/gem_ctx_basic.c
index 34542511..67d6191e 100644
--- a/tests/gem_ctx_basic.c
+++ b/tests/gem_ctx_basic.c
@@ -61,7 +61,7 @@ int devid;
int fd;
static void init_buffer(drm_intel_bufmgr *bufmgr,
- struct scratch_buf *buf,
+ struct igt_buf *buf,
uint32_t size)
{
buf->bo = drm_intel_bo_alloc(bufmgr, "", size, 4096);
@@ -93,7 +93,7 @@ static void *work(void *arg)
igt_require(context);
for (i = 0; i < iter; i++) {
- struct scratch_buf src, dst;
+ struct igt_buf src, dst;
init_buffer(bufmgr, &src, 4096);
init_buffer(bufmgr, &dst, 4096);
diff --git a/tests/gem_media_fill.c b/tests/gem_media_fill.c
index df891290..7fc56761 100644
--- a/tests/gem_media_fill.c
+++ b/tests/gem_media_fill.c
@@ -66,7 +66,7 @@ typedef struct {
uint8_t linear[WIDTH * HEIGHT];
} data_t;
-static void scratch_buf_init(data_t *data, struct scratch_buf *buf,
+static void scratch_buf_init(data_t *data, struct igt_buf *buf,
int width, int height, int stride, uint8_t color)
{
drm_intel_bo *bo;
@@ -85,7 +85,7 @@ static void scratch_buf_init(data_t *data, struct scratch_buf *buf,
}
static void
-scratch_buf_check(data_t *data, struct scratch_buf *buf, int x, int y,
+scratch_buf_check(data_t *data, struct igt_buf *buf, int x, int y,
uint8_t color)
{
uint8_t val;
@@ -104,7 +104,7 @@ igt_simple_main
{
data_t data = {0, };
struct intel_batchbuffer *batch = NULL;
- struct scratch_buf dst;
+ struct igt_buf dst;
media_fillfunc_t media_fill = NULL;
int i, j;
diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c
index 65323a94..7196a51a 100644
--- a/tests/gem_render_copy.c
+++ b/tests/gem_render_copy.c
@@ -66,7 +66,7 @@ typedef struct {
uint32_t linear[WIDTH * HEIGHT];
} data_t;
-static void scratch_buf_write_to_png(struct scratch_buf *buf, const char *filename)
+static void scratch_buf_write_to_png(struct igt_buf *buf, const char *filename)
{
cairo_surface_t *surface;
cairo_status_t ret;
@@ -74,8 +74,8 @@ static void scratch_buf_write_to_png(struct scratch_buf *buf, const char *filena
drm_intel_bo_map(buf->bo, 0);
surface = cairo_image_surface_create_for_data(buf->bo->virtual,
CAIRO_FORMAT_RGB24,
- buf_width(buf),
- buf_height(buf),
+ igt_buf_width(buf),
+ igt_buf_height(buf),
buf->stride);
ret = cairo_surface_write_to_png(surface, filename);
if (ret != CAIRO_STATUS_SUCCESS) {
@@ -86,7 +86,7 @@ static void scratch_buf_write_to_png(struct scratch_buf *buf, const char *filena
drm_intel_bo_unmap(buf->bo);
}
-static void scratch_buf_init(data_t *data, struct scratch_buf *buf,
+static void scratch_buf_init(data_t *data, struct igt_buf *buf,
int width, int height, int stride, uint32_t color)
{
drm_intel_bo *bo;
@@ -105,7 +105,7 @@ static void scratch_buf_init(data_t *data, struct scratch_buf *buf,
}
static void
-scratch_buf_check(data_t *data, struct scratch_buf *buf, int x, int y,
+scratch_buf_check(data_t *data, struct igt_buf *buf, int x, int y,
uint32_t color)
{
uint32_t val;
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
{
data_t data = {0, };
struct intel_batchbuffer *batch = NULL;
- struct scratch_buf src, dst;
+ struct igt_buf src, dst;
render_copyfunc_t render_copy = NULL;
int opt;
int opt_dump_png = false;
diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c
index 5efcc210..9d5d4ccf 100644
--- a/tests/gem_render_linear_blits.c
+++ b/tests/gem_render_linear_blits.c
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
printf("Cyclic blits, forward...\n");
for (i = 0; i < count * 4; i++) {
- struct scratch_buf src, dst;
+ struct igt_buf src, dst;
src.bo = bo[i % count];
src.stride = STRIDE;
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
printf("Cyclic blits, backward...\n");
for (i = 0; i < count * 4; i++) {
- struct scratch_buf src, dst;
+ struct igt_buf src, dst;
src.bo = bo[(i + 1) % count];
src.stride = STRIDE;
@@ -180,7 +180,7 @@ int main(int argc, char **argv)
printf("Random blits...\n");
for (i = 0; i < count * 4; i++) {
- struct scratch_buf src, dst;
+ struct igt_buf src, dst;
int s = random() % count;
int d = random() % count;
diff --git a/tests/gem_render_tiled_blits.c b/tests/gem_render_tiled_blits.c
index 71dfdd64..0552af1f 100644
--- a/tests/gem_render_tiled_blits.c
+++ b/tests/gem_render_tiled_blits.c
@@ -84,7 +84,7 @@ int main(int argc, char **argv)
drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
uint32_t *start_val;
- struct scratch_buf *buf;
+ struct igt_buf *buf;
uint32_t start = 0;
int i, j, fd, count;
diff --git a/tests/gem_ring_sync_copy.c b/tests/gem_ring_sync_copy.c
index b7dcf9df..1ab9b0ce 100644
--- a/tests/gem_ring_sync_copy.c
+++ b/tests/gem_ring_sync_copy.c
@@ -70,8 +70,8 @@ typedef struct {
struct {
render_copyfunc_t copy;
- struct scratch_buf *srcs;
- struct scratch_buf *dsts;
+ struct igt_buf *srcs;
+ struct igt_buf *dsts;
} render;
struct {
@@ -128,7 +128,7 @@ static void bo_check(data_t *data, drm_intel_bo *bo, uint32_t val)
igt_assert_cmpint(data->linear[i], ==, val);
}
-static void scratch_buf_init_from_bo(struct scratch_buf *buf, drm_intel_bo *bo)
+static void scratch_buf_init_from_bo(struct igt_buf *buf, drm_intel_bo *bo)
{
buf->bo = bo;
buf->stride = 4 * WIDTH;
@@ -136,7 +136,7 @@ static void scratch_buf_init_from_bo(struct scratch_buf *buf, drm_intel_bo *bo)
buf->size = 4 * WIDTH * HEIGHT;
}
-static void scratch_buf_init(data_t *data, struct scratch_buf *buf,
+static void scratch_buf_init(data_t *data, struct igt_buf *buf,
int width, int height, uint32_t color)
{
drm_intel_bo *bo;
@@ -162,7 +162,7 @@ static void render_busy(data_t *data)
size_t array_size;
int i;
- array_size = data->n_buffers_load * sizeof(struct scratch_buf);
+ array_size = data->n_buffers_load * sizeof(struct igt_buf);
data->render.srcs = malloc(array_size);
data->render.dsts = malloc(array_size);
@@ -201,7 +201,7 @@ static void render_busy_fini(data_t *data)
static void render_copy(data_t *data, drm_intel_bo *src, drm_intel_bo *dst)
{
- struct scratch_buf src_buf, dst_buf;
+ struct igt_buf src_buf, dst_buf;
scratch_buf_init_from_bo(&src_buf, src);
scratch_buf_init_from_bo(&dst_buf, dst);
diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index 8e0ca91b..0dd22272 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -115,7 +115,7 @@ static int check_ring(drm_intel_bufmgr *bufmgr,
const char *ring,
render_copyfunc_t copy)
{
- struct scratch_buf src, tmp, dst;
+ struct igt_buf src, tmp, dst;
struct bo bo;
char output[100];
int i;
@@ -174,9 +174,9 @@ 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,
+ struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned w, unsigned h,
- struct scratch_buf *dst, unsigned dst_x, unsigned dst_y)
+ struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
{
BLIT_COPY_BATCH_START(batch->devid, 0);
OUT_BATCH((3 << 24) | /* 32 bits */
diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c
index cc133a9a..664e552c 100644
--- a/tests/gem_seqno_wrap.c
+++ b/tests/gem_seqno_wrap.c
@@ -70,7 +70,7 @@ struct option_struct {
static struct option_struct options;
static void init_buffer(drm_intel_bufmgr *bufmgr,
- struct scratch_buf *buf,
+ struct igt_buf *buf,
drm_intel_bo *bo,
int width, int height)
{
@@ -139,8 +139,8 @@ static void release_bo(drm_intel_bo *bo)
drm_intel_bo_unreference(bo);
}
-static void render_copyfunc(struct scratch_buf *src,
- struct scratch_buf *dst,
+static void render_copyfunc(struct igt_buf *src,
+ struct igt_buf *dst,
int width,
int height)
{
@@ -188,7 +188,7 @@ static int run_sync_test(int num_buffers, bool verify)
int r = -1;
int failed = 0;
unsigned int *p_dst1, *p_dst2;
- struct scratch_buf *s_src, *s_dst;
+ struct igt_buf *s_src, *s_dst;
fd = drm_open_any();
igt_assert(fd >= 0);
diff --git a/tests/gem_stress.c b/tests/gem_stress.c
index 527f7de8..20f2ca33 100644
--- a/tests/gem_stress.c
+++ b/tests/gem_stress.c
@@ -117,7 +117,7 @@ struct option_struct options;
#define BUSY_BUF_SIZE (256*4096)
#define TILE_BYTES(size) ((size)*(size)*sizeof(uint32_t))
-static struct scratch_buf buffers[2][MAX_BUFS];
+static struct igt_buf buffers[2][MAX_BUFS];
/* tile i is at logical position tile_permutation[i] */
static unsigned *tile_permutation;
static unsigned num_buffers = 0;
@@ -133,7 +133,7 @@ struct {
unsigned max_failed_reads;
} stats;
-static void tile2xy(struct scratch_buf *buf, unsigned tile, unsigned *x, unsigned *y)
+static void tile2xy(struct igt_buf *buf, unsigned tile, unsigned *x, unsigned *y)
{
igt_assert(tile < buf->num_tiles);
*x = (tile*options.tile_size) % (buf->stride/sizeof(uint32_t));
@@ -194,15 +194,15 @@ static void keep_gpu_busy(void)
busy_bo, 0, 4096, 0, 128);
}
-static void set_to_cpu_domain(struct scratch_buf *buf, int writing)
+static void set_to_cpu_domain(struct igt_buf *buf, int writing)
{
gem_set_domain(drm_fd, buf->bo->handle, I915_GEM_DOMAIN_CPU,
writing ? I915_GEM_DOMAIN_CPU : 0);
}
static unsigned int copyfunc_seq = 0;
-static void (*copyfunc)(struct scratch_buf *src, unsigned src_x, unsigned src_y,
- struct scratch_buf *dst, unsigned dst_x, unsigned dst_y,
+static void (*copyfunc)(struct igt_buf *src, unsigned src_x, unsigned src_y,
+ struct igt_buf *dst, unsigned dst_x, unsigned dst_y,
unsigned logical_tile_no);
/* stride, x, y in units of uint32_t! */
@@ -240,8 +240,8 @@ static void cpucpy2d(uint32_t *src, unsigned src_stride, unsigned src_x, unsigne
stats.num_failed++;
}
-static void cpu_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y,
- struct scratch_buf *dst, unsigned dst_x, unsigned dst_y,
+static void cpu_copyfunc(struct igt_buf *src, unsigned src_x, unsigned src_y,
+ struct igt_buf *dst, unsigned dst_x, unsigned dst_y,
unsigned logical_tile_no)
{
igt_assert(batch->ptr == batch->buffer);
@@ -259,8 +259,8 @@ static void cpu_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y
logical_tile_no);
}
-static void prw_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y,
- struct scratch_buf *dst, unsigned dst_x, unsigned dst_y,
+static void prw_copyfunc(struct igt_buf *src, unsigned src_x, unsigned src_y,
+ struct igt_buf *dst, unsigned dst_x, unsigned dst_y,
unsigned logical_tile_no)
{
uint32_t tmp_tile[options.tile_size*options.tile_size];
@@ -303,8 +303,8 @@ static void prw_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y
}
}
-static void blitter_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y,
- struct scratch_buf *dst, unsigned dst_x, unsigned dst_y,
+static void blitter_copyfunc(struct igt_buf *src, unsigned src_x, unsigned src_y,
+ struct igt_buf *dst, unsigned dst_x, unsigned dst_y,
unsigned logical_tile_no)
{
static unsigned keep_gpu_busy_counter = 0;
@@ -333,8 +333,8 @@ static void blitter_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned s
}
}
-static void render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y,
- struct scratch_buf *dst, unsigned dst_x, unsigned dst_y,
+static void render_copyfunc(struct igt_buf *src, unsigned src_x, unsigned src_y,
+ struct igt_buf *dst, unsigned dst_x, unsigned dst_y,
unsigned logical_tile_no)
{
static unsigned keep_gpu_busy_counter = 0;
@@ -453,28 +453,28 @@ static void fan_in_and_check(void)
}
}
-static void sanitize_stride(struct scratch_buf *buf)
+static void sanitize_stride(struct igt_buf *buf)
{
- if (buf_height(buf) > options.max_dimension)
+ if (igt_buf_height(buf) > options.max_dimension)
buf->stride = buf->size / options.max_dimension;
- if (buf_height(buf) < options.tile_size)
+ if (igt_buf_height(buf) < options.tile_size)
buf->stride = buf->size / options.tile_size;
- if (buf_width(buf) < options.tile_size)
+ if (igt_buf_width(buf) < options.tile_size)
buf->stride = options.tile_size * sizeof(uint32_t);
igt_assert(buf->stride <= 8192);
- igt_assert(buf_width(buf) <= options.max_dimension);
- igt_assert(buf_height(buf) <= options.max_dimension);
+ igt_assert(igt_buf_width(buf) <= options.max_dimension);
+ igt_assert(igt_buf_height(buf) <= options.max_dimension);
- igt_assert(buf_width(buf) >= options.tile_size);
- igt_assert(buf_height(buf) >= options.tile_size);
+ igt_assert(igt_buf_width(buf) >= options.tile_size);
+ igt_assert(igt_buf_height(buf) >= options.tile_size);
}
-static void init_buffer(struct scratch_buf *buf, unsigned size)
+static void init_buffer(struct igt_buf *buf, unsigned size)
{
buf->bo = drm_intel_bo_alloc(bufmgr, "tiled bo", size, 4096);
buf->size = size;
@@ -499,12 +499,12 @@ static void init_buffer(struct scratch_buf *buf, unsigned size)
static void exchange_buf(void *array, unsigned i, unsigned j)
{
- struct scratch_buf *buf_arr, tmp;
+ struct igt_buf *buf_arr, tmp;
buf_arr = array;
- memcpy(&tmp, &buf_arr[i], sizeof(struct scratch_buf));
- memcpy(&buf_arr[i], &buf_arr[j], sizeof(struct scratch_buf));
- memcpy(&buf_arr[j], &tmp, sizeof(struct scratch_buf));
+ memcpy(&tmp, &buf_arr[i], sizeof(struct igt_buf));
+ memcpy(&buf_arr[i], &buf_arr[j], sizeof(struct igt_buf));
+ memcpy(&buf_arr[j], &tmp, sizeof(struct igt_buf));
}
@@ -576,7 +576,7 @@ static void copy_tiles(unsigned *permutation)
{
unsigned src_tile, src_buf_idx, src_x, src_y;
unsigned dst_tile, dst_buf_idx, dst_x, dst_y;
- struct scratch_buf *src_buf, *dst_buf;
+ struct igt_buf *src_buf, *dst_buf;
int i, idx;
for (i = 0; i < num_total_tiles; i++) {
/* tile_permutation is independent of current_permutation, so
@@ -820,7 +820,7 @@ static void init(void)
static void check_render_copyfunc(void)
{
- struct scratch_buf src, dst;
+ struct igt_buf src, dst;
uint32_t *ptr;
int i, j, pass;
@@ -831,10 +831,10 @@ static void check_render_copyfunc(void)
init_buffer(&dst, options.scratch_buf_size);
for (pass = 0; pass < 16; pass++) {
- int sx = random() % (buf_width(&src)-options.tile_size);
- int sy = random() % (buf_height(&src)-options.tile_size);
- int dx = random() % (buf_width(&dst)-options.tile_size);
- int dy = random() % (buf_height(&dst)-options.tile_size);
+ int sx = random() % (igt_buf_width(&src)-options.tile_size);
+ int sy = random() % (igt_buf_height(&src)-options.tile_size);
+ int dx = random() % (igt_buf_width(&dst)-options.tile_size);
+ int dy = random() % (igt_buf_height(&dst)-options.tile_size);
if (options.use_cpu_maps)
set_to_cpu_domain(&src, 1);
diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c
index bb06bc49..d05d14e0 100644
--- a/tests/kms_fbc_crc.c
+++ b/tests/kms_fbc_crc.c
@@ -168,7 +168,7 @@ static void fill_blt(data_t *data, uint32_t handle, unsigned char color)
gem_bo_busy(data->drm_fd, handle);
}
-static void scratch_buf_init(struct scratch_buf *buf, drm_intel_bo *bo)
+static void scratch_buf_init(struct igt_buf *buf, drm_intel_bo *bo)
{
buf->bo = bo;
buf->stride = 4096;
@@ -204,7 +204,7 @@ static void fill_render(data_t *data, uint32_t handle,
{
drm_intel_bo *src, *dst;
struct intel_batchbuffer *batch;
- struct scratch_buf src_buf, dst_buf;
+ struct igt_buf src_buf, dst_buf;
const uint8_t buf[4] = { color, color, color, color };
render_copyfunc_t rendercopy = get_render_copyfunc(data->devid);
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 5ef5afa2..e89ae99d 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -248,7 +248,7 @@ static void emit_dummy_load__rcs(struct test_output *o)
{
const struct kmstest_fb *fb_info = &o->fb_info[o->current_fb_id];
render_copyfunc_t copyfunc;
- struct scratch_buf sb[2], *src, *dst;
+ struct igt_buf sb[2], *src, *dst;
int i, limit;
copyfunc = get_render_copyfunc(devid);
@@ -277,7 +277,7 @@ static void emit_dummy_load__rcs(struct test_output *o)
dst = &sb[1];
for (i = 0; i < limit; i++) {
- struct scratch_buf *tmp;
+ struct igt_buf *tmp;
copyfunc(batch, NULL,
src, 0, 0,