diff options
author | Peter Antoine <peter.antoine@intel.com> | 2016-04-11 17:50:09 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-04-12 10:45:49 +0100 |
commit | 8af67d1980a1251bd8efb51d4a31062084fe8e03 (patch) | |
tree | 417ddc29a6785413349d7b9351b7f5447e94cb4f /lib/ioctl_wrappers.c | |
parent | d6a85f042cf0ac7f297189ef48f85caf972515a9 (diff) |
test/gem_mocs_settings: Testing MOCS register settings
The MOCS registers were added in Gen9 and define the caching policy.
The registers are split into two sets. The first set controls the
EDRAM policy and have a set for each engine, the second set controls
the L3 policy. The two sets use the same index.
The RCS registers and the L3CC registers are stored in the RCS context.
The test checks that the registers are correct by checking the values by
directly reading them via MMIO, then again it tests them by reading them
from within a batch buffer. RCS engine is tested last as it programs the
registers via a batch buffer and this will invalidate the test for
workloads that don't use the render ring or don't run a render batch
first.
v2: Reorganised the structure.
Added more tests. (Chris Wilson)
v3: Fixed a few bugs. (Chris Wilson)
v4: More Tidy-ups. (Chris Wilson)
SKL does does not have a snoop bit. (Peter Antoine)
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Diffstat (limited to 'lib/ioctl_wrappers.c')
-rw-r--r-- | lib/ioctl_wrappers.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 7df53111..c47eaa42 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -1401,6 +1401,30 @@ void gem_require_ring(int fd, unsigned ring) igt_require(gem_has_ring(fd, ring)); } +/** + * gem_has_mocs_registers: + * @fd: open i915 drm file descriptor + * + * Feature test macro to query whether the device has MOCS registers. + * These exist gen 9+. + */ +bool gem_has_mocs_registers(int fd) +{ + return intel_gen(intel_get_drm_devid(fd)) >= 9; +} + +/** + * gem_require_mocs_registers: + * @fd: open i915 drm file descriptor + * + * Feature test macro to query whether the device has MOCS registers. + * These exist gen 9+. + */ +void gem_require_mocs_registers(int fd) +{ + igt_require(gem_has_mocs_registers(fd)); +} + /* prime */ /** |