wsim/media-bench: i915 balancing
RFC 1/1 wsim/media-bench: i915 balancing
From: Tvrtko Ursulin <[email protected]>
Support i915 virtual engine from gem_wsim (-b i915) and media-bench.pl
v2: Rebase for ctx->virtual.
--- benchmarks/gem_wsim.c | 86 +++++++++++++++++++++++++++++++++++++++++++------- scripts/media-bench.pl | 9 ++++-- 2 files changed, 80 insertions(+), 15 deletions(-)
benchmarks/gem_wsim.c +74 -12
@@ -58,6 +58,17 @@#define LOCAL_I915_EXEC_FENCE_IN (1<<16)#define LOCAL_I915_EXEC_FENCE_OUT (1<<17) +struct local_drm_i915_gem_context_create_v2 { +/* output: id of new context*/ +__u32 ctx_id; +__u32 flags; +#define LOCAL_I915_GEM_CONTEXT_SHARE_GTT 0x1 +__u32 share_ctx; +__u32 virtual; +}; + +#define LOCAL_DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct local_drm_i915_gem_context_create_v2) +enum intel_engine_id {RCS ,BCS ,
@@ -219,6 +230,7 @@ static int fd;#define HEARTBEAT (1<<7)#define GLOBAL_BALANCE (1<<8)#define DEPSYNC (1<<9) +#define I915 (1<<10)#define SEQNO_IDX (engine) ((engine) * 16)#define SEQNO_OFFSET (engine) (SEQNO_IDX(engine) * sizeof(uint32_t))
@@ -725,6 +737,25 @@ terminate_bb(struct w_step *w, unsigned int flags) w->mapped_len = mmap_len; } +#define I915_EXEC_CLASS_INSTANCE (1<<20) + +#define I915_EXEC_INSTANCE_SHIFT (21) +#define I915_EXEC_INSTANCE_MASK (0xff << I915_EXEC_INSTANCE_SHIFT) + +#define i915_execbuffer2_engine (class, instance) \ + (I915_EXEC_CLASS_INSTANCE | \ + (class) | \ + ((instance) << I915_EXEC_INSTANCE_SHIFT)) + +static const unsigned int eb_class_map[NUM_ENGINES ] = { + [RCS ] =i915_execbuffer2_engine (I915_ENGINE_CLASS_RENDER ,0 ), + [BCS ] =i915_execbuffer2_engine (I915_ENGINE_CLASS_COPY ,0 ), + [VCS ] =i915_execbuffer2_engine (I915_ENGINE_CLASS_VIDEO ,0 ), + [VCS1 ] =i915_execbuffer2_engine (I915_ENGINE_CLASS_VIDEO ,0 ), + [VCS2 ] =i915_execbuffer2_engine (I915_ENGINE_CLASS_VIDEO ,1 ), + [VECS ] =i915_execbuffer2_engine (I915_ENGINE_CLASS_VIDEO_ENHANCE ,0 ) +}; +static const unsigned int eb_engine_map[NUM_ENGINES ] = { [RCS ] =I915_EXEC_RENDER , [BCS ] =I915_EXEC_BLT ,
@@ -742,7 +773,10 @@ eb_set_engine(struct drm_i915_gem_execbuffer2 *eb,if (engine ==VCS2 && (flags &VCS2REMAP )) engine =BCS ; - eb->flags = eb_engine_map[engine]; +if (flags &I915 ) + eb->flags = eb_class_map[engine]; +else + eb->flags = eb_engine_map[engine]; } static void
@@ -888,12 +922,27 @@ prepare_workload(unsigned int id, struct workload *wrk, unsigned int flags) }if (!wrk->ctx_list[w->context].id) { -struct drm_i915_gem_context_create arg = {}; +uint32_t ctx_id; -drmIoctl (fd,DRM_IOCTL_I915_GEM_CONTEXT_CREATE , &arg); -igt_assert (arg.ctx_id); +if (flags &I915 ) { +struct local_drm_i915_gem_context_create_v2 args = { }; - wrk->ctx_list[w->context].id = arg.ctx_id; + args.virtual =1 ; +drmIoctl (fd, +LOCAL_DRM_IOCTL_I915_GEM_CONTEXT_CREATE , + &args); + ctx_id = args.ctx_id; + + }else { +struct drm_i915_gem_context_create args = {}; + +drmIoctl (fd,DRM_IOCTL_I915_GEM_CONTEXT_CREATE , + &args); + ctx_id = args.ctx_id; + } + +igt_assert (ctx_id); + wrk->ctx_list[w->context].id = ctx_id;if (flags &GLOBAL_BALANCE ) { wrk->ctx_list[w->context].static_vcs = context_vcs_rr;
@@ -905,7 +954,7 @@ prepare_workload(unsigned int id, struct workload *wrk, unsigned int flags)if (wrk->prio) {struct drm_i915_gem_context_param param = { - .ctx_id = arg.ctx_id, + .ctx_id = ctx_id, .param =I915_CONTEXT_PARAM_PRIORITY , .value = wrk->prio, };
@@ -1446,6 +1495,12 @@ static const struct workload_balancer all_balancers[] = { .get_qd = get_engine_busy, .balance = busy_avg_balance, }, + { + .id = 11, + .name = "i915", + .desc = "i915 balancing.", + .flags = I915, + }, }; static unsigned int
@@ -1809,7 +1864,8 @@ static void *run_workload(void *data) last_sync = false; wrk->nr_bb[engine]++; -if (engine ==VCS && wrk->balancer) { +if (engine ==VCS && wrk->balancer && + wrk->balancer->balance) { engine = wrk->balancer->balance (wrk->balancer, wrk, w); wrk->nr_bb[engine]++;
@@ -2321,11 +2377,17 @@ int main(int argc, char **argv)printf ("%u client%s.\n" , clients, clients >1 ?"s" :"" );if (flags &SWAPVCS )printf ("Swapping VCS rings between clients.\n" ); -if (flags &GLOBAL_BALANCE ) -printf ("Using %s balancer in global mode.\n" , - balancer->name); -else if (balancer) +if (flags &GLOBAL_BALANCE ) { +if (flags &I915 ) { +printf ("Ignoring global balancing with i915!\n" ); + flags &= ~GLOBAL_BALANCE ; + }else { +printf ("Using %s balancer in global mode.\n" , + balancer->name); + } + }else if (balancer) {printf ("Using %s balancer.\n" , balancer->name); + } }if (master_workload >=0 && clients ==1 )
@@ -2342,7 +2404,7 @@ int main(int argc, char **argv)if (flags &SWAPVCS && i &1 ) flags_ &= ~SWAPVCS ; -if (flags &GLOBAL_BALANCE ) { +if ((flags &GLOBAL_BALANCE ) && !(flags &I915 )) { w[i]->balancer = &global_balancer; w[i]->global_wrk = w[0 ]; w[i]->global_balancer = balancer;
scripts/media-bench.pl +6 -3
@@ -47,10 +47,11 @@ my $nop; my %opts; my @balancers = ( 'rr', 'rand', 'qd', 'qdr', 'qdavg', 'rt', 'rtr', 'rtavg', - 'context', 'busy', 'busy-avg' ); + 'context', 'busy', 'busy-avg', 'i915' ); my %bal_skip_H = ( 'rr' => 1, 'rand' => 1, 'context' => 1, , 'busy' => 1, - 'busy-avg' => 1 ); -my %bal_skip_R = ( 'context' => 1 ); + 'busy-avg' => 1, 'i915' => 1 ); +my %bal_skip_R = ( 'context' => 1, 'i915' => 1 ); +my %bal_skip_G = ( 'i915' => 1 ); my @workloads = ( 'media_load_balance_17i7.wsim',
@@ -432,6 +433,8 @@ foreach my $wrk (@workloads) { my $bid; if ($bal ne '') { + next GBAL if $G =~ '-G' and exists $bal_skip_G{$bal}; + push @xargs, "-b $bal"; push @xargs, '-R' unless exists $bal_skip_R{$bal}; push @xargs, $G if $G ne '';
Signature · 6 lines
2.14.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for wsim/media-bench: i915 balancing
== Series Details ==
== Series Details ==
Series: wsim/media-bench: i915 balancing
URL : https://patchwork.freedesktop.org/series/37107/
State : success
== Summary ==
IGT patchset tested on top of latest successful build 872fd8f21e22a3ca49739b67c47c6665da450dbf tests/kms_ccs: Grab the CRC when the plane is actually enabled
with latest DRM-Tip kernel build CI_DRM_36839d8467fe5626 drm-tip: 2018y-01m-24d-19h-59m-41s UTC integration manifest
No testlist changes.
Test debugfs_test:
Subgroup read_all_entries:
dmesg-warn -> DMESG-FAIL (fi-elk-e7500) fdo#103989
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS (fi-snb-2520m) fdo#103713fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:421s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:442s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:373s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:493s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:284s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:486s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:489s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:470s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:462s fi-elk-e7500 total:224 pass:168 dwarn:9 dfail:1 fail:0 skip:45 fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:279s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:514s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:396s fi-hsw-4770r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:407s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:416s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:454s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:415s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:459s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:502s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:456s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:504s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:579s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:433s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:517s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:529s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:489s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:493s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:423s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:433s fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:529s fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:402s Blacklisted hosts: fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:565s fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:474s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_823/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.IGT: warning for wsim/media-bench: i915 balancing
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: wsim/media-bench: i915 balancing
URL : https://patchwork.freedesktop.org/series/37107/
State : warning
== Summary ==
Test kms_cursor_legacy:
Subgroup flip-vs-cursor-crc-atomic:
fail -> PASS (shard-apl) fdo#102670
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-pri-indfb-multidraw:
pass -> FAIL (shard-snb) fdo#103167
Test kms_cursor_crc:
Subgroup cursor-64x64-suspend:
pass -> SKIP (shard-snb) fdo#102365
Test kms_ccs:
Subgroup pipe-a-crc-sprite-planes-basic:
fail -> SKIP (shard-apl) fdo#104724 +1
Test kms_flip:
Subgroup plain-flip-fb-recreate-interruptible:
fail -> PASS (shard-hsw) fdo#100368
Subgroup busy-flip:
pass -> FAIL (shard-apl) fdo#103257
Subgroup 2x-flip-vs-modeset-interruptible:
dmesg-warn -> PASS (shard-hsw) fdo#102614
Test kms_plane:
Subgroup plane-position-hole-pipe-b-planes:
pass -> SKIP (shard-snb)
Test gem_eio:
Subgroup in-flight-contexts:
fail -> PASS (shard-hsw) fdo#104676fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103257 https://bugs.freedesktop.org/show_bug.cgi?id=103257
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
shard-apl total:2838 pass:1752 dwarn:1 dfail:0 fail:21 skip:1064 time:12715s shard-hsw total:2838 pass:1736 dwarn:1 dfail:0 fail:10 skip:1090 time:12216s shard-snb total:2838 pass:1327 dwarn:1 dfail:0 fail:11 skip:1499 time:6630s
Blacklisted hosts:
shard-kbl total:2774 pass:1819 dwarn:3 dfail:0 fail:22 skip:929 time:9410s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_823/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev