* [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs
@ 2019-03-14 12:50 Michał Winiarski
2019-03-14 12:50 ` [igt-dev] [CI 2/8] tests/perf: Simplify generic read/write, use sysfs helpers Michał Winiarski
` (10 more replies)
0 siblings, 11 replies; 14+ messages in thread
From: Michał Winiarski @ 2019-03-14 12:50 UTC (permalink / raw)
To: igt-dev
The "benchmark" mode is no longer used.
While I'm here, let's also move things around and start to use
igt_sysfs, rather implementing own set of helpers.
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
tests/i915/gem_exec_blt.c | 117 ++++++++++++--------------------------
1 file changed, 35 insertions(+), 82 deletions(-)
diff --git a/tests/i915/gem_exec_blt.c b/tests/i915/gem_exec_blt.c
index 8d61dc87..0fcfdd4b 100644
--- a/tests/i915/gem_exec_blt.c
+++ b/tests/i915/gem_exec_blt.c
@@ -38,6 +38,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
+#include "igt_sysfs.h"
#define OBJECT_SIZE 16384
@@ -181,19 +182,16 @@ static int dcmp(const void *A, const void *B)
return 0;
}
-static void run(int object_size, bool dumb)
+static void run(int fd, int object_size, bool dumb)
{
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 exec[3];
struct drm_i915_gem_relocation_entry reloc[4];
uint32_t buf[20];
uint32_t handle, src, dst;
- int fd, len, count;
+ int len, count;
int ring;
- fd = drm_open_driver(DRIVER_INTEL);
- igt_require_gem(fd);
-
if (dumb)
handle = kmstest_dumb_create(fd, 32, 32, 32, NULL, NULL);
else
@@ -262,81 +260,36 @@ static void run(int object_size, bool dumb)
fflush(stdout);
}
gem_close(fd, handle);
-
- close(fd);
-}
-
-static int sysfs_read(const char *name)
-{
- char buf[4096];
- int sysfd;
- int len;
-
- sprintf(buf, "/sys/class/drm/card%d/%s",
- drm_get_card(), name);
- sysfd = open(buf, O_RDONLY);
- if (sysfd < 0)
- return -1;
-
- len = read(sysfd, buf, sizeof(buf)-1);
- close(sysfd);
- if (len < 0)
- return -1;
-
- buf[len] = '\0';
- return atoi(buf);
-}
-
-static int sysfs_write(const char *name, int value)
-{
- char buf[4096];
- int sysfd;
- int len;
-
- sprintf(buf, "/sys/class/drm/card%d/%s",
- drm_get_card(), name);
- sysfd = open(buf, O_WRONLY);
- if (sysfd < 0)
- return -1;
-
- len = sprintf(buf, "%d", value);
- len = write(sysfd, buf, len);
- close(sysfd);
-
- if (len < 0)
- return len;
-
- return 0;
}
-static void set_auto_freq(void)
+static void set_auto_freq(int sysfs)
{
- int min = sysfs_read("gt_RPn_freq_mhz");
- int max = sysfs_read("gt_RP0_freq_mhz");
+ int min = igt_sysfs_get_u32(sysfs, "gt_RPn_freq_mhz");
+ int max = igt_sysfs_get_u32(sysfs, "gt_RP0_freq_mhz");
if (max <= min)
return;
igt_debug("Setting min to %dMHz, and max to %dMHz\n", min, max);
- sysfs_write("gt_min_freq_mhz", min);
- sysfs_write("gt_max_freq_mhz", max);
+ igt_sysfs_set_u32(sysfs, "gt_min_freq_mhz", min);
+ igt_sysfs_set_u32(sysfs, "gt_max_freq_mhz", max);
}
-static void set_min_freq(void)
+static void set_min_freq(int sysfs)
{
- int min = sysfs_read("gt_RPn_freq_mhz");
+ int min = igt_sysfs_get_u32(sysfs, "gt_RPn_freq_mhz");
igt_require(min > 0);
igt_debug("Setting min/max to %dMHz\n", min);
- igt_require(sysfs_write("gt_min_freq_mhz", min) == 0 &&
- sysfs_write("gt_max_freq_mhz", min) == 0);
+ igt_require(igt_sysfs_set_u32(sysfs, "gt_min_freq_mhz", min) &&
+ igt_sysfs_set_u32(sysfs, "gt_max_freq_mhz", min));
}
-static void set_max_freq(void)
+static void set_max_freq(int sysfs)
{
- int max = sysfs_read("gt_RP0_freq_mhz");
+ int max = igt_sysfs_get_u32(sysfs, "gt_RP0_freq_mhz");
igt_require(max > 0);
igt_debug("Setting min/max to %dMHz\n", max);
- igt_require(sysfs_write("gt_max_freq_mhz", max) == 0 &&
- sysfs_write("gt_min_freq_mhz", max) == 0);
+ igt_require(igt_sysfs_set_u32(sysfs, "gt_max_freq_mhz", max) &&
+ igt_sysfs_set_u32(sysfs, "gt_min_freq_mhz", max));
}
@@ -344,7 +297,7 @@ int main(int argc, char **argv)
{
const struct {
const char *suffix;
- void (*func)(void);
+ void (*func)(int);
} rps[] = {
{ "", set_auto_freq },
{ "-min", set_min_freq },
@@ -352,44 +305,44 @@ int main(int argc, char **argv)
{ NULL, NULL },
}, *r;
int min = -1, max = -1;
- int i;
+ int fd, sysfs;
igt_subtest_init(argc, argv);
igt_skip_on_simulation();
- if (argc > 1) {
- for (i = 1; i < argc; i++) {
- int object_size = atoi(argv[i]);
- if (object_size)
- run((object_size + 3) & -4, false);
- }
- _exit(0); /* blergh */
- }
-
igt_fixture {
- min = sysfs_read("gt_min_freq_mhz");
- max = sysfs_read("gt_max_freq_mhz");
+ fd = drm_open_driver(DRIVER_INTEL);
+ igt_require_gem(fd);
+
+ sysfs = igt_sysfs_open(fd, NULL);
+ igt_require(sysfs >= 0);
+
+ min = igt_sysfs_get_u32(sysfs, "gt_min_freq_mhz");
+ max = igt_sysfs_get_u32(sysfs, "gt_max_freq_mhz");
}
for (r = rps; r->suffix; r++) {
- igt_fixture r->func();
+ igt_fixture r->func(sysfs);
igt_subtest_f("cold%s", r->suffix)
- run(OBJECT_SIZE, false);
+ run(fd, OBJECT_SIZE, false);
igt_subtest_f("normal%s", r->suffix)
- run(OBJECT_SIZE, false);
+ run(fd, OBJECT_SIZE, false);
igt_subtest_f("dumb-buf%s", r->suffix)
- run(OBJECT_SIZE, true);
+ run(fd, OBJECT_SIZE, true);
}
igt_fixture {
if (min > 0)
- sysfs_write("gt_min_freq_mhz", min);
+ igt_sysfs_set_u32(sysfs, "gt_min_freq_mhz", min);
if (max > 0)
- sysfs_write("gt_max_freq_mhz", max);
+ igt_sysfs_set_u32(sysfs, "gt_max_freq_mhz", max);
+
+ close(sysfs);
+ close(fd);
}
igt_exit();
--
2.20.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 14+ messages in thread* [igt-dev] [CI 2/8] tests/perf: Simplify generic read/write, use sysfs helpers 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski @ 2019-03-14 12:50 ` Michał Winiarski 2019-03-18 10:49 ` Chris Wilson 2019-03-18 10:52 ` Chris Wilson 2019-03-14 12:50 ` [igt-dev] [CI 3/8] tests/i915_pm_rps: Use " Michał Winiarski ` (9 subsequent siblings) 10 siblings, 2 replies; 14+ messages in thread From: Michał Winiarski @ 2019-03-14 12:50 UTC (permalink / raw) To: igt-dev Doing this lets us avoid drm_get_card, which we plan to remove eventually. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> --- tests/perf.c | 82 +++++++++++++++++++--------------------------------- 1 file changed, 30 insertions(+), 52 deletions(-) diff --git a/tests/perf.c b/tests/perf.c index 220c52ef..ecbadfcd 100644 --- a/tests/perf.c +++ b/tests/perf.c @@ -185,7 +185,6 @@ static int sysfs = -1; static int pm_fd = -1; static int stream_fd = -1; static uint32_t devid; -static int card = -1; static int n_eus; static uint64_t test_metric_set_id = UINT64_MAX; @@ -259,63 +258,47 @@ lookup_format(int i915_perf_fmt_id) return i915_perf_fmt_id; } -static bool -try_read_u64_file(const char *file, uint64_t *val) -{ - char buf[32]; - int fd, n; - - fd = open(file, O_RDONLY); - if (fd < 0) - return false; - - while ((n = read(fd, buf, sizeof(buf) - 1)) < 0 && errno == EINTR) - ; - igt_assert(n >= 0); - - close(fd); - - buf[n] = '\0'; - *val = strtoull(buf, NULL, 0); - - return true; -} - static uint64_t -read_u64_file(const char *file) +read_u64_file(const char *path) { + FILE *f; uint64_t val; - igt_assert_eq(try_read_u64_file(file, &val), true); + f = fopen(path, "r"); + igt_assert(f); + + igt_assert_eq(fscanf(f, "%"PRIu64, &val), 1); + + fclose(f); return val; } static void -write_u64_file(const char *file, uint64_t val) +write_u64_file(const char *path, uint64_t val) { - char buf[32]; - int fd, len, ret; + FILE *f; - fd = open(file, O_WRONLY); - igt_assert(fd >= 0); + f = fopen(path, "r"); + igt_assert(f); - len = snprintf(buf, sizeof(buf), "%"PRIu64, val); - igt_assert(len > 0); + igt_assert(fprintf(f, "%"PRIu64, val) > 0); - while ((ret = write(fd, buf, len)) < 0 && errno == EINTR) - ; - igt_assert_eq(ret, len); + fclose(f); +} - close(fd); +static bool +try_sysfs_read_u64(const char *path, uint64_t *val) +{ + return igt_sysfs_scanf(sysfs, path, "%"PRIu64, val) == 1; } static unsigned long -sysfs_read(const char *file) +sysfs_read(const char *path) { unsigned long value; - igt_assert(igt_sysfs_scanf(sysfs, file, "%lu", &value) == 1); + igt_assert(igt_sysfs_scanf(sysfs, path, "%lu", &value) == 1); return value; } @@ -876,7 +859,6 @@ init_sys_info(void) const char *test_set_uuid = NULL; char buf[256]; - igt_assert_neq(card, -1); igt_assert_neq(devid, 0); timestamp_frequency = get_cs_timestamp_frequency(); @@ -979,12 +961,9 @@ init_sys_info(void) oa_exp_1_millisec = max_oa_exponent_for_period_lte(1000000); - snprintf(buf, sizeof(buf), - "/sys/class/drm/card%d/metrics/%s/id", - card, - test_set_uuid); + snprintf(buf, sizeof(buf), "metrics/%s/id", test_set_uuid); - return try_read_u64_file(buf, &test_metric_set_id); + return try_sysfs_read_u64(buf, &test_metric_set_id); } static int @@ -3739,10 +3718,10 @@ test_invalid_remove_userspace_config(void) igt_require(has_i915_perf_userspace_config(drm_fd)); - snprintf(path, sizeof(path), "/sys/class/drm/card%d/metrics/%s/id", card, uuid); + snprintf(path, sizeof(path), "metrics/%s/id", uuid); /* Destroy previous configuration if present */ - if (try_read_u64_file(path, &config_id)) + if (try_sysfs_read_u64(path, &config_id)) i915_perf_remove_config(drm_fd, config_id); memset(&config, 0, sizeof(config)); @@ -3799,10 +3778,10 @@ test_create_destroy_userspace_config(void) igt_require(has_i915_perf_userspace_config(drm_fd)); - snprintf(path, sizeof(path), "/sys/class/drm/card%d/metrics/%s/id", card, uuid); + snprintf(path, sizeof(path), "metrics/%s/id", uuid); /* Destroy previous configuration if present */ - if (try_read_u64_file(path, &config_id)) + if (try_sysfs_read_u64(path, &config_id)) i915_perf_remove_config(drm_fd, config_id); memset(&config, 0, sizeof(config)); @@ -3881,9 +3860,9 @@ test_whitelisted_registers_userspace_config(void) igt_require(has_i915_perf_userspace_config(drm_fd)); - snprintf(path, sizeof(path), "/sys/class/drm/card%d/metrics/%s/id", card, uuid); + snprintf(path, sizeof(path), "metrics/%s/id", uuid); - if (try_read_u64_file(path, &config_id)) + if (try_sysfs_read_u64(path, &config_id)) i915_perf_remove_config(drm_fd, config_id); memset(&config, 0, sizeof(config)); @@ -4034,7 +4013,6 @@ test_i915_ref_count(void) drm_fd = __drm_open_driver(DRIVER_INTEL); devid = intel_get_drm_devid(drm_fd); - card = drm_get_card(); /* Note: these global variables are only initialized after calling * init_sys_info()... @@ -4111,7 +4089,7 @@ igt_main igt_require_gem(drm_fd); devid = intel_get_drm_devid(drm_fd); - sysfs = igt_sysfs_open(drm_fd, &card); + sysfs = igt_sysfs_open(drm_fd, NULL); igt_require(init_sys_info()); -- 2.20.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [igt-dev] [CI 2/8] tests/perf: Simplify generic read/write, use sysfs helpers 2019-03-14 12:50 ` [igt-dev] [CI 2/8] tests/perf: Simplify generic read/write, use sysfs helpers Michał Winiarski @ 2019-03-18 10:49 ` Chris Wilson 2019-03-18 10:52 ` Chris Wilson 1 sibling, 0 replies; 14+ messages in thread From: Chris Wilson @ 2019-03-18 10:49 UTC (permalink / raw) To: Michał Winiarski, igt-dev Quoting Michał Winiarski (2019-03-14 12:50:44) > static void > -write_u64_file(const char *file, uint64_t val) > +write_u64_file(const char *path, uint64_t val) > { > - char buf[32]; > - int fd, len, ret; > + FILE *f; > > - fd = open(file, O_WRONLY); > - igt_assert(fd >= 0); > + f = fopen(path, "r"); "w"! -Chris _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] [CI 2/8] tests/perf: Simplify generic read/write, use sysfs helpers 2019-03-14 12:50 ` [igt-dev] [CI 2/8] tests/perf: Simplify generic read/write, use sysfs helpers Michał Winiarski 2019-03-18 10:49 ` Chris Wilson @ 2019-03-18 10:52 ` Chris Wilson 1 sibling, 0 replies; 14+ messages in thread From: Chris Wilson @ 2019-03-18 10:52 UTC (permalink / raw) To: Michał Winiarski, igt-dev Quoting Michał Winiarski (2019-03-14 12:50:44) > static void > -write_u64_file(const char *file, uint64_t val) > +write_u64_file(const char *path, uint64_t val) Alternatively: dir = open("/proc/sys/dev/i915/", O_RDONLY); igt_sysfs_write(""perf_stream_paranoid", "%"PRIu64, 0); etc. (Does it even need a u64 write...? nah) -Chris _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] [CI 3/8] tests/i915_pm_rps: Use sysfs helpers 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 2/8] tests/perf: Simplify generic read/write, use sysfs helpers Michał Winiarski @ 2019-03-14 12:50 ` Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 4/8] lib/igt_device: Introduce igt_device_get_card_index Michał Winiarski ` (8 subsequent siblings) 10 siblings, 0 replies; 14+ messages in thread From: Michał Winiarski @ 2019-03-14 12:50 UTC (permalink / raw) To: igt-dev Doing this lets us avoid drm_get_card, which we plan to remove eventually. v2: We were extermally unlikely to find rps knobs in current dir. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> --- tests/i915/i915_pm_rps.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c index d20cd2d8..ed146045 100644 --- a/tests/i915/i915_pm_rps.c +++ b/tests/i915/i915_pm_rps.c @@ -38,12 +38,12 @@ #include "igt.h" #include "igt_dummyload.h" +#include "igt_sysfs.h" IGT_TEST_DESCRIPTION("Render P-States tests - verify GPU frequency changes"); static int drm_fd; -static const char sysfs_base_path[] = "/sys/class/drm/card%d/gt_%s_freq_mhz"; enum { CUR, MIN, @@ -629,20 +629,23 @@ igt_main igt_skip_on_simulation(); igt_fixture { - const int device = drm_get_card(); struct sysfs_file *sysfs_file = sysfs_files; + char sysfs_path[80]; int ret; /* Use drm_open_driver to verify device existence */ drm_fd = drm_open_driver(DRIVER_INTEL); igt_require_gem(drm_fd); igt_require(gem_can_store_dword(drm_fd, 0)); + igt_assert(igt_sysfs_path(drm_fd, sysfs_path, + sizeof(sysfs_path), NULL)); do { int val = -1; char *path; - ret = asprintf(&path, sysfs_base_path, device, sysfs_file->name); + ret = asprintf(&path, "%s/gt_%s_freq_mhz", + sysfs_path, sysfs_file->name); igt_assert(ret != -1); sysfs_file->filp = fopen(path, sysfs_file->mode); igt_require(sysfs_file->filp); -- 2.20.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] [CI 4/8] lib/igt_device: Introduce igt_device_get_card_index 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 2/8] tests/perf: Simplify generic read/write, use sysfs helpers Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 3/8] tests/i915_pm_rps: Use " Michał Winiarski @ 2019-03-14 12:50 ` Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 5/8] lib: Kill drm_get_card() Michał Winiarski ` (7 subsequent siblings) 10 siblings, 0 replies; 14+ messages in thread From: Michał Winiarski @ 2019-03-14 12:50 UTC (permalink / raw) To: igt-dev And use it! But let's start small. Rather than going with "and by the way, here's the card index" from igt_sysfs_path, we're making things more explicit. v2: Drop idx comment. (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> --- lib/igt_device.c | 19 +++++++++++++++++++ lib/igt_device.h | 2 ++ lib/igt_sysfs.c | 12 +++++++----- lib/igt_sysfs.h | 2 +- tests/i915/i915_pm_rpm.c | 2 +- tests/i915/i915_pm_rps.c | 2 +- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/lib/igt_device.c b/lib/igt_device.c index 5b3722c8..08f39c8b 100644 --- a/lib/igt_device.c +++ b/lib/igt_device.c @@ -22,6 +22,8 @@ * */ +#include <sys/stat.h> +#include <sys/sysmacros.h> #include "igt.h" #include "igt_device.h" @@ -84,3 +86,20 @@ void igt_device_drop_master(int fd) "Failed to drop DRM master.\n"); } } + +/** + * igt_device_get_card_index: + * @fd: the device + * + * Returns: + * Index (N) of /dev/dri/cardN or /dev/dri/renderDN corresponding with fd. + * + */ +int igt_device_get_card_index(int fd) +{ + struct stat st; + + igt_fail_on(fstat(fd, &st) || !S_ISCHR(st.st_mode)); + + return minor(st.st_rdev); +} diff --git a/lib/igt_device.h b/lib/igt_device.h index 2995f969..9d7dc2c3 100644 --- a/lib/igt_device.h +++ b/lib/igt_device.h @@ -31,4 +31,6 @@ void igt_device_set_master(int fd); int __igt_device_drop_master(int fd); void igt_device_drop_master(int fd); +int igt_device_get_card_index(int fd); + #endif /* __IGT_DEVICE_H__ */ diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c index c57e4ae2..5a25d579 100644 --- a/lib/igt_sysfs.c +++ b/lib/igt_sysfs.c @@ -41,6 +41,7 @@ #include "igt_core.h" #include "igt_sysfs.h" +#include "igt_device.h" /** * SECTION:igt_sysfs @@ -89,14 +90,13 @@ static int writeN(int fd, const char *buf, int len) * @device: fd of the device * @path: buffer to fill with the sysfs path to the device * @pathlen: length of @path buffer - * @idx: optional pointer to store the card index of the opened device * * This finds the sysfs directory corresponding to @device. * * Returns: * The directory path, or NULL on failure. */ -char *igt_sysfs_path(int device, char *path, int pathlen, int *idx) +char *igt_sysfs_path(int device, char *path, int pathlen) { struct stat st; @@ -125,8 +125,7 @@ char *igt_sysfs_path(int device, char *path, int pathlen, int *idx) continue; path[len] = '\0'; - if (idx) - *idx = n; + return path; } @@ -148,9 +147,12 @@ int igt_sysfs_open(int device, int *idx) { char path[80]; - if (!igt_sysfs_path(device, path, sizeof(path), idx)) + if (!igt_sysfs_path(device, path, sizeof(path))) return -1; + if (idx) + *idx = igt_device_get_card_index(device); + return open(path, O_RDONLY); } diff --git a/lib/igt_sysfs.h b/lib/igt_sysfs.h index 2ce5b7bd..b181a95f 100644 --- a/lib/igt_sysfs.h +++ b/lib/igt_sysfs.h @@ -28,7 +28,7 @@ #include <stdbool.h> #include <stdarg.h> -char *igt_sysfs_path(int device, char *path, int pathlen, int *idx); +char *igt_sysfs_path(int device, char *path, int pathlen); int igt_sysfs_open(int device, int *idx); int igt_sysfs_open_parameters(int device); bool igt_sysfs_set_parameter(int device, diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c index 759c76ea..03de609c 100644 --- a/tests/i915/i915_pm_rpm.c +++ b/tests/i915/i915_pm_rpm.c @@ -962,7 +962,7 @@ static void sysfs_read_subtest(void) { char path[80]; - igt_require_f(igt_sysfs_path(drm_fd, path, sizeof(path), NULL), + igt_require_f(igt_sysfs_path(drm_fd, path, sizeof(path)), "Can't find the sysfs directory\n"); walk_fs(path); } diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c index ed146045..91f46f10 100644 --- a/tests/i915/i915_pm_rps.c +++ b/tests/i915/i915_pm_rps.c @@ -638,7 +638,7 @@ igt_main igt_require_gem(drm_fd); igt_require(gem_can_store_dword(drm_fd, 0)); igt_assert(igt_sysfs_path(drm_fd, sysfs_path, - sizeof(sysfs_path), NULL)); + sizeof(sysfs_path))); do { int val = -1; -- 2.20.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] [CI 5/8] lib: Kill drm_get_card() 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski ` (2 preceding siblings ...) 2019-03-14 12:50 ` [igt-dev] [CI 4/8] lib/igt_device: Introduce igt_device_get_card_index Michał Winiarski @ 2019-03-14 12:50 ` Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 6/8] lib/igt_sysfs: Remove idx from sysfs_open Michał Winiarski ` (6 subsequent siblings) 10 siblings, 0 replies; 14+ messages in thread From: Michał Winiarski @ 2019-03-14 12:50 UTC (permalink / raw) To: igt-dev It's not operating on FD, and we've provided a nice reimplementation that does. Let's use it instead. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> --- lib/drmtest.c | 40 ------------------------------------- lib/drmtest.h | 1 - tests/i915/i915_suspend.c | 17 ++++++++-------- tools/intel_gpu_frequency.c | 9 ++++++--- 4 files changed, 15 insertions(+), 52 deletions(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index 6506791b..25eeab88 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -177,46 +177,6 @@ void gem_quiescent_gpu(int fd) DROP_ACTIVE | DROP_RETIRE | DROP_IDLE | DROP_FREED); } -/** - * drm_get_card: - * - * Get an i915 drm card index number for use in /dev or /sys. The minor index of - * the legacy node is returned, not of the control or render node. - * - * Returns: - * The i915 drm index or -1 on error - */ -int drm_get_card(void) -{ - char *name; - int i, fd; - - for (i = 0; i < 16; i++) { - int ret; - - ret = asprintf(&name, "/dev/dri/card%u", i); - igt_assert(ret != -1); - - fd = open(name, O_RDWR); - free(name); - - if (fd == -1) - continue; - - if (!is_i915_device(fd) || !has_known_intel_chipset(fd)) { - close(fd); - continue; - } - - close(fd); - return i; - } - - igt_skip("No intel gpu found\n"); - - return -1; -} - static int modprobe(const char *driver) { return igt_kmod_load(driver, ""); diff --git a/lib/drmtest.h b/lib/drmtest.h index ca347a71..f4401ac9 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -71,7 +71,6 @@ void __set_forced_driver(const char *name); */ #define ALIGN(v, a) (((v) + (a)-1) & ~((a)-1)) -int drm_get_card(void); int drm_open_driver(int chipset); int drm_open_driver_master(int chipset); int drm_open_driver_render(int chipset); diff --git a/tests/i915/i915_suspend.c b/tests/i915/i915_suspend.c index cd7cf967..0d49fdcb 100644 --- a/tests/i915/i915_suspend.c +++ b/tests/i915/i915_suspend.c @@ -39,6 +39,7 @@ #include <drm.h> +#include "igt_device.h" #define OBJECT_SIZE (16*1024*1024) @@ -101,7 +102,7 @@ test_fence_restore(int fd, bool tiled2untiled, bool hibernate) } static void -test_debugfs_reader(bool hibernate) +test_debugfs_reader(int fd, bool hibernate) { struct igt_helper_process reader = {}; reader.use_SIGKILL = true; @@ -112,7 +113,7 @@ test_debugfs_reader(bool hibernate) snprintf(tmp, sizeof(tmp) - 1, "while true; do find %s/%i/ -type f ! -path \"*/crc/*\" | xargs cat > /dev/null 2>&1; done", - dfs_base, drm_get_card()); + dfs_base, igt_device_get_card_index(fd)); igt_assert(execl("/bin/sh", "sh", "-c", tmp, (char *) NULL) != -1); } @@ -131,7 +132,7 @@ test_debugfs_reader(bool hibernate) } static void -test_sysfs_reader(bool hibernate) +test_sysfs_reader(int fd, bool hibernate) { struct igt_helper_process reader = {}; reader.use_SIGKILL = true; @@ -142,7 +143,7 @@ test_sysfs_reader(bool hibernate) snprintf(tmp, sizeof(tmp) - 1, "while true; do find %s%i*/ -type f | xargs cat > /dev/null 2>&1; done", - dfs_base, drm_get_card()); + dfs_base, igt_device_get_card_index(fd)); igt_assert(execl("/bin/sh", "sh", "-c", tmp, (char *) NULL) != -1); } @@ -212,10 +213,10 @@ igt_main test_fence_restore(fd, false, false); igt_subtest("debugfs-reader") - test_debugfs_reader(false); + test_debugfs_reader(fd, false); igt_subtest("sysfs-reader") - test_sysfs_reader(false); + test_sysfs_reader(fd, false); igt_subtest("shrink") test_shrink(fd, SUSPEND_STATE_MEM); @@ -230,10 +231,10 @@ igt_main test_fence_restore(fd, false, true); igt_subtest("debugfs-reader-hibernate") - test_debugfs_reader(true); + test_debugfs_reader(fd, true); igt_subtest("sysfs-reader-hibernate") - test_sysfs_reader(true); + test_sysfs_reader(fd, true); igt_subtest("forcewake-hibernate") test_forcewake(fd, true); diff --git a/tools/intel_gpu_frequency.c b/tools/intel_gpu_frequency.c index 80786ad9..52b11a98 100644 --- a/tools/intel_gpu_frequency.c +++ b/tools/intel_gpu_frequency.c @@ -28,6 +28,7 @@ #include <unistd.h> #include "drmtest.h" +#include "igt_device.h" #include "intel_chipset.h" #define VERSION "1.0" @@ -280,10 +281,12 @@ int main(int argc, char *argv[]) { bool write, fail, targets[MAX+1] = {false}; - int i, try = 1, set_freq[MAX+1] = {0}; + int i, fd, try = 1, set_freq[MAX+1] = {0}; - devid = intel_get_drm_devid(drm_open_driver(DRIVER_INTEL)); - device = drm_get_card(); + fd = drm_open_driver(DRIVER_INTEL); + devid = intel_get_drm_devid(fd); + device = igt_device_get_card_index(fd); + close(fd); write = parse(argc, argv, targets, ARRAY_SIZE(targets), set_freq); fail = write; -- 2.20.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] [CI 6/8] lib/igt_sysfs: Remove idx from sysfs_open 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski ` (3 preceding siblings ...) 2019-03-14 12:50 ` [igt-dev] [CI 5/8] lib: Kill drm_get_card() Michał Winiarski @ 2019-03-14 12:50 ` Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 7/8] lib/igt_sysfs: Simplify obtaining sysfs path Michał Winiarski ` (5 subsequent siblings) 10 siblings, 0 replies; 14+ messages in thread From: Michał Winiarski @ 2019-03-14 12:50 UTC (permalink / raw) To: igt-dev Similar to sysfs_path - more explicit more better. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> --- lib/igt_gt.c | 2 +- lib/igt_kms.c | 7 ++++++- lib/igt_sysfs.c | 8 ++------ lib/igt_sysfs.h | 2 +- tests/i915/gem_exec_blt.c | 2 +- tests/i915/gem_exec_capture.c | 2 +- tests/i915/i915_hangman.c | 4 +--- tests/i915/i915_pm_rc6_residency.c | 2 +- tests/perf.c | 2 +- tests/perf_pmu.c | 2 +- tests/vgem_basic.c | 2 +- tools/intel_l3_parity.c | 2 +- 12 files changed, 18 insertions(+), 19 deletions(-) diff --git a/lib/igt_gt.c b/lib/igt_gt.c index c98a7553..59995243 100644 --- a/lib/igt_gt.c +++ b/lib/igt_gt.c @@ -76,7 +76,7 @@ static void eat_error_state(int dev) { int dir; - dir = igt_sysfs_open(dev, NULL); + dir = igt_sysfs_open(dev); if (dir < 0) return; diff --git a/lib/igt_kms.c b/lib/igt_kms.c index e1eacc1e..8656ea11 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -52,6 +52,7 @@ #include "igt_aux.h" #include "intel_chipset.h" #include "igt_debugfs.h" +#include "igt_device.h" #include "igt_sysfs.h" #include "sw_sync.h" @@ -806,10 +807,14 @@ bool kmstest_force_connector(int drm_fd, drmModeConnector *connector, break; } - dir = igt_sysfs_open(drm_fd, &idx); + dir = igt_sysfs_open(drm_fd); if (dir < 0) return false; + idx = igt_device_get_card_index(drm_fd); + if (idx < 0 || idx > 63) + return false; + if (asprintf(&path, "card%d-%s-%d/status", idx, kmstest_connector_type_str(connector->connector_type), diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c index 5a25d579..aa880775 100644 --- a/lib/igt_sysfs.c +++ b/lib/igt_sysfs.c @@ -135,7 +135,6 @@ char *igt_sysfs_path(int device, char *path, int pathlen) /** * igt_sysfs_open: * @device: fd of the device - * @idx: optional pointer to store the card index of the opened device * * This opens the sysfs directory corresponding to device for use * with igt_sysfs_set() and igt_sysfs_get(). @@ -143,16 +142,13 @@ char *igt_sysfs_path(int device, char *path, int pathlen) * Returns: * The directory fd, or -1 on failure. */ -int igt_sysfs_open(int device, int *idx) +int igt_sysfs_open(int device) { char path[80]; if (!igt_sysfs_path(device, path, sizeof(path))) return -1; - if (idx) - *idx = igt_device_get_card_index(device); - return open(path, O_RDONLY); } @@ -199,7 +195,7 @@ int igt_sysfs_open_parameters(int device) { int dir, params = -1; - dir = igt_sysfs_open(device, ¶ms); + dir = igt_sysfs_open(device); if (dir >= 0) { params = openat(dir, "device/driver/module/parameters", diff --git a/lib/igt_sysfs.h b/lib/igt_sysfs.h index b181a95f..c12e36d1 100644 --- a/lib/igt_sysfs.h +++ b/lib/igt_sysfs.h @@ -29,7 +29,7 @@ #include <stdarg.h> char *igt_sysfs_path(int device, char *path, int pathlen); -int igt_sysfs_open(int device, int *idx); +int igt_sysfs_open(int device); int igt_sysfs_open_parameters(int device); bool igt_sysfs_set_parameter(int device, const char *parameter, diff --git a/tests/i915/gem_exec_blt.c b/tests/i915/gem_exec_blt.c index 0fcfdd4b..00926e55 100644 --- a/tests/i915/gem_exec_blt.c +++ b/tests/i915/gem_exec_blt.c @@ -315,7 +315,7 @@ int main(int argc, char **argv) fd = drm_open_driver(DRIVER_INTEL); igt_require_gem(fd); - sysfs = igt_sysfs_open(fd, NULL); + sysfs = igt_sysfs_open(fd); igt_require(sysfs >= 0); min = igt_sysfs_get_u32(sysfs, "gt_min_freq_mhz"); diff --git a/tests/i915/gem_exec_capture.c b/tests/i915/gem_exec_capture.c index 56837dfc..4457496d 100644 --- a/tests/i915/gem_exec_capture.c +++ b/tests/i915/gem_exec_capture.c @@ -547,7 +547,7 @@ igt_main igt_require(has_capture(fd)); igt_allow_hang(fd, 0, HANG_ALLOW_CAPTURE); - dir = igt_sysfs_open(fd, NULL); + dir = igt_sysfs_open(fd); igt_require(igt_sysfs_set(dir, "error", "Begone!")); igt_require(safer_strlen(igt_sysfs_get(dir, "error")) > 0); } diff --git a/tests/i915/i915_hangman.c b/tests/i915/i915_hangman.c index 4e515e3a..9a1d5889 100644 --- a/tests/i915/i915_hangman.c +++ b/tests/i915/i915_hangman.c @@ -262,14 +262,12 @@ igt_main igt_skip_on_simulation(); igt_fixture { - int idx; - device = drm_open_driver(DRIVER_INTEL); igt_require_gem(device); hang = igt_allow_hang(device, 0, HANG_ALLOW_CAPTURE); - sysfs = igt_sysfs_open(device, &idx); + sysfs = igt_sysfs_open(device); igt_assert(sysfs != -1); igt_require(has_error_state(sysfs)); diff --git a/tests/i915/i915_pm_rc6_residency.c b/tests/i915/i915_pm_rc6_residency.c index abc30ac6..1b52e4f5 100644 --- a/tests/i915/i915_pm_rc6_residency.c +++ b/tests/i915/i915_pm_rc6_residency.c @@ -208,7 +208,7 @@ igt_main fd = drm_open_driver(DRIVER_INTEL); devid = intel_get_drm_devid(fd); - sysfs = igt_sysfs_open(fd, NULL); + sysfs = igt_sysfs_open(fd); igt_require(has_rc6_residency("rc6")); diff --git a/tests/perf.c b/tests/perf.c index ecbadfcd..37c16cca 100644 --- a/tests/perf.c +++ b/tests/perf.c @@ -4089,7 +4089,7 @@ igt_main igt_require_gem(drm_fd); devid = intel_get_drm_devid(drm_fd); - sysfs = igt_sysfs_open(drm_fd, NULL); + sysfs = igt_sysfs_open(drm_fd); igt_require(init_sys_info()); diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c index aa5b9921..1a08f564 100644 --- a/tests/perf_pmu.c +++ b/tests/perf_pmu.c @@ -1275,7 +1275,7 @@ test_frequency(int gem_fd) igt_spin_t *spin; int fd, sysfs; - sysfs = igt_sysfs_open(gem_fd, NULL); + sysfs = igt_sysfs_open(gem_fd); igt_require(sysfs >= 0); min_freq = igt_sysfs_get_u32(sysfs, "gt_RPn_freq_mhz"); diff --git a/tests/vgem_basic.c b/tests/vgem_basic.c index 1a952c54..526636dd 100644 --- a/tests/vgem_basic.c +++ b/tests/vgem_basic.c @@ -262,7 +262,7 @@ static void test_dmabuf_fence_before(int fd) static void test_sysfs_read(int fd) { - int dir = igt_sysfs_open(fd, NULL); + int dir = igt_sysfs_open(fd); DIR *dirp = fdopendir(dir); struct dirent *de; diff --git a/tools/intel_l3_parity.c b/tools/intel_l3_parity.c index d1a9bc44..d8c997af 100644 --- a/tools/intel_l3_parity.c +++ b/tools/intel_l3_parity.c @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) assert(intel_register_access_init(intel_get_pci_device(), 0, device) == 0); - dir = igt_sysfs_open(device, NULL); + dir = igt_sysfs_open(device); for_each_slice(i) { fd[i] = openat(dir, path[i], O_RDWR); -- 2.20.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] [CI 7/8] lib/igt_sysfs: Simplify obtaining sysfs path 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski ` (4 preceding siblings ...) 2019-03-14 12:50 ` [igt-dev] [CI 6/8] lib/igt_sysfs: Remove idx from sysfs_open Michał Winiarski @ 2019-03-14 12:50 ` Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 8/8] lib/igt_device: Move intel_get_pci_device under igt_device Michał Winiarski ` (4 subsequent siblings) 10 siblings, 0 replies; 14+ messages in thread From: Michał Winiarski @ 2019-03-14 12:50 UTC (permalink / raw) To: igt-dev Now that we've extracted card index, we no longer have the need to iterate over device nodes. v2: Drop ret. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> --- lib/igt_sysfs.c | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c index aa880775..f806f4fc 100644 --- a/lib/igt_sysfs.c +++ b/lib/igt_sysfs.c @@ -106,30 +106,13 @@ char *igt_sysfs_path(int device, char *path, int pathlen) if (fstat(device, &st) || !S_ISCHR(st.st_mode)) return NULL; - for (int n = 0; n < 16; n++) { - int len, ret, maj, min; - FILE *file; + snprintf(path, pathlen, "/sys/dev/char/%d:%d", + major(st.st_rdev), minor(st.st_rdev)); - len = snprintf(path, pathlen, "/sys/class/drm/card%d", n); - - sprintf(path + len, "/dev"); - file = fopen(path, "r"); - if (!file) - continue; - - ret = fscanf(file, "%d:%d", &maj, &min); - fclose(file); - - if (ret != 2 || major(st.st_rdev) != maj || - minor(st.st_rdev) != min) - continue; - - path[len] = '\0'; - - return path; - } + if (access(path, F_OK)) + return NULL; - return NULL; + return path; } /** -- 2.20.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] [CI 8/8] lib/igt_device: Move intel_get_pci_device under igt_device 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski ` (5 preceding siblings ...) 2019-03-14 12:50 ` [igt-dev] [CI 7/8] lib/igt_sysfs: Simplify obtaining sysfs path Michał Winiarski @ 2019-03-14 12:50 ` Michał Winiarski 2019-03-14 13:31 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Patchwork ` (3 subsequent siblings) 10 siblings, 0 replies; 14+ messages in thread From: Michał Winiarski @ 2019-03-14 12:50 UTC (permalink / raw) To: igt-dev It allows us to make things a little bit more generic. Also, we now require fd rather than doing guesswork when it comes to pci address. v2: Use readlinkat rather than string concat, move stuff around, provide a version that does not assert. (Chris) v3: Print addr on failure, avoid assignment in conditionals. (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> --- benchmarks/gem_latency.c | 4 +- benchmarks/gem_wsim.c | 4 +- debugger/debug_rdata.c | 7 +- debugger/eudb.c | 8 ++- lib/igt_device.c | 120 ++++++++++++++++++++++++++++++++ lib/igt_device.h | 1 + lib/intel_chipset.c | 51 -------------- lib/intel_chipset.h | 1 - lib/intel_mmio.c | 4 +- lib/ioctl_wrappers.c | 5 +- lib/ioctl_wrappers.h | 2 +- tests/i915/gem_concurrent_all.c | 12 ++-- tests/i915/gem_cpu_reloc.c | 4 +- tests/i915/gem_exec_latency.c | 3 +- tests/i915/gem_exec_parse.c | 4 +- tests/i915/gem_mmap.c | 4 +- tests/i915/gem_mmap_gtt.c | 10 +-- tests/i915/gem_pwrite.c | 4 +- tests/i915/gem_shrink.c | 2 +- tests/i915/i915_pm_lpsp.c | 3 +- tests/i915/i915_pm_rpm.c | 4 +- tests/kms_flip.c | 2 +- tests/prime_mmap.c | 4 +- tools/intel_audio_dump.c | 9 ++- tools/intel_backlight.c | 8 ++- tools/intel_display_poller.c | 8 ++- tools/intel_forcewaked.c | 10 ++- tools/intel_gpu_time.c | 8 ++- tools/intel_gtt.c | 8 ++- tools/intel_infoframes.c | 7 +- tools/intel_l3_parity.c | 3 +- tools/intel_lid.c | 9 ++- tools/intel_panel_fitter.c | 8 ++- tools/intel_perf_counters.c | 3 +- tools/intel_reg.c | 23 +++--- tools/intel_reg_checker.c | 8 ++- tools/intel_watermark.c | 23 +++--- 37 files changed, 267 insertions(+), 131 deletions(-) diff --git a/benchmarks/gem_latency.c b/benchmarks/gem_latency.c index c3fc4bf0..a20bbf8a 100644 --- a/benchmarks/gem_latency.c +++ b/benchmarks/gem_latency.c @@ -44,6 +44,8 @@ #include <sys/resource.h> #include "drm.h" +#include "igt_device.h" + #define LOCAL_I915_EXEC_FENCE_IN (1<<16) #define LOCAL_I915_EXEC_FENCE_OUT (1<<17) @@ -456,7 +458,7 @@ static int run(int seconds, if (gen < 6) return IGT_EXIT_SKIP; /* Needs BCS timestamp */ - intel_register_access_init(intel_get_pci_device(), false, fd); + intel_register_access_init(igt_device_get_pci_device(fd), false, fd); if (gen == 6) timestamp_reg = REG(RCS_TIMESTAMP); diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index afb9644d..21e26686 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -41,7 +41,6 @@ #include <limits.h> #include <pthread.h> - #include "intel_chipset.h" #include "intel_reg.h" #include "drm.h" @@ -50,6 +49,7 @@ #include "intel_io.h" #include "igt_aux.h" +#include "igt_device.h" #include "igt_rand.h" #include "igt_perf.h" #include "sw_sync.h" @@ -2223,7 +2223,7 @@ static void init_clocks(void) uint32_t rcs_start, rcs_end; double overhead, t; - intel_register_access_init(intel_get_pci_device(), false, fd); + intel_register_access_init(igt_device_get_pci_device(fd), false, fd); if (verbose <= 1) return; diff --git a/debugger/debug_rdata.c b/debugger/debug_rdata.c index 61d82d9e..fea95029 100644 --- a/debugger/debug_rdata.c +++ b/debugger/debug_rdata.c @@ -29,7 +29,6 @@ #include <stdio.h> #include <stdlib.h> #include "intel_io.h" -#include "intel_chipset.h" struct eu_rdata { union { @@ -133,7 +132,11 @@ find_stuck_threads(void) int main(int argc, char *argv[]) { struct pci_device *pci_dev; - pci_dev = intel_get_pci_device(); + int fd; + + fd = drm_open_driver(DRIVER_INTEL); + pci_dev = igt_device_get_pci_device(fd); + close(fd); intel_register_access_init(pci_dev, 1); find_stuck_threads(); diff --git a/debugger/eudb.c b/debugger/eudb.c index 866d4b52..b5784148 100644 --- a/debugger/eudb.c +++ b/debugger/eudb.c @@ -42,7 +42,6 @@ #include "drm.h" #include "i915_drm.h" #include "drmtest.h" -#include "intel_chipset.h" #include "intel_bufmgr.h" #include "intel_io.h" #include "intel_batchbuffer.h" @@ -506,7 +505,7 @@ int main(int argc, char* argv[]) { struct pci_device *pci_dev; volatile uint8_t *scratch = NULL; int bits[64]; - int devid = -1, opt; + int devid = -1, opt, fd; while ((opt = getopt(argc, argv, "cdr:pf?h")) != -1) { switch (opt) { @@ -533,7 +532,10 @@ int main(int argc, char* argv[]) { } } - pci_dev = intel_get_pci_device(); + fd = drm_open_driver(DRIVER_INTEL); + pci_dev = igt_device_get_pci_device(fd); + close(fd); + if (devid == -1) devid = pci_dev->device_id; if (identify_device(devid)) { diff --git a/lib/igt_device.c b/lib/igt_device.c index 08f39c8b..39c691d4 100644 --- a/lib/igt_device.c +++ b/lib/igt_device.c @@ -26,6 +26,7 @@ #include <sys/sysmacros.h> #include "igt.h" #include "igt_device.h" +#include "igt_sysfs.h" int __igt_device_set_master(int fd) { @@ -103,3 +104,122 @@ int igt_device_get_card_index(int fd) return minor(st.st_rdev); } + +#define IGT_DEV_PATH_LEN 80 + +static bool igt_device_is_pci(int fd) +{ + char path[IGT_DEV_PATH_LEN]; + char *subsystem; + int sysfs; + int len; + + sysfs = igt_sysfs_open(fd); + if (sysfs == -1) + return false; + + len = readlinkat(sysfs, "device/subsystem", path, sizeof(path) - 1); + if (len == -1) + return false; + path[len] = '\0'; + + subsystem = strrchr(path, '/'); + if (!subsystem) + return false; + + return strcmp(subsystem, "/pci") == 0; +} + +struct igt_pci_addr { + unsigned int domain; + unsigned int bus; + unsigned int device; + unsigned int function; +}; + +static int igt_device_get_pci_addr(int fd, struct igt_pci_addr *pci) +{ + char path[IGT_DEV_PATH_LEN]; + char *buf; + int sysfs; + int len; + + if (!igt_device_is_pci(fd)) + return -ENODEV; + + sysfs = igt_sysfs_open(fd); + if (sysfs == -1) + return -ENOENT; + + len = readlinkat(sysfs, "device", path, sizeof(path) - 1); + if (len == -1) + return -ENOENT; + path[len] = '\0'; + + buf = strrchr(path, '/'); + if (!buf) + return -ENOENT; + + if (sscanf(buf, "/%4x:%2x:%2x.%2x", + &pci->domain, &pci->bus, + &pci->device, &pci->function) != 4) { + igt_warn("Unable to extract PCI device address from '%s'\n", buf); + return -ENOENT; + } + + return 0; +} + +static struct pci_device *__igt_device_get_pci_device(int fd) +{ + struct igt_pci_addr pci_addr; + struct pci_device *pci_dev; + + if (igt_device_get_pci_addr(fd, &pci_addr)) { + igt_warn("Unable to find device PCI address\n"); + return NULL; + } + + if (pci_system_init()) { + igt_warn("Couldn't initialize PCI system\n"); + return NULL; + } + + pci_dev = pci_device_find_by_slot(pci_addr.domain, + pci_addr.bus, + pci_addr.device, + pci_addr.function); + if (!pci_dev) { + igt_warn("Couldn't find PCI device %04x:%02x:%02x:%02x\n", + pci_addr.domain,pci_addr.bus, + pci_addr.device, pci_addr.function); + return NULL; + } + + if (pci_device_probe(pci_dev)) { + igt_warn("Couldn't probe PCI device\n"); + return NULL; + } + + return pci_dev; +} + +/** + * igt_device_get_pci_device: + * + * @fd: the device + * + * Looks up the main graphics pci device using libpciaccess. + * + * Returns: + * The pci_device, skips the test on any failures. + */ +struct pci_device *igt_device_get_pci_device(int fd) +{ + struct pci_device *pci_dev; + + pci_dev = __igt_device_get_pci_device(fd); + igt_require(pci_dev); + + return pci_dev; +} diff --git a/lib/igt_device.h b/lib/igt_device.h index 9d7dc2c3..278ba7a9 100644 --- a/lib/igt_device.h +++ b/lib/igt_device.h @@ -32,5 +32,6 @@ int __igt_device_drop_master(int fd); void igt_device_drop_master(int fd); int igt_device_get_card_index(int fd); +struct pci_device *igt_device_get_pci_device(int fd); #endif /* __IGT_DEVICE_H__ */ diff --git a/lib/intel_chipset.c b/lib/intel_chipset.c index 4748a3fb..0577f77a 100644 --- a/lib/intel_chipset.c +++ b/lib/intel_chipset.c @@ -61,57 +61,6 @@ */ enum pch_type intel_pch; -/** - * intel_get_pci_device: - * - * Looks up the main graphics pci device using libpciaccess. - * - * Returns: - * The pci_device, exits the program on any failures. - */ -struct pci_device * -intel_get_pci_device(void) -{ - struct pci_device *pci_dev; - int error; - - error = pci_system_init(); - igt_fail_on_f(error != 0, - "Couldn't initialize PCI system\n"); - - /* Grab the graphics card. Try the canonical slot first, then - * walk the entire PCI bus for a matching device. */ - pci_dev = pci_device_find_by_slot(0, 0, 2, 0); - if (pci_dev == NULL || pci_dev->vendor_id != 0x8086) { - struct pci_device_iterator *iter; - struct pci_id_match match; - - match.vendor_id = 0x8086; /* Intel */ - match.device_id = PCI_MATCH_ANY; - match.subvendor_id = PCI_MATCH_ANY; - match.subdevice_id = PCI_MATCH_ANY; - - match.device_class = 0x3 << 16; - match.device_class_mask = 0xff << 16; - - match.match_data = 0; - - iter = pci_id_match_iterator_create(&match); - pci_dev = pci_device_next(iter); - pci_iterator_destroy(iter); - } - igt_require_f(pci_dev, "Couldn't find Intel graphics card\n"); - - error = pci_device_probe(pci_dev); - igt_fail_on_f(error != 0, - "Couldn't probe graphics card\n"); - - if (pci_dev->vendor_id != 0x8086) - errx(1, "Graphics card is non-intel"); - - return pci_dev; -} - /** * intel_get_drm_devid: * @fd: open i915 drm file descriptor diff --git a/lib/intel_chipset.h b/lib/intel_chipset.h index 40170b7b..dd31d3fb 100644 --- a/lib/intel_chipset.h +++ b/lib/intel_chipset.h @@ -31,7 +31,6 @@ #include <pciaccess.h> #include <stdbool.h> -struct pci_device *intel_get_pci_device(void); uint32_t intel_get_drm_devid(int fd); struct intel_device_info { diff --git a/lib/intel_mmio.c b/lib/intel_mmio.c index a5458aeb..f5e0be0c 100644 --- a/lib/intel_mmio.c +++ b/lib/intel_mmio.c @@ -112,7 +112,7 @@ intel_mmio_use_dump_file(char *file) * * Sets up #igt_global_mmio to point at the mmio bar. * - * @pci_dev can be obtained from intel_get_pci_device(). + * @pci_dev can be obtained from igt_device_get_pci_device(). */ void intel_mmio_use_pci_bar(struct pci_device *pci_dev) @@ -162,7 +162,7 @@ release_forcewake_lock(int fd) * * It also initializes #igt_global_mmio like intel_mmio_use_pci_bar(). * - * @pci_dev can be obtained from intel_get_pci_device(). + * @pci_dev can be obtained from igt_device_get_pci_device(). */ int intel_register_access_init(struct pci_device *pci_dev, int safe, int fd) diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 39920f87..a66eb4bc 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -53,6 +53,7 @@ #include "intel_chipset.h" #include "intel_io.h" #include "igt_debugfs.h" +#include "igt_device.h" #include "igt_sysfs.h" #include "config.h" @@ -1096,9 +1097,9 @@ uint64_t gem_aperture_size(int fd) * * Returns: The mappable gtt address space size. */ -uint64_t gem_mappable_aperture_size(void) +uint64_t gem_mappable_aperture_size(int fd) { - struct pci_device *pci_dev = intel_get_pci_device(); + struct pci_device *pci_dev = igt_device_get_pci_device(fd); int bar; if (intel_gen(pci_dev->device_id) < 3) diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h index f0be2608..ad93daff 100644 --- a/lib/ioctl_wrappers.h +++ b/lib/ioctl_wrappers.h @@ -136,7 +136,7 @@ uint64_t gem_total_stolen_size(int fd); uint64_t gem_available_aperture_size(int fd); uint64_t gem_aperture_size(int fd); uint64_t gem_global_aperture_size(int fd); -uint64_t gem_mappable_aperture_size(void); +uint64_t gem_mappable_aperture_size(int fd); bool gem_has_softpin(int fd); bool gem_has_exec_fence(int fd); diff --git a/tests/i915/gem_concurrent_all.c b/tests/i915/gem_concurrent_all.c index 6049372d..f719b0a1 100644 --- a/tests/i915/gem_concurrent_all.c +++ b/tests/i915/gem_concurrent_all.c @@ -1850,7 +1850,7 @@ igt_main c->name, s->name, "small"); igt_subtest_group { igt_fixture { - count = num_buffers(gem_mappable_aperture_size()/4, + count = num_buffers(gem_mappable_aperture_size(fd)/4, s, c, CHECK_RAM); } run_modes(name, c, modes, s, count); @@ -1861,7 +1861,7 @@ igt_main c->name, s->name, "thrash"); igt_subtest_group { igt_fixture { - count = num_buffers(gem_mappable_aperture_size(), + count = num_buffers(gem_mappable_aperture_size(fd), s, c, CHECK_RAM); } run_modes(name, c, modes, s, count); @@ -1893,7 +1893,7 @@ igt_main c->name, s->name, "shrink"); igt_subtest_group { igt_fixture { - count = num_buffers(gem_mappable_aperture_size(), + count = num_buffers(gem_mappable_aperture_size(fd), s, c, CHECK_RAM); igt_fork_shrink_helper(fd); @@ -1909,8 +1909,8 @@ igt_main c->name, s->name, "swap"); igt_subtest_group { igt_fixture { - if (intel_get_avail_ram_mb() > gem_mappable_aperture_size()/(1024*1024)) { - pin_sz = intel_get_avail_ram_mb() - gem_mappable_aperture_size()/(1024*1024); + if (intel_get_avail_ram_mb() > gem_mappable_aperture_size(fd)/(1024*1024)) { + pin_sz = intel_get_avail_ram_mb() - gem_mappable_aperture_size(fd)/(1024*1024); igt_debug("Pinning %lld MiB\n", (long long)pin_sz); pin_sz *= 1024 * 1024; @@ -1924,7 +1924,7 @@ igt_main igt_require(pinned); } - count = num_buffers(gem_mappable_aperture_size(), + count = num_buffers(gem_mappable_aperture_size(fd), s, c, CHECK_RAM | CHECK_SWAP); } run_modes(name, c, modes, s, count); diff --git a/tests/i915/gem_cpu_reloc.c b/tests/i915/gem_cpu_reloc.c index 47099862..17c2fe11 100644 --- a/tests/i915/gem_cpu_reloc.c +++ b/tests/i915/gem_cpu_reloc.c @@ -283,7 +283,7 @@ igt_main run_test(i915, 1); igt_subtest("full") { - uint64_t aper_size = gem_mappable_aperture_size(); + uint64_t aper_size = gem_mappable_aperture_size(i915); unsigned long count = aper_size / 4096 + 1; intel_require_memory(count, 4096, CHECK_RAM); @@ -292,7 +292,7 @@ igt_main } igt_subtest("forked") { - uint64_t aper_size = gem_mappable_aperture_size(); + uint64_t aper_size = gem_mappable_aperture_size(i915); unsigned long count = aper_size / 4096 + 1; int ncpus = sysconf(_SC_NPROCESSORS_ONLN); diff --git a/tests/i915/gem_exec_latency.c b/tests/i915/gem_exec_latency.c index 6dd191ec..f308e085 100644 --- a/tests/i915/gem_exec_latency.c +++ b/tests/i915/gem_exec_latency.c @@ -40,6 +40,7 @@ #include "drm.h" +#include "igt_device.h" #include "igt_sysfs.h" #include "igt_vgem.h" #include "igt_dummyload.h" @@ -679,7 +680,7 @@ igt_main if (ring_size > 1024) ring_size = 1024; - intel_register_access_init(intel_get_pci_device(), false, device); + intel_register_access_init(igt_device_get_pci_device(device), false, device); rcs_clock = clockrate(device, RCS_TIMESTAMP); igt_info("RCS timestamp clock: %.0fKHz, %.1fns\n", rcs_clock / 1e3, 1e9 / rcs_clock); diff --git a/tests/i915/gem_exec_parse.c b/tests/i915/gem_exec_parse.c index 62e8d0a5..d3b848e2 100644 --- a/tests/i915/gem_exec_parse.c +++ b/tests/i915/gem_exec_parse.c @@ -30,6 +30,8 @@ #include <drm.h> +#include "igt_device.h" + #ifndef I915_PARAM_CMD_PARSER_VERSION #define I915_PARAM_CMD_PARSER_VERSION 28 #endif @@ -530,7 +532,7 @@ igt_main #undef REG igt_fixture { - intel_register_access_init(intel_get_pci_device(), 0, fd); + intel_register_access_init(igt_device_get_pci_device(fd), 0, fd); } for (int i = 0; i < ARRAY_SIZE(lris); i++) { diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c index 0ed15878..4e30fec1 100644 --- a/tests/i915/gem_mmap.c +++ b/tests/i915/gem_mmap.c @@ -53,10 +53,10 @@ test_huge_bo(int huge) switch (huge) { case -1: - huge_object_size = gem_mappable_aperture_size() / 2; + huge_object_size = gem_mappable_aperture_size(fd) / 2; break; case 0: - huge_object_size = gem_mappable_aperture_size() + PAGE_SIZE; + huge_object_size = gem_mappable_aperture_size(fd) + PAGE_SIZE; break; case 1: huge_object_size = gem_aperture_size(fd) + PAGE_SIZE; diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c index f6fbbe19..60c19d61 100644 --- a/tests/i915/gem_mmap_gtt.c +++ b/tests/i915/gem_mmap_gtt.c @@ -527,7 +527,7 @@ test_huge_bo(int fd, int huge, int tiling) switch (huge) { case -1: - size = gem_mappable_aperture_size() / 2; + size = gem_mappable_aperture_size(fd) / 2; /* Power of two fence size, natural fence * alignment, and the guard page at the end @@ -542,7 +542,7 @@ test_huge_bo(int fd, int huge, int tiling) size /= 2; break; case 0: - size = gem_mappable_aperture_size() + PAGE_SIZE; + size = gem_mappable_aperture_size(fd) + PAGE_SIZE; break; default: size = gem_global_aperture_size(fd) + PAGE_SIZE; @@ -623,13 +623,13 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus) switch (huge) { case -2: - huge_object_size = gem_mappable_aperture_size() / 4; + huge_object_size = gem_mappable_aperture_size(fd) / 4; break; case -1: - huge_object_size = gem_mappable_aperture_size() / 2; + huge_object_size = gem_mappable_aperture_size(fd) / 2; break; case 0: - huge_object_size = gem_mappable_aperture_size() + PAGE_SIZE; + huge_object_size = gem_mappable_aperture_size(fd) + PAGE_SIZE; break; case 1: huge_object_size = gem_global_aperture_size(fd) + PAGE_SIZE; diff --git a/tests/i915/gem_pwrite.c b/tests/i915/gem_pwrite.c index 696bd316..5cae121a 100644 --- a/tests/i915/gem_pwrite.c +++ b/tests/i915/gem_pwrite.c @@ -89,7 +89,7 @@ static void test_big_cpu(int fd, int scale, unsigned flags) switch (scale) { case 0: - size = gem_mappable_aperture_size() + 4096; + size = gem_mappable_aperture_size(fd) + 4096; break; case 1: size = gem_global_aperture_size(fd) + 4096; @@ -151,7 +151,7 @@ static void test_big_gtt(int fd, int scale, unsigned flags) igt_require(gem_mmap__has_wc(fd)); switch (scale) { case 0: - size = gem_mappable_aperture_size() + 4096; + size = gem_mappable_aperture_size(fd) + 4096; break; case 1: size = gem_global_aperture_size(fd) + 4096; diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c index c8e05814..73b6be72 100644 --- a/tests/i915/gem_shrink.c +++ b/tests/i915/gem_shrink.c @@ -409,7 +409,7 @@ igt_main * we expect the shrinker to start purging objects, * and possibly fail. */ - alloc_size = gem_mappable_aperture_size() / 2; + alloc_size = gem_mappable_aperture_size(fd) / 2; num_processes = 1 + (mem_size / (alloc_size >> 20)); igt_info("Using %d processes and %'lluMiB per process\n", diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c index b319dbe9..4e7ce399 100644 --- a/tests/i915/i915_pm_lpsp.c +++ b/tests/i915/i915_pm_lpsp.c @@ -30,6 +30,7 @@ #include <fcntl.h> #include <unistd.h> +#include "igt_device.h" static bool supports_lpsp(uint32_t devid) { @@ -210,7 +211,7 @@ igt_main igt_require(supports_lpsp(devid)); - intel_register_access_init(intel_get_pci_device(), 0, drm_fd); + intel_register_access_init(igt_device_get_pci_device(drm_fd), 0, drm_fd); kmstest_set_vt_graphics_mode(); } diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c index 03de609c..18adaf6b 100644 --- a/tests/i915/i915_pm_rpm.c +++ b/tests/i915/i915_pm_rpm.c @@ -1368,7 +1368,7 @@ static void gem_evict_pwrite_subtest(void) unsigned int num_trash_bos, n; uint32_t buf; - num_trash_bos = gem_mappable_aperture_size() / (1024*1024) + 1; + num_trash_bos = gem_mappable_aperture_size(drm_fd) / (1024*1024) + 1; trash_bos = malloc(num_trash_bos * sizeof(*trash_bos)); igt_assert(trash_bos); @@ -1412,7 +1412,7 @@ static bool device_in_pci_d3(void) uint16_t val; int rc; - rc = pci_device_cfg_read_u16(intel_get_pci_device(), &val, 0xd4); + rc = pci_device_cfg_read_u16(igt_device_get_pci_device(drm_fd), &val, 0xd4); igt_assert_eq(rc, 0); igt_debug("%s: PCI D3 state=%d\n", __func__, val & 0x3); diff --git a/tests/kms_flip.c b/tests/kms_flip.c index dfa5a69e..6ece1e53 100755 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -1224,7 +1224,7 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs, /* 256 MB is usually the maximum mappable aperture, * (make it 4x times that to ensure failure) */ if (o->flags & TEST_BO_TOOBIG) { - bo_size = 4*gem_mappable_aperture_size(); + bo_size = 4*gem_mappable_aperture_size(drm_fd); igt_require(bo_size < gem_global_aperture_size(drm_fd)); } diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c index fc985784..06a66cab 100644 --- a/tests/prime_mmap.c +++ b/tests/prime_mmap.c @@ -447,8 +447,8 @@ test_aperture_limit(void) char *ptr1, *ptr2; uint32_t handle1, handle2; /* Two buffers the sum of which > mappable aperture */ - uint64_t size1 = (gem_mappable_aperture_size() * 7) / 8; - uint64_t size2 = (gem_mappable_aperture_size() * 3) / 8; + uint64_t size1 = (gem_mappable_aperture_size(fd) * 7) / 8; + uint64_t size2 = (gem_mappable_aperture_size(fd) * 3) / 8; handle1 = gem_create(fd, size1); fill_bo(handle1, BO_SIZE); diff --git a/tools/intel_audio_dump.c b/tools/intel_audio_dump.c index 90260a2f..350a21d9 100644 --- a/tools/intel_audio_dump.c +++ b/tools/intel_audio_dump.c @@ -32,6 +32,7 @@ #include <string.h> #include <err.h> #include <arpa/inet.h> +#include "igt_device.h" #include "intel_io.h" #include "intel_reg.h" #include "intel_chipset.h" @@ -2464,8 +2465,12 @@ static void dump_braswell(void) int main(int argc, char **argv) { struct pci_device *pci_dev; + int fd; + + fd = drm_open_driver(DRIVER_INTEL); + pci_dev = igt_device_get_pci_device(fd); + close(fd); - pci_dev = intel_get_pci_device(); devid = pci_dev->device_id; /* XXX not true when mapping! */ do_self_tests(); @@ -2493,5 +2498,7 @@ int main(int argc, char **argv) dump_eaglelake(); } + close(fd); + return 0; } diff --git a/tools/intel_backlight.c b/tools/intel_backlight.c index 067fd418..fc45d985 100644 --- a/tools/intel_backlight.c +++ b/tools/intel_backlight.c @@ -30,8 +30,9 @@ #include <stdio.h> #include <string.h> +#include "drmtest.h" +#include "igt_device.h" #include "intel_io.h" -#include "intel_chipset.h" #include "intel_reg.h" /* XXX PCH only today */ @@ -39,8 +40,11 @@ int main(int argc, char** argv) { uint32_t current, max; + int fd; - intel_mmio_use_pci_bar(intel_get_pci_device()); + fd = drm_open_driver(DRIVER_INTEL); + intel_mmio_use_pci_bar(igt_device_get_pci_device(fd)); + close(fd); current = INREG(BLC_PWM_CPU_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; max = INREG(BLC_PWM_PCH_CTL2) >> 16; diff --git a/tools/intel_display_poller.c b/tools/intel_display_poller.c index 51f5b9a5..293574f2 100644 --- a/tools/intel_display_poller.c +++ b/tools/intel_display_poller.c @@ -36,6 +36,7 @@ #include "intel_io.h" #include "intel_reg.h" #include "igt_debugfs.h" +#include "igt_device.h" #include "drmtest.h" #include "igt_aux.h" @@ -971,6 +972,7 @@ int main(int argc, char *argv[]) uint32_t a, b; enum test test = TEST_INVALID; const int count = ARRAY_SIZE(min)/2; + int fd; for (;;) { static const struct option long_options[] = { @@ -1046,7 +1048,8 @@ int main(int argc, char *argv[]) } } - devid = intel_get_pci_device()->device_id; + fd = drm_open_driver(DRIVER_INTEL); + devid = igt_device_get_pci_device(fd)->device_id; /* * check if the requires registers are @@ -1187,7 +1190,7 @@ int main(int argc, char *argv[]) break; } - intel_register_access_init(intel_get_pci_device(), 0, -1); + intel_register_access_init(igt_device_get_pci_device(fd), 0, -1); printf("%s?\n", test_name(test, pipe, bit, test_pixelcount)); @@ -1263,6 +1266,7 @@ int main(int argc, char *argv[]) } intel_register_access_fini(); + close(fd); if (quit) return 0; diff --git a/tools/intel_forcewaked.c b/tools/intel_forcewaked.c index 02fbf888..7d32337a 100644 --- a/tools/intel_forcewaked.c +++ b/tools/intel_forcewaked.c @@ -34,8 +34,8 @@ #include <stdlib.h> #include <syslog.h> #include <unistd.h> +#include "igt_device.h" #include "intel_io.h" -#include "intel_chipset.h" #include "drmtest.h" bool daemonized; @@ -65,6 +65,7 @@ is_alive(void) { int main(int argc, char *argv[]) { int ret; + int fd; if (argc > 2 || (argc == 2 && !strncmp(argv[1], "-h", 2))) { help(argv[1]); @@ -80,24 +81,27 @@ int main(int argc, char *argv[]) INFO_PRINT("started daemon"); } - ret = intel_register_access_init(intel_get_pci_device(), 1, -1); + fd = drm_open_driver(DRIVER_INTEL); + ret = intel_register_access_init(igt_device_get_pci_device(fd), 1, -1); if (ret) { INFO_PRINT("Couldn't init register access\n"); exit(1); } else { INFO_PRINT("Forcewake locked\n"); } + while(1) { if (!is_alive()) { INFO_PRINT("gpu reset? restarting daemon\n"); intel_register_access_fini(); - ret = intel_register_access_init(intel_get_pci_device(), 1, -1); + ret = intel_register_access_init(igt_device_get_pci_device(fd), 1, -1); if (ret) INFO_PRINT("Reg access init fail\n"); } sleep(1); } intel_register_access_fini(); + close(fd); INFO_PRINT("Forcewake unlock\n"); if (daemonized) { diff --git a/tools/intel_gpu_time.c b/tools/intel_gpu_time.c index 56d65fe0..0fc73f92 100644 --- a/tools/intel_gpu_time.c +++ b/tools/intel_gpu_time.c @@ -34,8 +34,9 @@ #include <sys/resource.h> #include <sys/wait.h> +#include "drmtest.h" +#include "igt_device.h" #include "intel_io.h" -#include "intel_chipset.h" #include "intel_reg.h" #define SAMPLES_PER_SEC 10000 @@ -66,8 +67,11 @@ int main(int argc, char **argv) struct timeval start, end; static struct rusage rusage; int status; + int fd; - intel_mmio_use_pci_bar(intel_get_pci_device()); + fd = drm_open_driver(DRIVER_INTEL); + intel_mmio_use_pci_bar(igt_device_get_pci_device(fd)); + close(fd); if (argc == 1) { fprintf(stderr, "usage: %s cmd [args...]\n", argv[0]); diff --git a/tools/intel_gtt.c b/tools/intel_gtt.c index 311694ba..5740e794 100644 --- a/tools/intel_gtt.c +++ b/tools/intel_gtt.c @@ -34,6 +34,8 @@ #include <pciaccess.h> #include <unistd.h> +#include "drmtest.h" +#include "igt_device.h" #include "intel_io.h" #include "intel_chipset.h" @@ -140,13 +142,17 @@ int main(int argc, char **argv) { struct pci_device *pci_dev; unsigned int start, gtt_size; + int fd; int flag[] = { PCI_DEV_MAP_FLAG_WRITE_COMBINE, PCI_DEV_MAP_FLAG_WRITABLE, 0 }, f; - pci_dev = intel_get_pci_device(); + fd = drm_open_driver(DRIVER_INTEL); + pci_dev = igt_device_get_pci_device(fd); + close(fd); + devid = pci_dev->device_id; if (IS_GEN2(devid)) { diff --git a/tools/intel_infoframes.c b/tools/intel_infoframes.c index 2ef5d4fd..9129572a 100644 --- a/tools/intel_infoframes.c +++ b/tools/intel_infoframes.c @@ -30,6 +30,7 @@ #include <stdlib.h> #include <string.h> #include <getopt.h> +#include "igt_device.h" #include "intel_io.h" #include "intel_chipset.h" #include "drmtest.h" @@ -1081,6 +1082,7 @@ printf("Options:\n" int main(int argc, char *argv[]) { int opt; + int fd; int ret = 0; Transcoder transcoder = TRANSC_INVALID; DipType dip = DIP_INVALID; @@ -1107,7 +1109,10 @@ int main(int argc, char *argv[]) printf("WARNING: This is just a debugging tool! Don't expect it to work" " perfectly: the Kernel might undo our changes.\n"); - pci_dev = intel_get_pci_device(); + fd = drm_open_driver(DRIVER_INTEL); + pci_dev = igt_device_get_pci_device(fd); + close(fd); + intel_register_access_init(pci_dev, 0, -1); intel_check_pch(); diff --git a/tools/intel_l3_parity.c b/tools/intel_l3_parity.c index d8c997af..e2e4503a 100644 --- a/tools/intel_l3_parity.c +++ b/tools/intel_l3_parity.c @@ -36,6 +36,7 @@ #include <getopt.h> #include "intel_chipset.h" #include "intel_io.h" +#include "igt_device.h" #include "igt_sysfs.h" #include "drmtest.h" #include "config.h" @@ -189,7 +190,7 @@ int main(int argc, char *argv[]) if (intel_gen(devid) < 7 || IS_VALLEYVIEW(devid)) exit(77); - assert(intel_register_access_init(intel_get_pci_device(), 0, device) == 0); + assert(intel_register_access_init(igt_device_get_pci_device(device), 0, device) == 0); dir = igt_sysfs_open(device); diff --git a/tools/intel_lid.c b/tools/intel_lid.c index 37c6ba5e..447790d9 100644 --- a/tools/intel_lid.c +++ b/tools/intel_lid.c @@ -37,9 +37,10 @@ #include <sys/stat.h> #include <sys/types.h> +#include "drmtest.h" +#include "igt_device.h" #include "intel_io.h" #include "intel_reg.h" -#include "intel_chipset.h" #define SWF14_LID_STATUS_CLOSED (1<<29) /* 0 here means open */ @@ -118,8 +119,11 @@ out: int main(int argc, char **argv) { int swf14, acpi_lid; + int fd; - intel_mmio_use_pci_bar(intel_get_pci_device()); + fd = drm_open_driver(DRIVER_INTEL); + intel_mmio_use_pci_bar(igt_device_get_pci_device(fd)); + close(fd); while (1) { swf14 = INREG(SWF14); @@ -142,5 +146,6 @@ int main(int argc, char **argv) } sleep(2); } + return 0; } diff --git a/tools/intel_panel_fitter.c b/tools/intel_panel_fitter.c index 137ef61a..06f4ac59 100644 --- a/tools/intel_panel_fitter.c +++ b/tools/intel_panel_fitter.c @@ -30,6 +30,7 @@ #include <unistd.h> #include <stdlib.h> #include <string.h> +#include "igt_device.h" #include "intel_io.h" #include "intel_chipset.h" #include "intel_reg.h" @@ -273,13 +274,17 @@ int main (int argc, char *argv[]) bool do_disable = false, do_dump = false, do_usage = false; struct pci_device *pci_dev; uint32_t devid; + int fd; printf("WARNING:\n" "This tool is a workaround for people that don't have a Kernel " "with overscan compensation properties: it is just a temporary " "solution that may or may not work. Use it at your own risk.\n"); - pci_dev = intel_get_pci_device(); + fd = drm_open_driver(DRIVER_INTEL); + pci_dev = igt_device_get_pci_device(fd); + close(fd); + intel_register_access_init(pci_dev, 0, -1); devid = pci_dev->device_id; @@ -343,5 +348,6 @@ int main (int argc, char *argv[]) out: intel_register_access_fini(); + return ret; } diff --git a/tools/intel_perf_counters.c b/tools/intel_perf_counters.c index 50c4bce6..105a0924 100644 --- a/tools/intel_perf_counters.c +++ b/tools/intel_perf_counters.c @@ -45,6 +45,7 @@ #include "drm.h" #include "i915_drm.h" #include "drmtest.h" +#include "igt_device.h" #include "intel_io.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" @@ -483,7 +484,7 @@ main(int argc, char **argv) if (oacontrol) { /* Forcewake */ - intel_register_access_init(intel_get_pci_device(), 0, fd); + intel_register_access_init(igt_device_get_pci_device(fd), 0, fd); /* Enable performance counters */ intel_register_write(OACONTROL, diff --git a/tools/intel_reg.c b/tools/intel_reg.c index 1247b70b..305323b6 100644 --- a/tools/intel_reg.c +++ b/tools/intel_reg.c @@ -33,9 +33,9 @@ #include <unistd.h> #include "igt.h" +#include "igt_device.h" #include "igt_gt.h" #include "intel_io.h" -#include "intel_chipset.h" #include "intel_reg_spec.h" @@ -274,15 +274,6 @@ static int register_srm(struct config *config, struct reg *reg, int fd, i; uint32_t val; - if (config->fd == -1) { - config->fd = __drm_open_driver(DRIVER_INTEL); - if (config->fd == -1) { - fprintf(stderr, "Error opening driver: %s", - strerror(errno)); - exit(EXIT_FAILURE); - } - } - fd = config->fd; engine = find_engine(reg->engine); if (engine == NULL) @@ -1015,6 +1006,13 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } + config.fd = __drm_open_driver(DRIVER_INTEL); + if (config.fd == -1) { + fprintf(stderr, "Error opening driver: %s", + strerror(errno)); + exit(EXIT_FAILURE); + } + if (config.mmiofile) { if (!config.devid) { fprintf(stderr, "--mmio requires --devid\n"); @@ -1026,7 +1024,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "--devid without --mmio\n"); return EXIT_FAILURE; } - config.pci_dev = intel_get_pci_device(); + config.pci_dev = igt_device_get_pci_device(config.fd); config.devid = config.pci_dev->device_id; } @@ -1050,8 +1048,7 @@ int main(int argc, char *argv[]) free(config.mmiofile); - if (config.fd >= 0) - close(config.fd); + close(config.fd); return ret; } diff --git a/tools/intel_reg_checker.c b/tools/intel_reg_checker.c index 6bde63ec..0ed26029 100644 --- a/tools/intel_reg_checker.c +++ b/tools/intel_reg_checker.c @@ -26,6 +26,8 @@ #include <err.h> #include <string.h> #include <stdbool.h> +#include "drmtest.h" +#include "igt_device.h" #include "intel_io.h" #include "intel_chipset.h" @@ -342,8 +344,12 @@ check_dpfc_control_sa(void) int main(int argc, char** argv) { struct pci_device *dev; + int fd; + + fd = drm_open_driver(DRIVER_INTEL); + dev = igt_device_get_pci_device(fd); + close(fd); - dev = intel_get_pci_device(); devid = dev->device_id; intel_mmio_use_pci_bar(dev); diff --git a/tools/intel_watermark.c b/tools/intel_watermark.c index e71c3d9c..2dc4307c 100644 --- a/tools/intel_watermark.c +++ b/tools/intel_watermark.c @@ -29,12 +29,14 @@ #include <stdbool.h> #include <err.h> #include <string.h> +#include "igt_device.h" #include "intel_io.h" #include "intel_chipset.h" #include "drmtest.h" static uint32_t display_base; static uint32_t devid; +static int fd; static uint32_t read_reg(uint32_t addr) { @@ -249,7 +251,7 @@ static void skl_wm_dump(void) uint32_t plane_ctl[num_pipes][max_planes]; uint32_t wm_linetime[num_pipes]; - intel_register_access_init(intel_get_pci_device(), 0, -1); + intel_register_access_init(igt_device_get_pci_device(fd), 0, -1); for (pipe = 0; pipe < num_pipes; pipe++) { int num_planes = skl_num_planes(devid, pipe); @@ -469,7 +471,7 @@ static void ilk_wm_dump(void) int num_pipes = intel_gen(devid) >= 7 ? 3 : 2; struct ilk_wm wm = {}; - intel_register_access_init(intel_get_pci_device(), 0, -1); + intel_register_access_init(igt_device_get_pci_device(fd), 0, -1); for (i = 0; i < num_pipes; i++) { dspcntr[i] = read_reg(0x70180 + i * 0x1000); @@ -619,7 +621,7 @@ static void vlv_wm_dump(void) uint32_t dsp_ss_pm, ddr_setup2; struct gmch_wm wms[MAX_PLANE] = {}; - intel_register_access_init(intel_get_pci_device(), 0, -1); + intel_register_access_init(igt_device_get_pci_device(fd), 0, -1); dsparb = read_reg(0x70030); dsparb2 = read_reg(0x70060); @@ -835,7 +837,7 @@ static void g4x_wm_dump(void) uint32_t mi_arb_state; struct gmch_wm wms[MAX_PLANE] = {}; - intel_register_access_init(intel_get_pci_device(), 0, -1); + intel_register_access_init(igt_device_get_pci_device(fd), 0, -1); dspacntr = read_reg(0x70180); dspbcntr = read_reg(0x71180); @@ -921,7 +923,7 @@ static void gen4_wm_dump(void) uint32_t mi_arb_state; struct gmch_wm wms[MAX_PLANE] = {}; - intel_register_access_init(intel_get_pci_device(), 0, -1); + intel_register_access_init(igt_device_get_pci_device(fd), 0, -1); dsparb = read_reg(0x70030); fw1 = read_reg(0x70034); @@ -992,7 +994,7 @@ static void pnv_wm_dump(void) uint32_t cbr; struct gmch_wm wms[MAX_PLANE] = {}; - intel_register_access_init(intel_get_pci_device(), 0, -1); + intel_register_access_init(igt_device_get_pci_device(fd), 0, -1); dsparb = read_reg(0x70030); fw1 = read_reg(0x70034); @@ -1082,7 +1084,7 @@ static void gen3_wm_dump(void) uint32_t mi_arb_state; struct gmch_wm wms[MAX_PLANE] = {}; - intel_register_access_init(intel_get_pci_device(), 0, -1); + intel_register_access_init(igt_device_get_pci_device(fd), 0, -1); dsparb = read_reg(0x70030); instpm = read_reg(0x20c0); @@ -1151,7 +1153,7 @@ static void gen2_wm_dump(void) uint32_t mi_state; struct gmch_wm wms[MAX_PLANE] = {}; - intel_register_access_init(intel_get_pci_device(), 0, -1); + intel_register_access_init(igt_device_get_pci_device(fd), 0, -1); dsparb = read_reg(0x70030); mem_mode = read_reg(0x20cc); @@ -1226,7 +1228,8 @@ static void gen2_wm_dump(void) int main(int argc, char *argv[]) { - devid = intel_get_pci_device()->device_id; + fd = drm_open_driver(DRIVER_INTEL); + devid = igt_device_get_pci_device(fd)->device_id; if (intel_gen(devid) >= 9) { skl_wm_dump(); @@ -1250,5 +1253,7 @@ int main(int argc, char *argv[]) return 1; } + close(fd); + return 0; } -- 2.20.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski ` (6 preceding siblings ...) 2019-03-14 12:50 ` [igt-dev] [CI 8/8] lib/igt_device: Move intel_get_pci_device under igt_device Michał Winiarski @ 2019-03-14 13:31 ` Patchwork 2019-03-14 13:39 ` Patchwork ` (2 subsequent siblings) 10 siblings, 0 replies; 14+ messages in thread From: Patchwork @ 2019-03-14 13:31 UTC (permalink / raw) To: Michał Winiarski; +Cc: igt-dev == Series Details == Series: series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs URL : https://patchwork.freedesktop.org/series/58000/ State : failure == Summary == CI Bug Log - changes from CI_DRM_5745 -> IGTPW_2621 ==================================================== Summary ------- **FAILURE** Serious unknown changes coming with IGTPW_2621 absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in IGTPW_2621, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://patchwork.freedesktop.org/api/1.0/series/58000/revisions/1/mbox/ Possible new issues ------------------- Here are the unknown changes that may have been introduced in IGTPW_2621: ### IGT changes ### #### Possible regressions #### * igt@gem_close_race@basic-process: - fi-icl-u3: NOTRUN -> INCOMPLETE Known issues ------------ Here are the changes found in IGTPW_2621 that come from known issues: ### IGT changes ### #### Issues hit #### * igt@amdgpu/amd_basic@cs-sdma: - fi-skl-6770hq: NOTRUN -> SKIP [fdo#109271] +37 * igt@amdgpu/amd_cs_nop@fork-compute0: - fi-blb-e6850: NOTRUN -> SKIP [fdo#109271] +18 * igt@amdgpu/amd_cs_nop@sync-compute0: - fi-bdw-gvtdvm: NOTRUN -> SKIP [fdo#109271] +42 * igt@amdgpu/amd_prime@amd-to-i915: - fi-kbl-x1275: NOTRUN -> SKIP [fdo#109271] +45 * igt@gem_ctx_create@basic-files: - fi-gdg-551: NOTRUN -> SKIP [fdo#109271] +106 * igt@gem_exec_basic@gtt-bsd: - fi-bwr-2160: NOTRUN -> SKIP [fdo#109271] +103 * igt@gem_exec_basic@gtt-bsd2: - fi-byt-clapper: NOTRUN -> SKIP [fdo#109271] +57 * igt@gem_exec_gttfill@basic: - fi-skl-gvtdvm: NOTRUN -> SKIP [fdo#109271] +41 * igt@gem_exec_store@basic-bsd1: - fi-kbl-r: NOTRUN -> SKIP [fdo#109271] +41 * igt@i915_selftest@live_execlists: - fi-apl-guc: PASS -> INCOMPLETE [fdo#103927] / [fdo#109720] * igt@kms_addfb_basic@addfb25-y-tiled-small: - fi-byt-n2820: NOTRUN -> SKIP [fdo#109271] +56 * igt@kms_busy@basic-flip-a: - fi-gdg-551: NOTRUN -> FAIL [fdo#103182] +1 * igt@kms_busy@basic-flip-c: - fi-bwr-2160: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] - fi-byt-clapper: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] - fi-gdg-551: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] - fi-byt-n2820: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] * igt@kms_chamelium@vga-edid-read: - fi-hsw-4770r: NOTRUN -> SKIP [fdo#109271] +45 * igt@kms_frontbuffer_tracking@basic: - fi-byt-clapper: NOTRUN -> FAIL [fdo#103167] * igt@runner@aborted: - fi-bxt-dsi: NOTRUN -> FAIL [fdo#109516] - fi-apl-guc: NOTRUN -> FAIL [fdo#108622] / [fdo#109720] #### Possible fixes #### * igt@i915_module_load@reload: - fi-blb-e6850: INCOMPLETE [fdo#107718] -> PASS * igt@i915_pm_rpm@basic-pci-d3-state: - fi-byt-j1900: SKIP [fdo#109271] -> PASS * igt@i915_pm_rpm@basic-rte: - fi-byt-j1900: FAIL [fdo#108800] -> PASS [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167 [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182 [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927 [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718 [fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622 [fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800 [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271 [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278 [fdo#109516]: https://bugs.freedesktop.org/show_bug.cgi?id=109516 [fdo#109720]: https://bugs.freedesktop.org/show_bug.cgi?id=109720 Participating hosts (35 -> 41) ------------------------------ Additional (12): fi-hsw-4770r fi-bxt-dsi fi-skl-gvtdvm fi-skl-6770hq fi-bdw-gvtdvm fi-bwr-2160 fi-kbl-x1275 fi-gdg-551 fi-icl-u3 fi-byt-n2820 fi-byt-clapper fi-kbl-r Missing (6): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-ctg-p8600 fi-bdw-samus Build changes ------------- * IGT: IGT_4884 -> IGTPW_2621 CI_DRM_5745: 170699448ee836d2a24fc3b75fb331682eea7887 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_2621: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2621/ IGT_4884: c46051337b972f8b5a302afb6f603df06fea527d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2621/ _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski ` (7 preceding siblings ...) 2019-03-14 13:31 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Patchwork @ 2019-03-14 13:39 ` Patchwork 2019-03-18 8:55 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs (rev3) Patchwork 2019-03-18 10:41 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork 10 siblings, 0 replies; 14+ messages in thread From: Patchwork @ 2019-03-14 13:39 UTC (permalink / raw) To: Michał Winiarski; +Cc: igt-dev == Series Details == Series: series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs URL : https://patchwork.freedesktop.org/series/58000/ State : failure == Summary == CI Bug Log - changes from CI_DRM_5745 -> IGTPW_2621 ==================================================== Summary ------- **FAILURE** Serious unknown changes coming with IGTPW_2621 absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in IGTPW_2621, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://patchwork.freedesktop.org/api/1.0/series/58000/revisions/1/mbox/ Possible new issues ------------------- Here are the unknown changes that may have been introduced in IGTPW_2621: ### IGT changes ### #### Possible regressions #### * igt@gem_close_race@basic-process: - fi-icl-u3: NOTRUN -> INCOMPLETE Known issues ------------ Here are the changes found in IGTPW_2621 that come from known issues: ### IGT changes ### #### Issues hit #### * igt@amdgpu/amd_basic@cs-sdma: - fi-skl-6770hq: NOTRUN -> SKIP [fdo#109271] +37 * igt@amdgpu/amd_cs_nop@fork-compute0: - fi-blb-e6850: NOTRUN -> SKIP [fdo#109271] +18 * igt@amdgpu/amd_cs_nop@sync-compute0: - fi-bdw-gvtdvm: NOTRUN -> SKIP [fdo#109271] +42 * igt@amdgpu/amd_prime@amd-to-i915: - fi-kbl-x1275: NOTRUN -> SKIP [fdo#109271] +45 * igt@gem_ctx_create@basic-files: - fi-gdg-551: NOTRUN -> SKIP [fdo#109271] +106 * igt@gem_exec_basic@gtt-bsd: - fi-bwr-2160: NOTRUN -> SKIP [fdo#109271] +103 * igt@gem_exec_basic@gtt-bsd2: - fi-byt-clapper: NOTRUN -> SKIP [fdo#109271] +57 * igt@gem_exec_gttfill@basic: - fi-skl-gvtdvm: NOTRUN -> SKIP [fdo#109271] +41 * igt@gem_exec_store@basic-bsd1: - fi-kbl-r: NOTRUN -> SKIP [fdo#109271] +41 * igt@i915_selftest@live_execlists: - fi-apl-guc: PASS -> INCOMPLETE [fdo#103927] / [fdo#109720] * igt@kms_addfb_basic@addfb25-y-tiled-small: - fi-byt-n2820: NOTRUN -> SKIP [fdo#109271] +56 * igt@kms_busy@basic-flip-a: - fi-gdg-551: NOTRUN -> FAIL [fdo#103182] +1 * igt@kms_busy@basic-flip-c: - fi-bwr-2160: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] - fi-byt-clapper: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] - fi-gdg-551: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] - fi-byt-n2820: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] * igt@kms_chamelium@vga-edid-read: - fi-hsw-4770r: NOTRUN -> SKIP [fdo#109271] +45 * igt@kms_frontbuffer_tracking@basic: - fi-byt-clapper: NOTRUN -> FAIL [fdo#103167] * igt@runner@aborted: - fi-bxt-dsi: NOTRUN -> FAIL [fdo#109516] - fi-apl-guc: NOTRUN -> FAIL [fdo#108622] / [fdo#109720] #### Possible fixes #### * igt@i915_module_load@reload: - fi-blb-e6850: INCOMPLETE [fdo#107718] -> PASS * igt@i915_pm_rpm@basic-pci-d3-state: - fi-byt-j1900: SKIP [fdo#109271] -> PASS * igt@i915_pm_rpm@basic-rte: - fi-byt-j1900: FAIL [fdo#108800] -> PASS [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167 [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182 [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927 [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718 [fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622 [fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800 [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271 [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278 [fdo#109516]: https://bugs.freedesktop.org/show_bug.cgi?id=109516 [fdo#109720]: https://bugs.freedesktop.org/show_bug.cgi?id=109720 Participating hosts (35 -> 41) ------------------------------ Additional (12): fi-hsw-4770r fi-bxt-dsi fi-skl-gvtdvm fi-skl-6770hq fi-bdw-gvtdvm fi-bwr-2160 fi-kbl-x1275 fi-gdg-551 fi-icl-u3 fi-byt-n2820 fi-byt-clapper fi-kbl-r Missing (6): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-ctg-p8600 fi-bdw-samus Build changes ------------- * IGT: IGT_4884 -> IGTPW_2621 CI_DRM_5745: 170699448ee836d2a24fc3b75fb331682eea7887 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_2621: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2621/ IGT_4884: c46051337b972f8b5a302afb6f603df06fea527d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2621/ _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs (rev3) 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski ` (8 preceding siblings ...) 2019-03-14 13:39 ` Patchwork @ 2019-03-18 8:55 ` Patchwork 2019-03-18 10:41 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork 10 siblings, 0 replies; 14+ messages in thread From: Patchwork @ 2019-03-18 8:55 UTC (permalink / raw) To: Michał Winiarski; +Cc: igt-dev == Series Details == Series: series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs (rev3) URL : https://patchwork.freedesktop.org/series/58000/ State : success == Summary == CI Bug Log - changes from IGT_4888 -> IGTPW_2641 ==================================================== Summary ------- **SUCCESS** No regressions found. External URL: https://patchwork.freedesktop.org/api/1.0/series/58000/revisions/3/mbox/ Known issues ------------ Here are the changes found in IGTPW_2641 that come from known issues: ### IGT changes ### #### Issues hit #### * igt@amdgpu/amd_cs_nop@sync-gfx0: - fi-kbl-7567u: NOTRUN -> SKIP [fdo#109271] +17 * igt@i915_module_load@reload: - fi-kbl-7567u: PASS -> DMESG-WARN [fdo#105602] / [fdo#108529] * igt@i915_pm_rpm@basic-pci-d3-state: - fi-bsw-kefka: PASS -> SKIP [fdo#109271] * igt@i915_pm_rpm@basic-rte: - fi-bsw-kefka: PASS -> FAIL [fdo#108800] * igt@i915_pm_rpm@module-reload: - fi-kbl-7567u: NOTRUN -> DMESG-WARN [fdo#108529] * igt@kms_chamelium@common-hpd-after-suspend: - fi-kbl-7567u: PASS -> DMESG-FAIL [fdo#105079] * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c: - fi-kbl-7567u: PASS -> SKIP [fdo#109271] +33 * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a: - fi-whl-u: PASS -> FAIL [fdo#103375] +3 #### Possible fixes #### * igt@kms_pipe_crc_basic@read-crc-pipe-b: - fi-byt-clapper: FAIL [fdo#107362] -> PASS * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b: - fi-byt-clapper: FAIL [fdo#103191] / [fdo#107362] -> PASS +2 * igt@prime_vgem@basic-fence-flip: - fi-ilk-650: FAIL [fdo#104008] -> PASS [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191 [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375 [fdo#104008]: https://bugs.freedesktop.org/show_bug.cgi?id=104008 [fdo#105079]: https://bugs.freedesktop.org/show_bug.cgi?id=105079 [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602 [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362 [fdo#108529]: https://bugs.freedesktop.org/show_bug.cgi?id=108529 [fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800 [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271 Participating hosts (46 -> 39) ------------------------------ Missing (7): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-bsw-n3050 fi-byt-squawks fi-bsw-cyan fi-bdw-samus Build changes ------------- * IGT: IGT_4888 -> IGTPW_2641 * Linux: CI_DRM_5756 -> CI_DRM_5763 CI_DRM_5756: 0a2a982693ac3f3ecabf8e6c12cb18aa993ae3b0 @ git://anongit.freedesktop.org/gfx-ci/linux CI_DRM_5763: de2772b353b83e6347687973dfff6f7f5257e364 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_2641: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2641/ IGT_4888: 71ad19eb8fe4f0eecae3bf063e107293b90b9abc @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2641/ _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs (rev3) 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski ` (9 preceding siblings ...) 2019-03-18 8:55 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs (rev3) Patchwork @ 2019-03-18 10:41 ` Patchwork 10 siblings, 0 replies; 14+ messages in thread From: Patchwork @ 2019-03-18 10:41 UTC (permalink / raw) To: Michał Winiarski; +Cc: igt-dev == Series Details == Series: series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs (rev3) URL : https://patchwork.freedesktop.org/series/58000/ State : failure == Summary == CI Bug Log - changes from IGT_4888_full -> IGTPW_2641_full ==================================================== Summary ------- **FAILURE** Serious unknown changes coming with IGTPW_2641_full absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in IGTPW_2641_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://patchwork.freedesktop.org/api/1.0/series/58000/revisions/3/mbox/ Possible new issues ------------------- Here are the unknown changes that may have been introduced in IGTPW_2641_full: ### IGT changes ### #### Possible regressions #### * igt@perf@blocking: - shard-hsw: PASS -> FAIL +23 * igt@perf@create-destroy-userspace-config: - shard-glk: PASS -> FAIL +22 * igt@perf@enable-disable: - shard-apl: NOTRUN -> FAIL - shard-kbl: NOTRUN -> FAIL * igt@perf@invalid-oa-metric-set-id: - shard-apl: PASS -> FAIL +21 * igt@perf@polling: - shard-kbl: PASS -> FAIL +20 * igt@perf@sysctl-defaults: - shard-glk: PASS -> WARN - shard-apl: PASS -> WARN - shard-kbl: PASS -> WARN - shard-hsw: PASS -> WARN #### Warnings #### * igt@perf@gen8-unprivileged-single-ctx-counters: - shard-hsw: SKIP [fdo#109271] -> FAIL * igt@perf@per-context-mode-unprivileged: - shard-apl: SKIP [fdo#109271] -> FAIL +1 - shard-glk: SKIP [fdo#109271] -> FAIL +1 - shard-kbl: SKIP [fdo#109271] -> FAIL +1 Known issues ------------ Here are the changes found in IGTPW_2641_full that come from known issues: ### IGT changes ### #### Issues hit #### * igt@gem_shrink@reclaim: - shard-kbl: PASS -> SKIP [fdo#109271] +1 - shard-snb: PASS -> SKIP [fdo#109271] - shard-hsw: PASS -> SKIP [fdo#109271] +1 * igt@kms_atomic_transition@3x-modeset-transitions-nonblocking: - shard-snb: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +10 * igt@kms_atomic_transition@4x-modeset-transitions-nonblocking-fencing: - shard-glk: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] * igt@kms_atomic_transition@plane-all-modeset-transition-fencing: - shard-apl: PASS -> INCOMPLETE [fdo#103927] +1 * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c: - shard-hsw: PASS -> DMESG-WARN [fdo#107956] +1 - shard-kbl: PASS -> DMESG-WARN [fdo#107956] * igt@kms_color@pipe-b-ctm-max: - shard-apl: PASS -> FAIL [fdo#108147] * igt@kms_cursor_crc@cursor-256x256-suspend: - shard-kbl: PASS -> FAIL [fdo#103191] / [fdo#103232] - shard-apl: PASS -> FAIL [fdo#103191] / [fdo#103232] * igt@kms_cursor_crc@cursor-256x85-sliding: - shard-kbl: PASS -> FAIL [fdo#103232] +1 - shard-apl: PASS -> FAIL [fdo#103232] +1 * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic: - shard-hsw: PASS -> FAIL [fdo#105767] * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible: - shard-glk: PASS -> FAIL [fdo#105363] * igt@kms_flip@flip-vs-expired-vblank: - shard-glk: PASS -> FAIL [fdo#102887] / [fdo#105363] * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt: - shard-apl: PASS -> FAIL [fdo#103167] * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt: - shard-kbl: PASS -> FAIL [fdo#103167] * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-move: - shard-glk: PASS -> FAIL [fdo#103167] +5 * igt@kms_frontbuffer_tracking@fbcpsr-rgb565-draw-mmap-gtt: - shard-kbl: NOTRUN -> SKIP [fdo#109271] +4 * igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-onoff: - shard-snb: NOTRUN -> SKIP [fdo#109271] +106 * igt@kms_psr@sprite_plane_onoff: - shard-glk: NOTRUN -> SKIP [fdo#109271] +11 * igt@kms_rotation_crc@multiplane-rotation-cropping-bottom: - shard-kbl: PASS -> DMESG-FAIL [fdo#105763] * igt@kms_rotation_crc@multiplane-rotation-cropping-top: - shard-kbl: PASS -> FAIL [fdo#109016] * igt@kms_setmode@basic: - shard-hsw: PASS -> FAIL [fdo#99912] * igt@kms_vblank@pipe-b-ts-continuation-suspend: - shard-apl: PASS -> DMESG-WARN [fdo#108566] * igt@perf@i915-ref-count: - shard-apl: PASS -> SKIP [fdo#109271] +1 - shard-glk: PASS -> SKIP [fdo#109271] +1 * igt@prime_nv_api@i915_nv_reimport_twice_check_flink_name: - shard-apl: NOTRUN -> SKIP [fdo#109271] +6 * igt@sw_sync@sync_busy_fork_unixsocket: - shard-snb: NOTRUN -> FAIL [fdo#110150 ] #### Possible fixes #### * igt@gem_eio@reset-stress: - shard-snb: FAIL [fdo#109661] -> PASS * igt@kms_busy@extended-modeset-hang-newfb-render-a: - shard-hsw: DMESG-WARN [fdo#107956] -> PASS +1 * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b: - shard-kbl: DMESG-WARN [fdo#107956] -> PASS * igt@kms_cursor_crc@cursor-128x128-onscreen: - shard-apl: FAIL [fdo#103232] -> PASS * igt@kms_cursor_crc@cursor-64x64-suspend: - shard-apl: FAIL [fdo#103191] / [fdo#103232] -> PASS - shard-kbl: FAIL [fdo#103191] / [fdo#103232] -> PASS * igt@kms_flip@modeset-vs-vblank-race-interruptible: - shard-glk: FAIL [fdo#103060] -> PASS * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen: - shard-apl: FAIL [fdo#103167] -> PASS +1 - shard-kbl: FAIL [fdo#103167] -> PASS +1 * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff: - shard-glk: FAIL [fdo#103167] -> PASS +1 * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c: - shard-kbl: INCOMPLETE [fdo#103665] -> PASS * {igt@kms_plane@pixel-format-pipe-a-planes-source-clamping}: - shard-apl: FAIL [fdo#110033] -> PASS +1 - shard-kbl: FAIL -> PASS * {igt@kms_plane_multiple@atomic-pipe-b-tiling-none}: - shard-apl: FAIL [fdo#110037] -> PASS +2 * igt@kms_vblank@pipe-c-ts-continuation-modeset: - shard-kbl: FAIL [fdo#104894] -> PASS - shard-apl: FAIL [fdo#104894] -> PASS #### Warnings #### * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy: - shard-hsw: FAIL [fdo#105767] -> SKIP [fdo#109271] * igt@kms_plane_scaling@pipe-a-scaler-with-pixel-format: - shard-glk: SKIP [fdo#109271] / [fdo#109278] -> FAIL [fdo#110098] +1 * igt@kms_plane_scaling@pipe-a-scaler-with-rotation: - shard-glk: FAIL [fdo#110098] -> SKIP [fdo#109271] / [fdo#109278] +1 {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887 [fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060 [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167 [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191 [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232 [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665 [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927 [fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894 [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363 [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763 [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767 [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956 [fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147 [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566 [fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016 [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271 [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278 [fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661 [fdo#110033]: https://bugs.freedesktop.org/show_bug.cgi?id=110033 [fdo#110037]: https://bugs.freedesktop.org/show_bug.cgi?id=110037 [fdo#110038]: https://bugs.freedesktop.org/show_bug.cgi?id=110038 [fdo#110098]: https://bugs.freedesktop.org/show_bug.cgi?id=110098 [fdo#110150 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110150 [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912 Participating hosts (7 -> 5) ------------------------------ Missing (2): shard-skl shard-iclb Build changes ------------- * IGT: IGT_4888 -> IGTPW_2641 * Linux: CI_DRM_5756 -> CI_DRM_5763 CI_DRM_5756: 0a2a982693ac3f3ecabf8e6c12cb18aa993ae3b0 @ git://anongit.freedesktop.org/gfx-ci/linux CI_DRM_5763: de2772b353b83e6347687973dfff6f7f5257e364 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_2641: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2641/ IGT_4888: 71ad19eb8fe4f0eecae3bf063e107293b90b9abc @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2641/ _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-03-18 10:52 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-03-14 12:50 [igt-dev] [CI 1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 2/8] tests/perf: Simplify generic read/write, use sysfs helpers Michał Winiarski 2019-03-18 10:49 ` Chris Wilson 2019-03-18 10:52 ` Chris Wilson 2019-03-14 12:50 ` [igt-dev] [CI 3/8] tests/i915_pm_rps: Use " Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 4/8] lib/igt_device: Introduce igt_device_get_card_index Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 5/8] lib: Kill drm_get_card() Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 6/8] lib/igt_sysfs: Remove idx from sysfs_open Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 7/8] lib/igt_sysfs: Simplify obtaining sysfs path Michał Winiarski 2019-03-14 12:50 ` [igt-dev] [CI 8/8] lib/igt_device: Move intel_get_pci_device under igt_device Michał Winiarski 2019-03-14 13:31 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs Patchwork 2019-03-14 13:39 ` Patchwork 2019-03-18 8:55 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [CI,1/8] tests/gem_exec_blt: Drop benchmark mode, use igt_sysfs (rev3) Patchwork 2019-03-18 10:41 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox