diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-03-22 13:47:57 +0100 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-03-22 14:00:22 +0100 |
| commit | afbdc7af8d9324ae065c47d6122bb020c579fd0a (patch) | |
| tree | 08209f3538da667dc8c504b4c6eb8ccfa909f243 /lib | |
| parent | 9e531888ed0c3e34303a67e324ea4ab29057c62b (diff) | |
tests: adapt storedw tests to ppgtt
MI_MEM_VIRTUAL actually means use global gtt now, not setting the bit
means use ppgtt. On previous gens, not setting the bits ment 'use
physical memory'. So what, the usual confusion.
Note that for some odd reasong this is broken on gen6, but only on the
bsd ring. Unexpected.
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/drmtest.c | 14 | ||||
| -rw-r--r-- | lib/drmtest.h | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c index 0f021902..f9b7a6f0 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -57,6 +57,20 @@ is_intel(int fd) return IS_INTEL(devid); } +bool gem_uses_aliasing_ppgtt(int fd) +{ + struct drm_i915_getparam gp; + int val; + + gp.param = 18; /* HAS_ALIASING_PPGTT */ + gp.value = &val; + + if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp))) + return 0; + + return val; +} + /* Ensure the gpu is idle by launching a nop execbuf and stalling for it. */ void gem_quiescent_gpu(int fd) { diff --git a/lib/drmtest.h b/lib/drmtest.h index 9f194448..96fbf1ac 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -30,6 +30,7 @@ #include <unistd.h> #include <assert.h> #include <errno.h> +#include <stdbool.h> #include "xf86drm.h" #include "intel_batchbuffer.h" @@ -53,6 +54,9 @@ uint64_t gem_aperture_size(int fd); uint64_t gem_mappable_aperture_size(void); int gem_madvise(int fd, uint32_t handle, int state); +/* feature test helpers */ +bool gem_uses_aliasing_ppgtt(int fd); + /* generally useful helpers */ void drmtest_fork_signal_helper(void); void drmtest_stop_signal_helper(void); |
