Skip to contentSkip to conversation

gem_ctx_param: Update for context priorities

PATCH In review Tvrtko Ursulin 3 participants 3 messages Nov 8, 2017 – Nov 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gem_ctx_param: Update for context priorities

From: Tvrtko Ursulin <[email protected]>

Update the test to check for context priority get and set and at the same time bump the invalid flag tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103107
Cc: Daniel Vetter <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Joonas Lahtinen <[email protected]>

---
 lib/i915/gem_context.c | 25 ++++++++++++++++++++++---
 lib/i915/gem_context.h |  2 ++
 tests/gem_ctx_param.c  | 20 +++++++++++++++++++-
 3 files changed, 43 insertions(+), 4 deletions(-)
lib/i915/gem_context.c +22 -3
index 6d9edf5e3263..778dc6ca76e3 100644
@@ -198,8 +198,6 @@ void gem_context_require_bannable(int fd)
 	igt_require(has_ban_period || has_bannable);
 }
 
-#define LOCAL_I915_CONTEXT_PARAM_PRIORITY 0x6
-
 /**
  * __gem_context_set_priority:
  * @fd: open i915 drm file descriptor
@@ -219,7 +217,7 @@ int __gem_context_set_priority(int fd, uint32_t ctx_id, int prio)
 	memset(&p, 0, sizeof(p));
 	p.context = ctx_id;
 	p.size = 0;
-	p.param = LOCAL_I915_CONTEXT_PARAM_PRIORITY;
+	p.param = LOCAL_CONTEXT_PARAM_PRIORITY;
 	p.value = prio;
 
 	return __gem_context_set_param(fd, &p);
@@ -237,3 +235,24 @@ void gem_context_set_priority(int fd, uint32_t ctx_id, int prio)
 {
 	igt_assert(__gem_context_set_priority(fd, ctx_id, prio) == 0);
 }
+
+/**
+ * gem_context_get_priority:
+ * @fd: open i915 drm file descriptor
+ * @ctx_id: i915 context id
+ *
+ * Returns the current context priority.
+ */
+int gem_context_get_priority(int fd, uint32_t ctx_id)
+{
+	struct local_i915_gem_context_param p;
+
+	memset(&p, 0, sizeof(p));
+	p.context = ctx_id;
+	p.size = 0;
+	p.param = LOCAL_CONTEXT_PARAM_PRIORITY;
+
+	igt_assert_eq(__gem_context_get_param(fd, &p), 0);
+
+	return p.value;
+}
lib/i915/gem_context.h +2 -0
index a2339c4b6da2..ac89512225e5 100644
@@ -36,6 +36,7 @@ struct local_i915_gem_context_param {
 #define LOCAL_CONTEXT_PARAM_GTT_SIZE	0x3
 #define LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE	0x4
 #define LOCAL_CONTEXT_PARAM_BANNABLE	0x5
+#define LOCAL_CONTEXT_PARAM_PRIORITY	0x6
 	uint64_t value;
 };
 void gem_context_require_bannable(int fd);
@@ -50,5 +51,6 @@ int __gem_context_get_param(int fd, struct local_i915_gem_context_param *p);
 #define LOCAL_I915_CONTEXT_MIN_USER_PRIORITY	-1023
 int __gem_context_set_priority(int fd, uint32_t ctx, int prio);
 void gem_context_set_priority(int fd, uint32_t ctx, int prio);
+int gem_context_get_priority(int fd, uint32_t ctx);
 
 #endif /* GEM_CONTEXT_H */
tests/gem_ctx_param.c +19 -1
index efdaf191a1ed..43f6f96e0857 100644
@@ -136,11 +136,29 @@ igt_main
 		gem_context_set_param(fd, &arg);
 	}
 
+	igt_subtest_group {
+		igt_fixture {
+			igt_require(gem_scheduler_enabled(fd));
+			igt_require(gem_scheduler_has_ctx_priority(fd));
+		}
+
+		igt_subtest("priority-get") {
+			igt_assert_eq(gem_context_get_priority(fd, ctx), 0);
+		}
+
+		igt_subtest("priority-set") {
+			int prio = LOCAL_I915_CONTEXT_DEFAULT_PRIORITY - 1;
+
+			gem_context_set_priority(fd, ctx, prio);
+			igt_assert_eq(gem_context_get_priority(fd, ctx), prio);
+		}
+	}
+
 	/* NOTE: This testcase intentionally tests for the next free parameter
 	 * to catch ABI extensions. Don't "fix" this testcase without adding all
 	 * the tests for the new param first.
 	 */
-	arg.param = LOCAL_CONTEXT_PARAM_BANNABLE + 1;
+	arg.param = LOCAL_CONTEXT_PARAM_PRIORITY + 1;
 
 	igt_subtest("invalid-param-get") {
 		arg.context = ctx;
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✗ Fi.CI.BAT: failure for gem_ctx_param: Update for context priorities

== Series Details ==

== Series Details ==

Series: gem_ctx_param: Update for context priorities
URL : https://patchwork.freedesktop.org/series/33408/
State : failure

== Summary ==

IGT patchset tested on top of latest successful build 9fe5a9a3de9e2ce345d5967a1e10a9a586b19836 tests/kms_fbcon_fbt: Report fbc_status on error

with latest DRM-Tip kernel build CI_DRM_3321
087c404bd6d5 drm-tip: 2017y-11m-08d-15h-44m-06s UTC integration manifest

Testlist changes:
+igt@gem_ctx_param@priority-get
+igt@gem_ctx_param@priority-set

Test gem_exec_reloc:

        Subgroup basic-gtt:
                pass       -> DMESG-WARN (fi-bsw-n3050)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m)
fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:447s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:456s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:380s
fi-bsw-n3050     total:289  pass:242  dwarn:1   dfail:0   fail:0   skip:46  time:541s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:277s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:506s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:504s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:504s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:487s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:430s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:265s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:541s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:427s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:444s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:429s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:481s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:463s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:486s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:528s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:483s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:537s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:577s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:459s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:541s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:570s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:523s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:495s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:467s
fi-snb-2520m     total:246  pass:212  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:423s
Blacklisted hosts:
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:572s
fi-glk-dsi       total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  time:492s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_480/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#2 lore raw
In reply to Tvrtko Ursulin
Quoted 10 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Update the test to check for context priority get and set and at the same time bump the invalid flag tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103107
Cc: Daniel Vetter <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Joonas Lahtinen <[email protected]>

Looks good to me for now, we can think of further steps then.

Regards, Joonas

Signature · 7 lines
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx