summaryrefslogtreecommitdiff
path: root/lib/igt_gt.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2017-11-10 12:49:14 -0800
committerEric Anholt <eric@anholt.net>2017-11-21 09:52:57 -0800
commitaa97faa3828488478d97c1fce51650591681bdc9 (patch)
tree3d56dda9b811413245d59fab786736af8e9ffb53 /lib/igt_gt.c
parent53efeac5b9b67c35483ee2e5db6fdfc1665de12f (diff)
lib: Use drm-uapi/i915_drm.h instead of local defines.
The MMAP_V2 is replaced by just using MMAP, since the official header has the updated struct. The gem_create_v2 and gem_get_aperture are left as is, because they seem to not be reflected in the UABI header! Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/igt_gt.c')
-rw-r--r--lib/igt_gt.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 89727d22..64a2dfd6 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -126,15 +126,15 @@ void igt_require_hang_ring(int fd, int ring)
static unsigned context_get_ban(int fd, unsigned ctx)
{
- struct local_i915_gem_context_param param;
+ struct drm_i915_gem_context_param param;
- param.param = LOCAL_CONTEXT_PARAM_BANNABLE;
+ param.param = I915_CONTEXT_PARAM_BANNABLE;
param.value = 0;
param.size = 0;
if (__gem_context_get_param(fd, &param) == -EINVAL) {
igt_assert(param.value == 0);
- param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD;
+ param.param = I915_CONTEXT_PARAM_BAN_PERIOD;
gem_context_get_param(fd, &param);
}
@@ -143,24 +143,24 @@ static unsigned context_get_ban(int fd, unsigned ctx)
static void context_set_ban(int fd, unsigned ctx, unsigned ban)
{
- struct local_i915_gem_context_param param;
+ struct drm_i915_gem_context_param param;
memset(&param, 0, sizeof(param));
- param.context = ctx;
+ param.ctx_id = ctx;
param.value = ban;
param.size = 0;
- param.param = LOCAL_CONTEXT_PARAM_BANNABLE;
+ param.param = I915_CONTEXT_PARAM_BANNABLE;
if(__gem_context_set_param(fd, &param) == -EINVAL) {
igt_assert(param.value == ban);
- param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD;
+ param.param = I915_CONTEXT_PARAM_BAN_PERIOD;
gem_context_set_param(fd, &param);
}
}
igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags)
{
- struct local_i915_gem_context_param param;
+ struct drm_i915_gem_context_param param;
unsigned ban;
igt_assert(igt_sysfs_set_parameter
@@ -172,11 +172,11 @@ igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags)
if (!igt_check_boolean_env_var("IGT_HANG_WITHOUT_RESET", false))
igt_require(has_gpu_reset(fd));
- param.context = ctx;
+ param.ctx_id = ctx;
param.size = 0;
if ((flags & HANG_ALLOW_CAPTURE) == 0) {
- param.param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE;
+ param.param = I915_CONTEXT_PARAM_NO_ERROR_CAPTURE;
param.value = 1;
/* Older kernels may not have NO_ERROR_CAPTURE, in which case
* we just eat the error state in post-hang (and hope we eat
@@ -198,9 +198,9 @@ void igt_disallow_hang(int fd, igt_hang_t arg)
context_set_ban(fd, arg.ctx, arg.ban);
if ((arg.flags & HANG_ALLOW_CAPTURE) == 0) {
- struct local_i915_gem_context_param param = {
- .context = arg.ctx,
- .param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE,
+ struct drm_i915_gem_context_param param = {
+ .ctx_id = arg.ctx,
+ .param = I915_CONTEXT_PARAM_NO_ERROR_CAPTURE,
.value = 0,
};
__gem_context_set_param(fd, &param);
@@ -272,7 +272,7 @@ igt_hang_t igt_hang_ctx(int fd,
struct drm_i915_gem_relocation_entry reloc;
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 exec;
- struct local_i915_gem_context_param param;
+ struct drm_i915_gem_context_param param;
uint32_t b[16];
unsigned ban;
unsigned len;
@@ -282,11 +282,11 @@ igt_hang_t igt_hang_ctx(int fd,
/* check if non-default ctx submission is allowed */
igt_require(ctx == 0 || has_ctx_exec(fd, ring, ctx));
- param.context = ctx;
+ param.ctx_id = ctx;
param.size = 0;
if ((flags & HANG_ALLOW_CAPTURE) == 0) {
- param.param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE;
+ param.param = I915_CONTEXT_PARAM_NO_ERROR_CAPTURE;
param.value = 1;
/* Older kernels may not have NO_ERROR_CAPTURE, in which case
* we just eat the error state in post-hang (and hope we eat
@@ -371,9 +371,9 @@ void igt_post_hang_ring(int fd, igt_hang_t arg)
context_set_ban(fd, arg.ctx, arg.ban);
if ((arg.flags & HANG_ALLOW_CAPTURE) == 0) {
- struct local_i915_gem_context_param param = {
- .context = arg.ctx,
- .param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE,
+ struct drm_i915_gem_context_param param = {
+ .ctx_id = arg.ctx,
+ .param = I915_CONTEXT_PARAM_NO_ERROR_CAPTURE,
.value = 0,
};
__gem_context_set_param(fd, &param);