[Intel-gfx] [PATCH i-g-t 02/17] lib/ioctl: api polish for gem_context_has_param

Daniel Vetter daniel.vetter at ffwll.ch
Tue Feb 10 10:05:45 PST 2015


Just push the igt_require down to align with the usual style.

Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 lib/igt_gt.c         | 2 +-
 lib/ioctl_wrappers.c | 4 ++--
 lib/ioctl_wrappers.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index c003a7ca30f0..615f9893b876 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -33,7 +33,7 @@
 
 void igt_require_hang_ring(int fd, int ring)
 {
-	igt_require(gem_context_has_param(fd, LOCAL_CONTEXT_PARAM_BAN_PERIOD));
+	gem_context_require_param(fd, LOCAL_CONTEXT_PARAM_BAN_PERIOD);
 	igt_require(intel_gen(intel_get_drm_devid(fd)) >= 5);
 }
 
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 19a457ac2b34..dd89e2c57e7f 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -1080,7 +1080,7 @@ int gem_context_set_param(int fd, struct local_i915_gem_context_param *p)
 	return 0;
 }
 
-int gem_context_has_param(int fd, uint64_t param)
+void gem_context_require_param(int fd, uint64_t param)
 {
 	struct local_i915_gem_context_param p;
 
@@ -1089,5 +1089,5 @@ int gem_context_has_param(int fd, uint64_t param)
 	p.value = 0;
 	p.size = 0;
 
-	return gem_context_get_param(fd, &p) == 0;
+	igt_require(gem_context_get_param(fd, &p) == 0);
 }
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 30ab83628a04..a1017ecd3767 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -113,7 +113,7 @@ struct local_i915_gem_context_param {
 	uint64_t value;
 };
 
-int gem_context_has_param(int fd, uint64_t param);
+void gem_context_require_param(int fd, uint64_t param);
 int gem_context_get_param(int fd, struct local_i915_gem_context_param *p);
 int gem_context_set_param(int fd, struct local_i915_gem_context_param *p);
 
-- 
2.1.4



More information about the Intel-gfx mailing list