tests/gem_guc_loading: Adding simple GuC loading test
PATCH 1/1 tests/gem_guc_loading: Adding simple GuC loading test
Test check GuC debugfs file for successful loading confirmation
--- tests/Makefile.sources | 1 + tests/gem_guc_loading.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 tests/gem_guc_loading.c
tests/Makefile.sources +1 -0
@@ -36,6 +36,7 @@ TESTS_progs_M = \ gem_flink_basic \ gem_flink_race \ gem_linear_blits \ + gem_guc_loading \ gem_madvise \ gem_mmap \ gem_mmap_gtt \
tests/gem_guc_loading.c new file +89 -0
89 lines not on this page · raw message
Signature · 6 lines
2.4.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
tests/gem_guc_loading.c line 46
Quoted 4 lines · Lukasz Fiedorowicz
tests/gem_guc_loading.c new file +4
-0+static void open_guc_status (void ) +{ + guc_status_fd =igt_debugfs_open ("i915_guc_load_status" ,O_RDONLY ); +igt_assert_f (guc_status_fd >=0 ,"Can't open i915_guc_load_status\n" );
igt_require(). So that the test doesn't explode if the kernel changes.
tests/gem_guc_loading.c line 53
Quoted 6 lines
tests/gem_guc_loading.c new file +6
-0+ +static enum guc_status get_guc_status (void ) +{ +char buf[LOAD_STATUS_BUF_SIZE ]; + +FILE *fp =fdopen (guc_status_fd,"r" );
If you just wanted the FILE*, use igt_debugfs_fopen.
tests/gem_guc_loading.c line 58
Quoted 5 lines
tests/gem_guc_loading.c new file +5
-0+igt_assert_f (fp !=NULL ,"Can't open i915_guc_load_status file\n" ); + +while (fgets (buf,LOAD_STATUS_BUF_SIZE , fp)) +if ((strstr (buf,"\tload: SUCCESS\n" ))) +return GUC_ENABLED ;
Testing FILE* leak handling?
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
This has been reviewed internally. LGTM.
Quoted 106 lines · Lukasz Fiedorowicz
Test check GuC debugfs file for successful loading confirmation
Signed-off-by Lukasz Fiedorowicz <[email protected]>--- tests/Makefile.sources | 1 + tests/gem_guc_loading.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+)create mode 100644
tests/gem_guc_loading.ctests/Makefile.sources +1
-0@@ -36,6 +36,7 @@ TESTS_progs_M = \ gem_flink_basic \ gem_flink_race \ gem_linear_blits \ + gem_guc_loading \ gem_madvise \ gem_mmap \ gem_mmap_gtt \tests/gem_guc_loading.c new file +79
-0@@ -0,0 +1,89 @@ +/* +* Copyright © 2015 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +* +* Authors: +* Lukasz Fiedorowicz <[email protected]> +* +*/ + +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include "igt.h" + +IGT_TEST_DESCRIPTION ("GuC firmware loading test." ); + +#define LOAD_STATUS_BUF_SIZE 96 + +enum guc_status {GUC_ENABLED ,GUC_DISABLED }; + +int guc_status_fd; + +static void open_guc_status (void ) +{ + guc_status_fd =igt_debugfs_open ("i915_guc_load_status" ,O_RDONLY ); +igt_assert_f (guc_status_fd >=0 ,"Can't open i915_guc_load_status\n" ); +} + +static enum guc_status get_guc_status (void ) +{ +char buf[LOAD_STATUS_BUF_SIZE ]; + +FILE *fp =fdopen (guc_status_fd,"r" ); +igt_assert_f (fp !=NULL ,"Can't open i915_guc_load_status file\n" ); + +while (fgets (buf,LOAD_STATUS_BUF_SIZE , fp)) +if ((strstr (buf,"\tload: SUCCESS\n" ))) +return GUC_ENABLED ; + +return GUC_DISABLED ; +} + +static void close_guc_status (void ) +{ +close (guc_status_fd); +} + +static void test_guc_loaded () +{ +igt_assert_f (get_guc_status () ==GUC_ENABLED ,"GuC is disabled\n" ); +} + +igt_main +{ +int gfx_fd =0 ; +int gen =0 ; + + igt_fixture + {
tests/gem_guc_loading.c line 89
Quoted 10 lines
tests/gem_guc_loading.c new file +10
-0+ gfx_fd =drm_open_driver (DRIVER_INTEL ); + gen =intel_gen (intel_get_drm_devid (gfx_fd)); +igt_require (gen >=9 ); +open_guc_status (); + } + + igt_subtest("guc_loaded") test_guc_loaded(); + +igt_fixture close_guc_status (); +}
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 3 lines · Lukasz Fiedorowicz
Test check GuC debugfs file for successful loading confirmation
Signed-off-by Lukasz Fiedorowicz <[email protected]>
What's the value of this testcase? What happens on a system without guc? Seems more like a "is your system configured correctly" testcase, and thus far we haven't done those as separate tests, but just as a pile of igt_require (or maybe igt_fail) in a relevant functional testcase. -Daniel
Quoted 120 lines
--- tests/Makefile.sources | 1 + tests/gem_guc_loading.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 tests/gem_guc_loading.ctests/Makefile.sources +1
-0@@ -36,6 +36,7 @@ TESTS_progs_M = \ gem_flink_basic \ gem_flink_race \ gem_linear_blits \ + gem_guc_loading \ gem_madvise \ gem_mmap \ gem_mmap_gtt \tests/gem_guc_loading.c new file +89
-0@@ -0,0 +1,89 @@ +/* +* Copyright © 2015 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +* +* Authors: +* Lukasz Fiedorowicz <[email protected]> +* +*/ + +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include "igt.h" + +IGT_TEST_DESCRIPTION ("GuC firmware loading test." ); + +#define LOAD_STATUS_BUF_SIZE 96 + +enum guc_status {GUC_ENABLED ,GUC_DISABLED }; + +int guc_status_fd; + +static void open_guc_status (void ) +{ + guc_status_fd =igt_debugfs_open ("i915_guc_load_status" ,O_RDONLY ); +igt_assert_f (guc_status_fd >=0 ,"Can't open i915_guc_load_status\n" ); +} + +static enum guc_status get_guc_status (void ) +{ +char buf[LOAD_STATUS_BUF_SIZE ]; + +FILE *fp =fdopen (guc_status_fd,"r" ); +igt_assert_f (fp !=NULL ,"Can't open i915_guc_load_status file\n" ); + +while (fgets (buf,LOAD_STATUS_BUF_SIZE , fp)) +if ((strstr (buf,"\tload: SUCCESS\n" ))) +return GUC_ENABLED ; + +return GUC_DISABLED ; +} + +static void close_guc_status (void ) +{ +close (guc_status_fd); +} + +static void test_guc_loaded () +{ +igt_assert_f (get_guc_status () ==GUC_ENABLED ,"GuC is disabled\n" ); +} + +igt_main +{ +int gfx_fd =0 ; +int gen =0 ; + +igt_fixture + { + gfx_fd =drm_open_driver (DRIVER_INTEL ); + gen =intel_gen (intel_get_drm_devid (gfx_fd)); +igt_require (gen >=9 ); +open_guc_status (); + } + + igt_subtest("guc_loaded") test_guc_loaded(); + +igt_fixture close_guc_status (); +}Signature · 6 lines
2.4.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi Daniel,
Some teams, in the past, experienced issues with GuC loading. In order to prevent such issues they need a simple loading tests that can be included in automation environment. As the time progress and GuC will become more widely used and this test could be extended but for now it is needed in its simple form
Thanks,
Lukasz
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Friday, January 8, 2016 8:55 AM
To: Fiedorowicz, Lukasz
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_guc_loading: Adding simple GuC loading test
Quoted 3 lines · Lukasz Fiedorowicz
Test check GuC debugfs file for successful loading confirmation
Signed-off-by Lukasz Fiedorowicz <[email protected]>
What's the value of this testcase? What happens on a system without guc?
Seems more like a "is your system configured correctly" testcase, and thus far we haven't done those as separate tests, but just as a pile of igt_require (or maybe igt_fail) in a relevant functional testcase. -Daniel
Quoted 128 lines
--- tests/Makefile.sources | 1 + tests/gem_guc_loading.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 tests/gem_guc_loading.ctests/Makefile.sources index renamed from tests/Makefile.sources +0
-0d594038..331234f 100644
tests/Makefile.sources +1
-0@@ -36,6 +36,7 @@ TESTS_progs_M = \ gem_flink_basic \ gem_flink_race \ gem_linear_blits \ + gem_guc_loading \ gem_madvise \ gem_mmap \ gem_mmap_gtt \tests/gem_guc_loading.c new renamed from tests/gem_guc_loading.c +0
-0file mode 100644 index 0000000..fd53a46
tests/gem_guc_loading.c new file +101
-1@@ -0,0 +1,89 @@ +/* +* Copyright (c) 2015 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person +obtaining a +* copy of this software and associated documentation files (the +"Software"), +* to deal in the Software without restriction, including without +limitation +* the rights to use, copy, modify, merge, publish, distribute, +sublicense, +* and/or sell copies of the Software, and to permit persons to whom +the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including +the next +* paragraph) shall be included in all copies or substantial portions +of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS +* IN THE SOFTWARE. +* +* Authors: +* Lukasz Fiedorowicz <[email protected]> +* +*/ + +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include "igt.h" + +IGT_TEST_DESCRIPTION ("GuC firmware loading test." ); + +#define LOAD_STATUS_BUF_SIZE 96 + +enum guc_status {GUC_ENABLED ,GUC_DISABLED }; + +int guc_status_fd; + +static void open_guc_status (void ) +{ + guc_status_fd =igt_debugfs_open ("i915_guc_load_status" ,O_RDONLY ); +igt_assert_f (guc_status_fd >=0 ,"Can't open +i915_guc_load_status\n"); } + +static enum guc_status get_guc_status (void ) { +char buf[LOAD_STATUS_BUF_SIZE ]; + +FILE *fp =fdopen (guc_status_fd,"r" ); +igt_assert_f (fp !=NULL ,"Can't open i915_guc_load_status file\n" ); + +while (fgets (buf,LOAD_STATUS_BUF_SIZE , fp)) +if ((strstr (buf,"\tload: SUCCESS\n" ))) +return GUC_ENABLED ; + +return GUC_DISABLED ; +} + +static void close_guc_status (void ) +{ +close (guc_status_fd); +} + +static void test_guc_loaded () +{ +igt_assert_f (get_guc_status () ==GUC_ENABLED ,"GuC is disabled\n" ); +} + +igt_main +{ +int gfx_fd =0 ; +int gen =0 ; + +igt_fixture + { + gfx_fd =drm_open_driver (DRIVER_INTEL ); + gen =intel_gen (intel_get_drm_devid (gfx_fd)); +igt_require (gen >=9 ); +open_guc_status (); + } + + igt_subtest("guc_loaded") test_guc_loaded(); + +igt_fixture close_guc_status (); +} --2.4.3
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx