diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-04-13 08:18:10 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-04-13 10:10:24 +0100 |
commit | 3bdafec92fae2d04cb69354ffc26e1e32ac60d65 (patch) | |
tree | 0315cc61e7fa53309fed2842d59bc6bdb754ae5b /lib/ioctl_wrappers.c | |
parent | 1ace3e0210400b70c60fcac11217a5b28b20b86e (diff) |
igt/gem_exec_reloc: Check interactions with WC domain
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/ioctl_wrappers.c')
-rw-r--r-- | lib/ioctl_wrappers.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 72fb0ebc..48bdcc56 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -702,17 +702,23 @@ bool gem_mmap__has_wc(int fd) if (has_wc == -1) { struct drm_i915_getparam gp; - int val = -1; + int mmap_version = -1; + int gtt_version = -1; has_wc = 0; memset(&gp, 0, sizeof(gp)); - gp.param = 30; /* MMAP_VERSION */ - gp.value = &val; + gp.param = 40; /* MMAP_GTT_VERSION */ + gp.value = >t_version; + ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); - /* Do we have the new mmap_ioctl? */ + memset(&gp, 0, sizeof(gp)); + gp.param = 30; /* MMAP_VERSION */ + gp.value = &mmap_version; ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); - if (val >= 1) { + + /* Do we have the new mmap_ioctl with DOMAIN_WC? */ + if (mmap_version >= 1 && gtt_version >= 2) { struct local_i915_gem_mmap_v2 arg; /* Does this device support wc-mmaps ? */ |