Skip to contentSkip to conversation

lib/i915: Move submission related helpers to lib/i915/gem_submission

PATCH In review Michał Winiarski 3 participants 4 messages Oct 18, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/i915: Move submission related helpers to lib/i915/gem_submission

Since I accidentally broke the build for some, by putting the pretty printer for submission inside ifdef HAVE_PROCPS, it's time to move the whole thing into lib/i915 while fixing this mistake.
Let's also rename the pretty printer and add a doc to it as well as the section.

Fixes f6dfe556659f ("lib: Extract helpers for determining submission method")
Cc Arkadiusz Hiler <[email protected]>
Cc Chris Wilson <[email protected]>
---
 .../intel-gpu-tools/intel-gpu-tools-docs.xml       |   1 +
 lib/Makefile.sources                               |   2 +
 lib/i915/gem_submission.c                          | 128 +++++++++++++++++++++
 lib/i915/gem_submission.h                          |  35 ++++++
 lib/igt_aux.c                                      |  18 ---
 lib/igt_aux.h                                      |   4 +-
 lib/igt_gt.c                                       |  63 ----------
 lib/igt_gt.h                                       |   7 --
 lib/meson.build                                    |   2 +
 tests/gem_eio.c                                    |   2 +-
 tests/gem_exec_await.c                             |   2 +-
 tests/gem_exec_fence.c                             |   2 +-
 tests/gem_exec_latency.c                           |   2 +-
 tests/gem_exec_nop.c                               |   2 +-
 tests/gem_exec_schedule.c                          |   2 +-
 tests/gem_exec_whisper.c                           |   2 +-
 tests/gem_read_read_speed.c                        |   2 +-
 tests/gem_sync.c                                   |   2 +-
 18 files changed, 179 insertions(+), 99 deletions(-)
 create mode 100644 lib/i915/gem_submission.c
 create mode 100644 lib/i915/gem_submission.h
docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml +1 -0
index c5be60d0..8d77cecd 100644
@@ -50,6 +50,7 @@
     <title>igt/i915 API Reference</title>
     <xi:include href="xml/gem_context.xml"/>
     <xi:include href="xml/gem_scheduler.xml"/>
+    <xi:include href="xml/gem_submission.xml"/>
   </chapter>
   <xi:include href="xml/igt_test_programs.xml"/>
 
lib/Makefile.sources +2 -0
index 09c9ef9f..6e968d9f 100644
@@ -7,6 +7,8 @@ lib_source_list =	 	\
 	i915/gem_context.h	\
 	i915/gem_scheduler.c	\
 	i915/gem_scheduler.h	\
+	i915/gem_submission.c	\
+	i915/gem_submission.h	\
 	i915_3d.h		\
 	i915_reg.h		\
 	i915_pciids.h		\
lib/i915/gem_submission.c new file +128 -0

128 lines not on this page · raw message

lib/i915/gem_submission.h new file +35 -0
new file mode 100644
index 00000000..783ed7a0
@@ -0,0 +1,35 @@
+/*
+ * Copyright © 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef GEM_SUBMISSION_H
+#define GEM_SUBMISSION_H
+
+#define GEM_SUBMISSION_SEMAPHORES	(1 << 0)
+#define GEM_SUBMISSION_EXECLISTS	(1 << 1)
+#define GEM_SUBMISSION_GUC		(1 << 2)
+unsigned gem_submission_method(int fd);
+void gem_submission_print_method(int fd);
+bool gem_has_semaphores(int fd);
+bool gem_has_execlists(int fd);
+
+#endif /* GEM_SUBMISSION_H */
lib/igt_aux.c +0 -18
index c1082143..ee53559c 100644
@@ -1493,24 +1493,6 @@ igt_show_stat(proc_t *info, int *state, const char *fn)
 	++*state;
 }
 
-void gem_show_submission_method(int fd)
-{
-	const unsigned flags = gem_submission_method(fd);
-
-	if (flags & GEM_SUBMISSION_GUC) {
-		igt_info("Using GuC submission\n");
-		return;
-	}
-
-	if (flags & GEM_SUBMISSION_EXECLISTS) {
-		igt_info("Using Execlists submission\n");
-		return;
-	}
-
-	igt_info("Using Legacy submission%s\n",
-		 flags & GEM_SUBMISSION_SEMAPHORES ? ", with semaphores" : "");
-}
-
 static void
 __igt_lsof_fds(proc_t *proc_info, int *state, char *proc_path, const char *dir)
 {
lib/igt_aux.h +2 -2
index e4a48eba..0bd226be 100644
@@ -33,6 +33,8 @@
 #include <stddef.h>
 #include <sys/time.h>
 
+#include <i915/gem_submission.h>
+
 extern drm_intel_bo **trash_bos;
 extern int num_trash_bos;
 
@@ -280,8 +282,6 @@ void igt_unlock_mem(void);
 	ret_;								\
 })
 
-void gem_show_submission_method(int fd);
-
 struct igt_mean;
 void igt_start_siglatency(int sig); /* 0 => SIGRTMIN (default) */
 double igt_stop_siglatency(struct igt_mean *result);
lib/igt_gt.c +0 -63

66 lines not on this page · raw message

lib/igt_gt.h +0 -7
index 6b8f78eb..2579cbd3 100644
@@ -80,11 +80,4 @@ extern const struct intel_execution_engine {
 
 bool gem_can_store_dword(int fd, unsigned int engine);
 
-#define GEM_SUBMISSION_SEMAPHORES	(1 << 0)
-#define GEM_SUBMISSION_EXECLISTS	(1 << 1)
-#define GEM_SUBMISSION_GUC		(1 << 2)
-unsigned gem_submission_method(int fd);
-bool gem_has_semaphores(int fd);
-bool gem_has_execlists(int fd);
-
 #endif /* IGT_GT_H */
lib/meson.build +2 -0
index f0125a6d..b31c68e4 100644
@@ -4,6 +4,7 @@ lib_headers = [
 	'i830_reg.h',
 	'i915/gem_context.h',
 	'i915/gem_scheduler.h',
+	'i915/gem_submission.h',
 	'i915_3d.h',
 	'i915_reg.h',
 	'i915_pciids.h',
@@ -52,6 +53,7 @@ lib_sources = [
 	'drmtest.c',
 	'i915/gem_context.c',
 	'i915/gem_scheduler.c',
+	'i915/gem_submission.c',
 	'igt_debugfs.c',
 	'igt_aux.c',
 	'igt_gt.c',
tests/gem_eio.c +1 -1
index c30212f4..2d4c95f4 100644
@@ -431,7 +431,7 @@ igt_main
 		igt_force_gpu_reset(fd);
 		igt_install_exit_handler(exit_handler);
 
-		gem_show_submission_method(fd);
+		gem_submission_print_method(fd);
 		igt_require_gem(fd);
 		igt_require_hang_ring(fd, I915_EXEC_DEFAULT);
 	}
tests/gem_exec_await.c +1 -1
index 326783a1..9c446792 100644
@@ -343,7 +343,7 @@ igt_main
 
 		device = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(device);
-		gem_show_submission_method(device);
+		gem_submission_print_method(device);
 
 		ring_size = measure_ring_size(device) - 10;
 		if (!gem_has_execlists(device))
tests/gem_exec_fence.c +1 -1
index ae3760c9..2ea23b62 100644
@@ -1434,7 +1434,7 @@ igt_main
 		igt_require(gem_has_exec_fence(i915));
 		gem_require_mmap_wc(i915);
 
-		gem_show_submission_method(i915);
+		gem_submission_print_method(i915);
 	}
 
 	for (e = intel_execution_engines; e->name; e++) {
tests/gem_exec_latency.c +1 -1
index a942c205..e9d93440 100644
@@ -417,7 +417,7 @@ igt_main
 		igt_require_gem(device);
 		gem_require_mmap_wc(device);
 
-		gem_show_submission_method(device);
+		gem_submission_print_method(device);
 
 		ring_size = measure_ring_size(device);
 		igt_info("Ring size: %d batches\n", ring_size);
tests/gem_exec_nop.c +1 -1
index 37cddd8c..ce3a8ef7 100644
@@ -652,7 +652,7 @@ igt_main
 
 		device = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(device);
-		gem_show_submission_method(device);
+		gem_submission_print_method(device);
 		gem_scheduler_print_capability(device);
 
 		handle = gem_create(device, 4096);
tests/gem_exec_schedule.c +1 -1
index baf1112d..a2f4419a 100644
@@ -957,7 +957,7 @@ igt_main
 
 	igt_fixture {
 		fd = drm_open_driver_master(DRIVER_INTEL);
-		gem_show_submission_method(fd);
+		gem_submission_print_method(fd);
 		gem_scheduler_print_capability(fd);
 		igt_require_gem(fd);
 		gem_require_mmap_wc(fd);
tests/gem_exec_whisper.c +1 -1
index dfa8a3b4..51921ba3 100644
@@ -553,7 +553,7 @@ igt_main
 		fd = drm_open_driver_master(DRIVER_INTEL);
 		igt_require_gem(fd);
 		igt_require(gem_can_store_dword(fd, 0));
-		gem_show_submission_method(fd);
+		gem_submission_print_method(fd);
 
 		igt_fork_hang_detector(fd);
 	}
tests/gem_read_read_speed.c +1 -1
index bbd8e54e..3dcf440c 100644
@@ -197,7 +197,7 @@ igt_main
 
 		batch =  intel_batchbuffer_alloc(bufmgr, devid);
 
-		gem_show_submission_method(fd);
+		gem_submission_print_method(fd);
 	}
 
 	for (i = 0; sizes[i] != 0; i++) {
tests/gem_sync.c +1 -1
index 6ead76b8..36180aee 100644
@@ -793,7 +793,7 @@ igt_main
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(fd);
-		gem_show_submission_method(fd);
+		gem_submission_print_method(fd);
 		gem_scheduler_print_capability(fd);
 
 		igt_fork_hang_detector(fd);
Signature · 6 lines
2.13.6

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

Quoting Michał Winiarski (2017-10-18 09:02:12)

Quoted 10 lines

Since I accidentally broke the build for some, by putting the pretty printer for submission inside ifdef HAVE_PROCPS, it's time to move the whole thing into lib/i915 while fixing this mistake.
Let's also rename the pretty printer and add a doc to it as well as the section.

Fixes f6dfe556659f ("lib: Extract helpers for determining submission method")
Cc Arkadiusz Hiler <[email protected]>
Cc Chris Wilson <[email protected]>

Lvgtm, and looks like what I did for my poor old i915gm,

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

#2 lore raw

✓ Fi.CI.BAT: success for lib/i915: Move submission related helpers to lib/i915/gem_submission

In reply to Michał Winiarski
== Series Details ==

== Series Details ==

Series: lib/i915: Move submission related helpers to lib/i915/gem_submission
URL : https://patchwork.freedesktop.org/series/32184/
State : success

== Summary ==

IGT patchset tested on top of latest successful build e66027ceef6266ef72fc7485567f518d2ce48817 tests: remove kms_fbc_crc

with latest DRM-Tip kernel build CI_DRM_3258
8b18ad103908 drm-tip: 2017y-10m-18d-08h-27m-31s UTC integration manifest

No testlist changes.

Test chamelium:

        Subgroup dp-crc-fast:
                fail       -> PASS       (fi-kbl-7500u) fdo#102514

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:442s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:451s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:373s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:524s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:263s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:496s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:499s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:497s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:480s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:417s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:260s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:577s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:424s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:437s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:491s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:461s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:491s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:575s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:480s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:586s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:546s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:451s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:649s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:532s
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:457s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:570s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:421s

== Logs ==

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

#3 lore raw

✓ Fi.CI.IGT: success for lib/i915: Move submission related helpers to lib/i915/gem_submission

In reply to Michał Winiarski
== Series Details ==

== Series Details ==

Series: lib/i915: Move submission related helpers to lib/i915/gem_submission
URL : https://patchwork.freedesktop.org/series/32184/
State : success

== Summary ==

Test kms_setmode:

        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912
Test perf:
        Subgroup polling:
                fail       -> PASS       (shard-hsw) fdo#102252

fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-hsw total:2489 pass:1399 dwarn:0 dfail:0 fail:9 skip:1081 time:9097s

== Logs ==

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