summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@sixbynine.org>2016-11-14 16:55:01 +0000
committerRobert Bragg <robert@sixbynine.org>2016-11-17 13:06:06 +0000
commitb9359a29af6f61a52159aefd9557eea945dd13e1 (patch)
tree0cbdc28205f22d7c0fdfc2d4e2da5ee53afc6712
parent93132a8fd9f1b9b326949da0d7b74a0d3915ecce (diff)
igt/gem_exec_parse: init global parser_version in fixture
This adds a static global int parser_version that can be referenced by all subtests without needing multiple GETPARAM requests. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
-rw-r--r--tests/gem_exec_parse.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c
index ebcd092c..9e57ff58 100644
--- a/tests/gem_exec_parse.c
+++ b/tests/gem_exec_parse.c
@@ -51,6 +51,7 @@
#define PIPE_CONTROL_QW_WRITE (1<<14)
#define PIPE_CONTROL_LRI_POST_OP (1<<23)
+static int parser_version;
static int command_parser_version(int fd)
{
@@ -341,7 +342,7 @@ static void hsw_load_register_reg(void)
fd = drm_open_driver(DRIVER_INTEL);
igt_require(IS_HASWELL(intel_get_drm_devid(fd)));
- igt_require(command_parser_version(fd) >= 7);
+ igt_require(parser_version >= 7);
handle = gem_create(fd, 4096);
@@ -381,16 +382,10 @@ igt_main
int fd;
igt_fixture {
- int parser_version = 0;
- drm_i915_getparam_t gp;
- int rc;
-
fd = drm_open_driver(DRIVER_INTEL);
- gp.param = I915_PARAM_CMD_PARSER_VERSION;
- gp.value = &parser_version;
- rc = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
- igt_require(!rc && parser_version > 0);
+ parser_version = command_parser_version(fd);
+ igt_require(parser_version != -1);
igt_require(gem_uses_ppgtt(fd));