From c66b2425e706bec5ce6df8664d19b06e047eb0ee Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Fri, 6 Feb 2015 10:49:20 +0100 Subject: lib/gt: api polish for igt_can_hang_ring Align with common igt library style: - Push the igt_require into the function. - Push the intel_gen into the function. Signed-off-by: Daniel Vetter --- lib/igt_gt.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lib/igt_gt.c') diff --git a/lib/igt_gt.c b/lib/igt_gt.c index 526cbee0..c003a7ca 100644 --- a/lib/igt_gt.c +++ b/lib/igt_gt.c @@ -29,16 +29,12 @@ #include "igt_debugfs.h" #include "ioctl_wrappers.h" #include "intel_reg.h" +#include "intel_chipset.h" -int igt_can_hang_ring(int fd, int gen, int ring) +void igt_require_hang_ring(int fd, int ring) { - if (!gem_context_has_param(fd, LOCAL_CONTEXT_PARAM_BAN_PERIOD)) - return 0; - - if (gen < 5) /* safe resets */ - return 0; - - return 1; + igt_require(gem_context_has_param(fd, LOCAL_CONTEXT_PARAM_BAN_PERIOD)); + igt_require(intel_gen(intel_get_drm_devid(fd)) >= 5); } struct igt_hang_ring igt_hang_ring(int fd, int gen, int ring) -- cgit v1.2.3