[Intel-gfx] [i-g-t PATCH v1 4/7] tests/kms_flip: Move bufmgr requirement into subtests

Tomeu Vizoso tomeu.vizoso at collabora.com
Mon Apr 18 11:42:52 UTC 2016


Because bufmgr is currently a i915-only thing and it's only needed in a
subset of the subtests, require it only in the subtests that actually
need it so that the other subtests aren't skipped without a reason.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
---

 tests/kms_flip.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 524a8a3c2d14..58b167d46d90 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -246,6 +246,8 @@ static int _emit_dummy_load__bcs(struct test_output *o, int limit, int timeout)
 	drm_intel_bo *src_bo, *dst_bo, *fb_bo;
 	struct igt_fb *fb_info = &o->fb_info[o->current_fb_id];
 
+	igt_require(bufmgr);
+
 	src_bo = drm_intel_bo_alloc(bufmgr, "dummy_bo", 2048*2048*4, 4096);
 	igt_assert(src_bo);
 
@@ -298,6 +300,8 @@ static void emit_fence_stress(struct test_output *o)
 	drm_intel_bo **bo;
 	int i;
 
+	igt_require(bufmgr);
+
 	bo = calloc(sizeof(*bo), num_fences);
 	exec = calloc(sizeof(*exec), num_fences+1);
 	for (i = 0; i < num_fences - 1; i++) {
@@ -337,6 +341,8 @@ static int _emit_dummy_load__rcs(struct test_output *o, int limit, int timeout)
 	struct igt_buf sb[3], *src, *dst, *fb;
 	int i, ret = 0;
 
+	igt_require(bufmgr);
+
 	copyfunc = igt_get_render_copyfunc(devid);
 	if (copyfunc == NULL)
 		return _emit_dummy_load__bcs(o, limit, timeout);
@@ -1689,8 +1695,10 @@ int main(int argc, char **argv)
 		get_timestamp_format();
 
 		bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
-		devid = intel_get_drm_devid(drm_fd);
-		batch = intel_batchbuffer_alloc(bufmgr, devid);
+		if (bufmgr) {
+			devid = intel_get_drm_devid(drm_fd);
+			batch = intel_batchbuffer_alloc(bufmgr, devid);
+		}
 	}
 
 	igt_subtest("nonblocking-read")
-- 
2.5.5



More information about the Intel-gfx mailing list