mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-22 15:26:21 +00:00
lib/intel_batchbuffer: igt_ prefix for rendercopy/mediafill funcs
Now everything is prepared to pour some neat api docs over this all. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
83a4c7d3eb
commit
53a4d9e982
@ -397,9 +397,9 @@ unsigned igt_buf_height(struct igt_buf *buf)
|
|||||||
return buf->size/buf->stride;
|
return buf->size/buf->stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
render_copyfunc_t get_render_copyfunc(int devid)
|
igt_render_copyfunc_t igt_get_render_copyfunc(int devid)
|
||||||
{
|
{
|
||||||
render_copyfunc_t copy = NULL;
|
igt_render_copyfunc_t copy = NULL;
|
||||||
|
|
||||||
if (IS_GEN2(devid))
|
if (IS_GEN2(devid))
|
||||||
copy = gen2_render_copyfunc;
|
copy = gen2_render_copyfunc;
|
||||||
@ -415,9 +415,9 @@ render_copyfunc_t get_render_copyfunc(int devid)
|
|||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
media_fillfunc_t get_media_fillfunc(int devid)
|
igt_media_fillfunc_t igt_get_media_fillfunc(int devid)
|
||||||
{
|
{
|
||||||
media_fillfunc_t fill = NULL;
|
igt_media_fillfunc_t fill = NULL;
|
||||||
|
|
||||||
if (IS_GEN8(devid))
|
if (IS_GEN8(devid))
|
||||||
fill = gen8_media_fillfunc;
|
fill = gen8_media_fillfunc;
|
||||||
|
@ -209,20 +209,20 @@ struct igt_buf {
|
|||||||
unsigned igt_buf_width(struct igt_buf *buf);
|
unsigned igt_buf_width(struct igt_buf *buf);
|
||||||
unsigned igt_buf_height(struct igt_buf *buf);
|
unsigned igt_buf_height(struct igt_buf *buf);
|
||||||
|
|
||||||
typedef void (*render_copyfunc_t)(struct intel_batchbuffer *batch,
|
typedef void (*igt_render_copyfunc_t)(struct intel_batchbuffer *batch,
|
||||||
drm_intel_context *context,
|
drm_intel_context *context,
|
||||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
|
struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||||
|
|
||||||
render_copyfunc_t get_render_copyfunc(int devid);
|
igt_render_copyfunc_t igt_get_render_copyfunc(int devid);
|
||||||
|
|
||||||
typedef void (*media_fillfunc_t)(struct intel_batchbuffer *batch,
|
typedef void (*igt_media_fillfunc_t)(struct intel_batchbuffer *batch,
|
||||||
struct igt_buf *dst,
|
struct igt_buf *dst,
|
||||||
unsigned x, unsigned y,
|
unsigned x, unsigned y,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
uint8_t color);
|
uint8_t color);
|
||||||
|
|
||||||
media_fillfunc_t get_media_fillfunc(int devid);
|
igt_media_fillfunc_t igt_get_media_fillfunc(int devid);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -74,7 +74,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);
|
igt_render_copyfunc_t rendercopy = igt_get_render_copyfunc(devid);
|
||||||
drm_intel_context *context;
|
drm_intel_context *context;
|
||||||
drm_intel_bufmgr *bufmgr;
|
drm_intel_bufmgr *bufmgr;
|
||||||
int td_fd;
|
int td_fd;
|
||||||
|
@ -105,7 +105,7 @@ igt_simple_main
|
|||||||
data_t data = {0, };
|
data_t data = {0, };
|
||||||
struct intel_batchbuffer *batch = NULL;
|
struct intel_batchbuffer *batch = NULL;
|
||||||
struct igt_buf dst;
|
struct igt_buf dst;
|
||||||
media_fillfunc_t media_fill = NULL;
|
igt_media_fillfunc_t media_fill = NULL;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
data.drm_fd = drm_open_any_render();
|
data.drm_fd = drm_open_any_render();
|
||||||
@ -114,7 +114,7 @@ igt_simple_main
|
|||||||
data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
|
data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
|
||||||
igt_assert(data.bufmgr);
|
igt_assert(data.bufmgr);
|
||||||
|
|
||||||
media_fill = get_media_fillfunc(data.devid);
|
media_fill = igt_get_media_fillfunc(data.devid);
|
||||||
|
|
||||||
igt_require_f(media_fill,
|
igt_require_f(media_fill,
|
||||||
"no media-fill function\n");
|
"no media-fill function\n");
|
||||||
|
@ -125,7 +125,7 @@ int main(int argc, char **argv)
|
|||||||
data_t data = {0, };
|
data_t data = {0, };
|
||||||
struct intel_batchbuffer *batch = NULL;
|
struct intel_batchbuffer *batch = NULL;
|
||||||
struct igt_buf src, dst;
|
struct igt_buf src, dst;
|
||||||
render_copyfunc_t render_copy = NULL;
|
igt_render_copyfunc_t render_copy = NULL;
|
||||||
int opt;
|
int opt;
|
||||||
int opt_dump_png = false;
|
int opt_dump_png = false;
|
||||||
int opt_dump_aub = drmtest_dump_aub();
|
int opt_dump_aub = drmtest_dump_aub();
|
||||||
@ -149,7 +149,7 @@ int main(int argc, char **argv)
|
|||||||
data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
|
data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
|
||||||
igt_assert(data.bufmgr);
|
igt_assert(data.bufmgr);
|
||||||
|
|
||||||
render_copy = get_render_copyfunc(data.devid);
|
render_copy = igt_get_render_copyfunc(data.devid);
|
||||||
igt_require_f(render_copy,
|
igt_require_f(render_copy,
|
||||||
"no render-copy function\n");
|
"no render-copy function\n");
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
#define SIZE (HEIGHT*STRIDE)
|
#define SIZE (HEIGHT*STRIDE)
|
||||||
|
|
||||||
static uint32_t linear[WIDTH*HEIGHT];
|
static uint32_t linear[WIDTH*HEIGHT];
|
||||||
static render_copyfunc_t render_copy;
|
static igt_render_copyfunc_t render_copy;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
check_bo(int fd, uint32_t handle, uint32_t val)
|
check_bo(int fd, uint32_t handle, uint32_t val)
|
||||||
@ -93,7 +93,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
fd = drm_open_any();
|
fd = drm_open_any();
|
||||||
|
|
||||||
render_copy = get_render_copyfunc(intel_get_drm_devid(fd));
|
render_copy = igt_get_render_copyfunc(intel_get_drm_devid(fd));
|
||||||
if (render_copy == NULL) {
|
if (render_copy == NULL) {
|
||||||
printf("no render-copy function, doing nothing\n");
|
printf("no render-copy function, doing nothing\n");
|
||||||
return 77;
|
return 77;
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
#define HEIGHT 512
|
#define HEIGHT 512
|
||||||
#define SIZE (HEIGHT*STRIDE)
|
#define SIZE (HEIGHT*STRIDE)
|
||||||
|
|
||||||
static render_copyfunc_t render_copy;
|
static igt_render_copyfunc_t render_copy;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
check_bo(drm_intel_bo *bo, uint32_t val)
|
check_bo(drm_intel_bo *bo, uint32_t val)
|
||||||
@ -94,7 +94,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
fd = drm_open_any();
|
fd = drm_open_any();
|
||||||
|
|
||||||
render_copy = get_render_copyfunc(intel_get_drm_devid(fd));
|
render_copy = igt_get_render_copyfunc(intel_get_drm_devid(fd));
|
||||||
if (render_copy == NULL) {
|
if (render_copy == NULL) {
|
||||||
printf("no render-copy function, doing nothing\n");
|
printf("no render-copy function, doing nothing\n");
|
||||||
return 77;
|
return 77;
|
||||||
|
@ -69,7 +69,7 @@ typedef struct {
|
|||||||
uint32_t linear[WIDTH * HEIGHT];
|
uint32_t linear[WIDTH * HEIGHT];
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
render_copyfunc_t copy;
|
igt_render_copyfunc_t copy;
|
||||||
struct igt_buf *srcs;
|
struct igt_buf *srcs;
|
||||||
struct igt_buf *dsts;
|
struct igt_buf *dsts;
|
||||||
} render;
|
} render;
|
||||||
@ -336,7 +336,7 @@ igt_main
|
|||||||
igt_assert(data.bufmgr);
|
igt_assert(data.bufmgr);
|
||||||
drm_intel_bufmgr_gem_enable_reuse(data.bufmgr);
|
drm_intel_bufmgr_gem_enable_reuse(data.bufmgr);
|
||||||
|
|
||||||
data.render.copy = get_render_copyfunc(data.devid);
|
data.render.copy = igt_get_render_copyfunc(data.devid);
|
||||||
igt_require_f(data.render.copy,
|
igt_require_f(data.render.copy,
|
||||||
"no render-copy function\n");
|
"no render-copy function\n");
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ static void destroy_bo(struct bo *b)
|
|||||||
static int check_ring(drm_intel_bufmgr *bufmgr,
|
static int check_ring(drm_intel_bufmgr *bufmgr,
|
||||||
struct intel_batchbuffer *batch,
|
struct intel_batchbuffer *batch,
|
||||||
const char *ring,
|
const char *ring,
|
||||||
render_copyfunc_t copy)
|
igt_render_copyfunc_t copy)
|
||||||
{
|
{
|
||||||
struct igt_buf src, tmp, dst;
|
struct igt_buf src, tmp, dst;
|
||||||
struct bo bo;
|
struct bo bo;
|
||||||
@ -197,7 +197,7 @@ static void blt_copy(struct intel_batchbuffer *batch,
|
|||||||
|
|
||||||
drm_intel_bufmgr *bufmgr;
|
drm_intel_bufmgr *bufmgr;
|
||||||
struct intel_batchbuffer *batch;
|
struct intel_batchbuffer *batch;
|
||||||
render_copyfunc_t copy;
|
igt_render_copyfunc_t copy;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
igt_main
|
igt_main
|
||||||
@ -219,7 +219,7 @@ igt_main
|
|||||||
/* 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 = get_render_copyfunc(batch->devid);
|
copy = igt_get_render_copyfunc(batch->devid);
|
||||||
igt_require(copy);
|
igt_require(copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ static void render_copyfunc(struct igt_buf *src,
|
|||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
const int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0;
|
const int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0;
|
||||||
render_copyfunc_t rendercopy = get_render_copyfunc(devid);
|
igt_render_copyfunc_t rendercopy = igt_get_render_copyfunc(devid);
|
||||||
static int warned = 0;
|
static int warned = 0;
|
||||||
|
|
||||||
if (rendercopy) {
|
if (rendercopy) {
|
||||||
|
@ -338,7 +338,7 @@ static void render_copyfunc(struct igt_buf *src, unsigned src_x, unsigned src_y,
|
|||||||
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);
|
igt_render_copyfunc_t rendercopy = igt_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)
|
||||||
|
@ -206,7 +206,7 @@ static void fill_render(data_t *data, uint32_t handle,
|
|||||||
struct intel_batchbuffer *batch;
|
struct intel_batchbuffer *batch;
|
||||||
struct igt_buf src_buf, dst_buf;
|
struct igt_buf src_buf, dst_buf;
|
||||||
const uint8_t buf[4] = { color, color, color, color };
|
const uint8_t buf[4] = { color, color, color, color };
|
||||||
render_copyfunc_t rendercopy = get_render_copyfunc(data->devid);
|
igt_render_copyfunc_t rendercopy = igt_get_render_copyfunc(data->devid);
|
||||||
|
|
||||||
igt_skip_on(!rendercopy);
|
igt_skip_on(!rendercopy);
|
||||||
|
|
||||||
|
@ -247,11 +247,11 @@ static void emit_fence_stress(struct test_output *o)
|
|||||||
static void emit_dummy_load__rcs(struct test_output *o)
|
static void emit_dummy_load__rcs(struct test_output *o)
|
||||||
{
|
{
|
||||||
const struct kmstest_fb *fb_info = &o->fb_info[o->current_fb_id];
|
const struct kmstest_fb *fb_info = &o->fb_info[o->current_fb_id];
|
||||||
render_copyfunc_t copyfunc;
|
igt_render_copyfunc_t copyfunc;
|
||||||
struct igt_buf sb[2], *src, *dst;
|
struct igt_buf sb[2], *src, *dst;
|
||||||
int i, limit;
|
int i, limit;
|
||||||
|
|
||||||
copyfunc = get_render_copyfunc(devid);
|
copyfunc = igt_get_render_copyfunc(devid);
|
||||||
if (copyfunc == NULL)
|
if (copyfunc == NULL)
|
||||||
return emit_dummy_load__bcs(o);
|
return emit_dummy_load__bcs(o);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user