Add FreeBSD Support
Subsystems (2)
cover Add FreeBSD Support
FreeBSD maintains a port of drm and a few drivers: amdgpu, i915, radeon, vboxvideo, vmwgfx:
https://github.com/FreeBSDDesktop/kms-drm/
Recently I backported some drm & i915 security patches into our tree and was lacking a way to verify the backports. Here is my attempt at adding FreeBSD support to igt.
I've tried to order the series so that what I believe will be less controversial comes nearer the start. I've also tried to err on the side of too many small patches, so I'm happy to squash things where that seems more appropriate to people.
The "null" implementations toward the end are probably more like RFC ideas. I'm willing to take other approaches there if anyone has a better idea for how to handle large sections of code that are more linux specific. Cheers,
Scott
D Scott Phillips (30):
Remove unused includes
lib/igt_chipset: Add missing libdrm dependency lib/igt_core: update longjmp buffers to type sigjmp_buf Include <sys/wait.h>, <limits.h>, and <signal.h> where appropriate Use /bin/sh for shell scripts
tools/intel_gpu_top: Use POSIX signal handler type definition
kms_atomic: change PAGE_SIZE to page_size
lib: remove open-coded card index fetching
igt: replace mmap64() with mmap()
drm-uapi: patch sync_file.h to depend on drm.h i915/pm_backlight: use POSIX basename
Include linux specific headers only on linux lib/igt_core: skip oom_adjustments on non-linux platforms i915/gem: Omit linux-specific madvise, mmap, and sched flags on
non-linux
lib/igt_aux: add null implementation
lib/igt_kmod: add null implementation
lib/igt_perf: add null implementation
runner: Add support for non-linux operating systems
Use ETIMEDOUT in place of ETIME on FreeBSD
ilog2: Use libc provided fls() on FreeBSD
lib: undefine FreeBSD libc's ALIGN macro
lib: Add FreeBSD-specific pthread logic
lib/igt_kms: Add FreeBSD support
lib/ioctl_wrappers: Support FreeBSD in igt_require_gem lib/intel_os: Implement get_avail_ram and get_total_swap for FreeBSD lib/igt_device: Implement get_card_index for FreeBSD lib/igt_debugfs: Implement mount() for FreeBSD
build: Add support for building on non-linux
fixup! igt: replace mmap64() with mmap() lib/igt_device_scan: add null implementation
benchmarks/gem_syslatency.c | 2 - benchmarks/ilog2.h | 2 + benchmarks/meson.build | 7 +- include/drm-uapi/sync_file.h | 3 +- lib/drmtest.h | 4 + lib/i915/gem_mman.c | 2 +- lib/igt.h | 4 + lib/igt_aux.h | 7 ++ lib/igt_aux_null.c | 139 +++++++++++++++++++++++++++ lib/igt_core.c | 7 +- lib/igt_core.h | 4 +- lib/igt_debugfs.c | 31 +++--- lib/igt_device.c | 22 +++++ lib/igt_device_scan_null.c | 67 +++++++++++++ lib/igt_eld.c | 1 + lib/igt_kmod.h | 2 + lib/igt_kmod_null.c | 84 ++++++++++++++++ lib/igt_kms.c | 9 ++ lib/igt_perf.h | 23 +++++ lib/igt_perf_null.c | 45 +++++++++ lib/igt_sysfs.c | 12 ++- lib/igt_vgem.c | 2 +- lib/intel_os.c | 16 +++ lib/ioctl_wrappers.c | 6 +- lib/meson.build | 31 +++++- lib/sw_sync.c | 1 + lib/tests/igt_describe.c | 1 + lib/tests/igt_dynamic_subtests.c | 1 + lib/tests/igt_exit_handler.c | 1 + lib/tests/igt_fork.c | 1 + lib/tests/igt_invalid_subtest_name.c | 1 + lib/tests/igt_no_exit.c | 1 + lib/tests/igt_tests_common.h | 1 + man/rst2man.sh | 2 +- meson.build | 10 +- runner/executor.c | 28 +++++- runner/job_list.c | 3 + tests/generate_testlist.sh | 6 +- tests/i915/gem_close_race.c | 2 + tests/i915/gem_concurrent_all.c | 7 +- tests/i915/gem_ctx_persistence.c | 2 +- tests/i915/gem_exec_fence.c | 1 + tests/i915/gem_exec_latency.c | 5 +- tests/i915/gem_mmap_gtt.c | 22 ++--- tests/i915/gem_mmap_offset.c | 18 ++-- tests/i915/gem_reloc_overflow.c | 1 - tests/i915/gem_shrink.c | 5 +- tests/i915/i915_pm_backlight.c | 1 + tests/kms_atomic.c | 14 +-- tests/meson.build | 30 ++++-- tests/perf.c | 1 + tools/aubdump.c | 2 + tools/intel_gpu_top.c | 2 +- tools/intel_gvtg_test.c | 1 + tools/meson.build | 12 ++- 55 files changed, 624 insertions(+), 91 deletions(-) create mode 100644 lib/igt_aux_null.c create mode 100644 lib/igt_device_scan_null.c create mode 100644 lib/igt_kmod_null.c create mode 100644 lib/igt_perf_null.c
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 1/29 Remove unused includes
<linux/unistd.h> and <malloc.h> are not needed and are not available on other platforms.
--- benchmarks/gem_syslatency.c | 2 -- tests/i915/gem_reloc_overflow.c | 1 - 2 files changed, 3 deletions(-)
benchmarks/gem_syslatency.c +0 -2
@@ -42,8 +42,6 @@#include <limits.h> #include "drm.h" -#include <linux/unistd.h> -#define sigev_notify_thread_id _sigev_un._tidstatic volatile int done;
tests/i915/gem_reloc_overflow.c +0 -1
@@ -37,7 +37,6 @@#include <inttypes.h> #include <errno.h> #include <unistd.h> -#include <malloc.h> #include <limits.h> #include <sys/ioctl.h> #include <sys/stat.h>
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 2/29 lib/igt_chipset: Add missing libdrm dependency
In reply to D Scott PhillipsWithout this the build fails because it can not find xf86drm.h.
--- lib/meson.build | 1 + 1 file changed, 1 insertion(+)
lib/meson.build +1 -0
@@ -154,6 +154,7 @@ igt_deps = [ lib_igt ] + lib_deps lin_igt_chipset_build = static_library('igt_chipset', ['intel_chipset.c', 'intel_device_info.c'], + dependencies : libdrm, include_directories : inc) lib_igt_chipset = declare_dependency(link_with : lin_igt_chipset_build,
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 3/29 lib/igt_core: update longjmp buffers to type sigjmp_buf
In reply to D Scott Phillipssigsetjmp/siglongjmp operate on a different type from setjmp/longjmp, sigjmp_buf vs jmp_buf. On glibc these happen to be the same type, but on other platforms they may be different.
--- lib/igt_core.c | 2 +- lib/igt_core.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
lib/igt_core.c +1 -1
@@ -1328,7 +1328,7 @@ static void exit_subtest(const char *result)const char *subtest_text = in_dynamic_subtest ?"Dynamic subtest" :"Subtest" ;const char **subtest_name = in_dynamic_subtest ? &in_dynamic_subtest : &in_subtest;struct timespec *thentime = in_dynamic_subtest ? &dynamic_subtest_time : &subtest_time; -jmp_buf *jmptarget = in_dynamic_subtest ? &igt_dynamic_jmpbuf : &igt_subtest_jmpbuf; +sigjmp_buf *jmptarget = in_dynamic_subtest ? &igt_dynamic_jmpbuf : &igt_subtest_jmpbuf;igt_gettime (&now);
lib/igt_core.h +2 -2
@@ -145,8 +145,8 @@ void __igt_fixture_end(void) __attribute__((noreturn)); __igt_fixture_complete())/* subtest infrastructure */ -jmp_buf igt_subtest_jmpbuf; -jmp_buf igt_dynamic_jmpbuf; +sigjmp_buf igt_subtest_jmpbuf; +sigjmp_buf igt_dynamic_jmpbuf;typedef int (*igt_opt_handler_t )(int opt,int opt_index,void *data);#define IGT_OPT_HANDLER_SUCCESS 0#define IGT_OPT_HANDLER_ERROR -2
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 4/29 Include <sys/wait.h>, <limits.h>, and <signal.h> where appropriate
In reply to D Scott PhillipsOn FreeBSD, sys/wait.h is needed for WIFEXITED and friends, limits.h is needed for PATH_MAX, and signal.h is needed for SIGTERM and friends.
--- lib/igt_eld.c | 1 + lib/tests/igt_describe.c | 1 + lib/tests/igt_dynamic_subtests.c | 1 + lib/tests/igt_exit_handler.c | 1 + lib/tests/igt_fork.c | 1 + lib/tests/igt_invalid_subtest_name.c | 1 + lib/tests/igt_no_exit.c | 1 + lib/tests/igt_tests_common.h | 1 + runner/job_list.c | 1 + tests/i915/gem_exec_fence.c | 1 + tests/perf.c | 1 + tools/intel_gvtg_test.c | 1 + 12 files changed, 12 insertions(+)
lib/igt_eld.c +1 -0
@@ -28,6 +28,7 @@#include <dirent.h> #include <errno.h> #include <glob.h> +#include <limits.h> #include <stdint.h> #include <stdio.h> #include <string.h>
lib/tests/igt_describe.c +1 -0
@@ -22,6 +22,7 @@*/ #include <sys/wait.h> +#include <signal.h> #include <string.h> #include <stdlib.h>
lib/tests/igt_dynamic_subtests.c +1 -0
@@ -23,6 +23,7 @@#include <errno.h> #include <sys/wait.h> +#include <signal.h> #include "igt_core.h" #include "drmtest.h"
lib/tests/igt_exit_handler.c +1 -0
@@ -25,6 +25,7 @@#include <fcntl.h> #include <sys/types.h> #include <sys/wait.h> +#include <signal.h> #include "igt_core.h" #include "drmtest.h"
lib/tests/igt_fork.c +1 -0
@@ -23,6 +23,7 @@*/ #include <errno.h> +#include <signal.h> #include <stdint.h> #include <stdlib.h> #include <unistd.h>
lib/tests/igt_invalid_subtest_name.c +1 -0
@@ -23,6 +23,7 @@#include <errno.h> #include <sys/wait.h> +#include <signal.h> #include "igt_core.h" #include "drmtest.h"
lib/tests/igt_no_exit.c +1 -0
@@ -26,6 +26,7 @@*/ #include <sys/wait.h> +#include <signal.h> #include "drmtest.h"
lib/tests/igt_tests_common.h +1 -0
@@ -25,6 +25,7 @@#ifndef IGT_LIB_TESTS_COMMON_H #define IGT_LIB_TESTS_COMMON_H +#include <sys/wait.h> #include <assert.h> /*
runner/job_list.c +1 -0
@@ -7,6 +7,7 @@#include <string.h> #include <sys/stat.h> #include <sys/types.h> +#include <sys/wait.h> #include <unistd.h> #include "job_list.h"
tests/i915/gem_exec_fence.c +1 -0
@@ -31,6 +31,7 @@#include <sys/ioctl.h> #include <sys/poll.h> #include <sys/signal.h> +#include <signal.h> IGT_TEST_DESCRIPTION ("Check that execbuf waits for explicit fences" );
tests/perf.c +1 -0
@@ -33,6 +33,7 @@#include <sys/time.h> #include <sys/times.h> #include <sys/types.h> +#include <sys/wait.h> #include <dirent.h> #include <time.h> #include <poll.h>
tools/intel_gvtg_test.c +1 -0
@@ -44,6 +44,7 @@#include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> +#include <sys/wait.h> #include <string.h> #include <stdlib.h> #include <signal.h>
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 5/29 Use /bin/sh for shell scripts
In reply to D Scott PhillipsThese scripts don't use an bash-specific functionality, and bsd is not available by default on FreeBSD.
--- man/rst2man.sh | 2 +- tests/generate_testlist.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
man/rst2man.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh rst2man=$1 input=$2
tests/generate_testlist.sh +3 -3
@@ -1,16 +1,16 @@ -#!/bin/bash +#!/bin/sh OUTPUT=$1 shift echo TESTLIST > $OUTPUT -if [[ $# -gt 0 ]] ; then +if [ $# -gt 0 ] ; then echo -n $1 >> $OUTPUT shift fi -while [[ $# -gt 0 ]] ; do +while [ $# -gt 0 ] ; do echo -n " $1" >> $OUTPUT shift done
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 6/29 tools/intel_gpu_top: Use POSIX signal handler type definition
In reply to D Scott PhillipsThe type sighandler_t is a GNU extension which isn't available on FreeBSD, where it instead follows the POSIX specification of a raw function pointer type.
--- tools/intel_gpu_top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/intel_gpu_top.c +1 -1
@@ -1299,7 +1299,7 @@ int main(int argc, char **argv) }if (output_mode !=INTERACTIVE ) { -sighandler_t sig =signal (SIGINT , sigint_handler); +void (* sig)(int ) =signal (SIGINT , sigint_handler);if (sig ==SIG_ERR )fprintf (stderr,"Failed to install signal handler!\n" );
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 7/29 kms_atomic: change `PAGE_SIZE` to `page_size`
In reply to D Scott PhillipsPOSIX limit.h provides a PAGE_SIZE constant, so change the variable name here to not collide with it.
--- tests/kms_atomic.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
tests/kms_atomic.c +7 -7
@@ -683,7 +683,7 @@ static void crtc_invalid_params_fence(igt_pipe_t *pipe, {int timeline, fence_fd;void *map; -const ptrdiff_t PAGE_SIZE =sysconf (_SC_PAGE_SIZE); +const ptrdiff_t page_size =sysconf (_SC_PAGE_SIZE);uint64_t old_mode_id = pipe->values[IGT_CRTC_MODE_ID ];igt_require_sw_sync ();
@@ -691,28 +691,28 @@ static void crtc_invalid_params_fence(igt_pipe_t *pipe, timeline =sw_sync_timeline_create ();/* invalid out_fence_ptr */ - map =mmap (NULL ,PAGE_SIZE ,PROT_READ ,MAP_ANONYMOUS |MAP_PRIVATE ,-1 ,0 ); + map =mmap (NULL , page_size,PROT_READ ,MAP_ANONYMOUS |MAP_PRIVATE ,-1 ,0 );igt_assert (map !=MAP_FAILED );igt_pipe_obj_set_prop_value (pipe,IGT_CRTC_OUT_FENCE_PTR , (ptrdiff_t )map);crtc_commit_atomic_err (pipe, plane,ATOMIC_RELAX_NONE ,EFAULT ); -munmap (map,PAGE_SIZE ); +munmap (map, page_size);/* invalid out_fence_ptr */ - map =mmap (NULL ,PAGE_SIZE ,PROT_EXEC ,MAP_ANONYMOUS |MAP_PRIVATE ,-1 ,0 ); + map =mmap (NULL , page_size,PROT_EXEC ,MAP_ANONYMOUS |MAP_PRIVATE ,-1 ,0 );igt_assert (map !=MAP_FAILED );igt_pipe_obj_set_prop_value (pipe,IGT_CRTC_OUT_FENCE_PTR , (ptrdiff_t )map);crtc_commit_atomic_err (pipe, plane,ATOMIC_RELAX_NONE ,EFAULT ); -munmap (map,PAGE_SIZE ); +munmap (map, page_size);/* invalid out_fence_ptr */ - map =mmap (NULL ,PAGE_SIZE ,PROT_NONE ,MAP_ANONYMOUS |MAP_PRIVATE ,-1 ,0 ); + map =mmap (NULL , page_size,PROT_NONE ,MAP_ANONYMOUS |MAP_PRIVATE ,-1 ,0 );igt_assert (map !=MAP_FAILED );igt_pipe_obj_set_prop_value (pipe,IGT_CRTC_OUT_FENCE_PTR , (ptrdiff_t )map);crtc_commit_atomic_err (pipe, plane,ATOMIC_RELAX_NONE ,EFAULT ); -munmap (map,PAGE_SIZE ); +munmap (map, page_size);/* valid in fence but not allowed prop on crtc */ fence_fd =sw_sync_timeline_create_fence (timeline,1 );
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 8/29 lib: remove open-coded card index fetching
In reply to D Scott PhillipsReplace open-coded card index fetching via stat with igt_device_get_card_index() calls.
--- lib/igt_debugfs.c | 17 ++++------------- lib/igt_sysfs.c | 10 +++++----- 2 files changed, 9 insertions(+), 18 deletions(-)
lib/igt_debugfs.c +4 -13
@@ -41,6 +41,7 @@#include "igt_aux.h" #include "igt_kms.h" #include "igt_debugfs.h" +#include "igt_device.h" #include "igt_sysfs.h" /**
@@ -164,20 +165,10 @@ char *igt_debugfs_path(int device, char *path, int pathlen) debugfs_root =igt_debugfs_mount ();igt_assert (debugfs_root); -memset (&st,0 ,sizeof (st)); -if (device !=-1 ) {/* if no fd, we presume we want dri/0 */ -if (fstat (device, &st)) { -igt_debug ("Couldn't stat FD for DRM device: %m\n" ); -return NULL ; - } - -if (!S_ISCHR (st.st_mode)) { -igt_debug ("FD for DRM device not a char device!\n" ); -return NULL ; - } - } + idx =0 ; +if (device >=0 ) + idx =igt_device_get_card_index (device); - idx =minor (st.st_rdev);snprintf (path, pathlen,"%s/dri/%d/name" , debugfs_root, idx);if (stat (path, &st))return NULL ;
lib/igt_sysfs.c +5 -5
@@ -43,6 +43,8 @@#include "igt_sysfs.h" #include "igt_device.h" +#define DRM_MAJOR 226 +/** * SECTION:igt_sysfs * @short_description: Support code for sysfs features
@@ -98,16 +100,14 @@ static int writeN(int fd, const char *buf, int len)*/ char *igt_sysfs_path (int device,char *path,int pathlen) { -struct stat st; +int idx;if (device <0 )return NULL ; -if (fstat (device, &st) || !S_ISCHR (st.st_mode)) -return NULL ; + idx =igt_device_get_card_index (device); -snprintf (path, pathlen,"/sys/dev/char/%d:%d" , -major (st.st_rdev),minor (st.st_rdev)); +snprintf (path, pathlen,"/sys/dev/char/%d:%d" ,DRM_MAJOR , idx);if (access (path,F_OK ))return NULL ;
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 9/29 igt: replace mmap64() with mmap()
In reply to D Scott Phillipsmmap64 is the variant syscall with 64-bit off_t. On 64-bit platforms mmap == mmap64. On 32-bit platforms mmap == mmap64 when _FILE_OFFSET_BITS=64, which we get with AC_SYS_LARGEFILE in autoconf and by default with meson. Other platforms don't necessarily have an mmap64 syscall or function.
--- lib/i915/gem_mman.c | 2 +- lib/igt_vgem.c | 2 +- tests/i915/gem_mmap_gtt.c | 22 +++++++++++----------- tests/i915/gem_mmap_offset.c | 18 +++++++++--------- 4 files changed, 22 insertions(+), 22 deletions(-)
lib/i915/gem_mman.c +1 -1
@@ -62,7 +62,7 @@ void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot)if (igt_ioctl (fd,DRM_IOCTL_I915_GEM_MMAP_GTT , &mmap_arg))return NULL ; - ptr =mmap64 (0 , size, prot,MAP_SHARED , fd, mmap_arg.offset); + ptr =mmap (0 , size, prot,MAP_SHARED , fd, mmap_arg.offset);if (ptr ==MAP_FAILED ) ptr =NULL ;else
lib/igt_vgem.c +1 -1
@@ -76,7 +76,7 @@ void *__vgem_mmap(int fd, struct vgem_bo *bo, unsigned prot)if (drmIoctl (fd,DRM_IOCTL_MODE_MAP_DUMB , &arg))return NULL ; - ptr =mmap64 (0 , bo->size, prot,MAP_SHARED , fd, arg.offset); + ptr =mmap (0 , bo->size, prot,MAP_SHARED , fd, arg.offset);if (ptr ==MAP_FAILED )return NULL ;
tests/i915/gem_mmap_gtt.c +11 -11
@@ -103,11 +103,11 @@ test_access(int fd) mmap_arg.handle = handle;do_ioctl (fd,DRM_IOCTL_I915_GEM_MMAP_GTT , &mmap_arg); -igt_assert (mmap64 (0 ,OBJECT_SIZE ,PROT_READ |PROT_WRITE , +igt_assert (mmap (0 ,OBJECT_SIZE ,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, mmap_arg.offset));/* Check that the same offset on the other fd doesn't work. */ -igt_assert (mmap64 (0 ,OBJECT_SIZE ,PROT_READ |PROT_WRITE , +igt_assert (mmap (0 ,OBJECT_SIZE ,PROT_READ |PROT_WRITE ,MAP_SHARED , fd2, mmap_arg.offset) ==MAP_FAILED );igt_assert (errno ==EACCES );
@@ -118,7 +118,7 @@ test_access(int fd)/* Recheck that it works after flink. */ /* Check that the same offset on the other fd doesn't work. */ -igt_assert (mmap64 (0 ,OBJECT_SIZE ,PROT_READ |PROT_WRITE , +igt_assert (mmap (0 ,OBJECT_SIZE ,PROT_READ |PROT_WRITE ,MAP_SHARED , fd2, mmap_arg.offset)); }
@@ -149,11 +149,11 @@ test_short(int fd)for (pages =1 ; pages <=OBJECT_SIZE /PAGE_SIZE ; pages <<=1 ) {uint8_t *r, *w; - w =mmap64 (0 , pages *PAGE_SIZE ,PROT_READ |PROT_WRITE , + w =mmap (0 , pages *PAGE_SIZE ,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, mmap_arg.offset);igt_assert (w !=MAP_FAILED ); - r =mmap64 (0 , pages *PAGE_SIZE ,PROT_READ , + r =mmap (0 , pages *PAGE_SIZE ,PROT_READ ,MAP_SHARED , fd, mmap_arg.offset);igt_assert (r !=MAP_FAILED );
@@ -371,13 +371,13 @@ test_isolation(int i915)close (B ); - ptr =mmap64 (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a); + ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr !=MAP_FAILED );munmap (ptr,4096 );close (A ); - ptr =mmap64 (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a); + ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr ==MAP_FAILED ); }
@@ -387,7 +387,7 @@ test_close_race(int i915)const int ncpus =sysconf (_SC_NPROCESSORS_ONLN); _Atomicuint32_t *handles; - handles =mmap64 (0 ,4096 ,PROT_WRITE ,MAP_SHARED |MAP_ANON ,-1 ,0 ); + handles =mmap (0 ,4096 ,PROT_WRITE ,MAP_SHARED |MAP_ANON ,-1 ,0 );igt_assert (handles !=MAP_FAILED ); igt_fork(child, ncpus + 1) {
@@ -405,7 +405,7 @@ test_close_race(int i915) &mmap_arg) != -1) {void *ptr; - ptr =mmap64 (0 ,4096 , + ptr =mmap (0 ,4096 ,PROT_WRITE ,MAP_SHARED , i915, mmap_arg.offset);if (ptr !=MAP_FAILED ) {
@@ -431,7 +431,7 @@ test_flink_race(int i915)const int ncpus =sysconf (_SC_NPROCESSORS_ONLN); _Atomicuint32_t *handles; - handles =mmap64 (0 ,4096 ,PROT_WRITE ,MAP_SHARED |MAP_ANON ,-1 ,0 ); + handles =mmap (0 ,4096 ,PROT_WRITE ,MAP_SHARED |MAP_ANON ,-1 ,0 );igt_assert (handles !=MAP_FAILED ); igt_fork(child, ncpus + 1) {
@@ -456,7 +456,7 @@ test_flink_race(int i915) &mmap_arg) != -1) {void *ptr; - ptr =mmap64 (0 ,4096 , + ptr =mmap (0 ,4096 ,PROT_WRITE ,MAP_SHARED , fd, mmap_arg.offset);if (ptr !=MAP_FAILED ) {
tests/i915/gem_mmap_offset.c +9 -9
@@ -76,7 +76,7 @@ __mmap_offset(int i915, uint32_t handle, uint64_t offset, uint64_t size,if (mmap_offset_ioctl (i915, &arg))return NULL ; - ptr =mmap64 (0 , size, prot,MAP_SHARED , i915, arg.offset + offset); + ptr =mmap (0 , size, prot,MAP_SHARED , i915, arg.offset + offset);if (ptr ==MAP_FAILED ) ptr =NULL ;else
@@ -224,34 +224,34 @@ static void isolation(int i915) t->name, B, b, offset_b); errno =0 ; - ptr =mmap64 (0 ,4096 ,PROT_READ ,MAP_SHARED , i915, offset_a); + ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED , i915, offset_a);igt_assert (ptr ==MAP_FAILED );igt_assert_eq (errno,EACCES ); errno =0 ; - ptr =mmap64 (0 ,4096 ,PROT_READ ,MAP_SHARED , i915, offset_b); + ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED , i915, offset_b);igt_assert (ptr ==MAP_FAILED );igt_assert_eq (errno,EACCES ); errno =0 ; - ptr =mmap64 (0 ,4096 ,PROT_READ ,MAP_SHARED ,B , offset_a); + ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,B , offset_a);igt_assert (ptr ==MAP_FAILED );igt_assert_eq (errno,EACCES ); errno =0 ; - ptr =mmap64 (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_b); + ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_b);igt_assert (ptr ==MAP_FAILED );igt_assert_eq (errno,EACCES );close (B ); - ptr =mmap64 (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a); + ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr !=MAP_FAILED );munmap (ptr,4096 );close (A ); - ptr =mmap64 (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a); + ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr ==MAP_FAILED ); } }
@@ -286,7 +286,7 @@ static void close_race(int i915, int timeout) _Atomicuint32_t *handles;size_t len =ALIGN ((ncpus +1 ) *sizeof (uint32_t ),4096 ); - handles =mmap64 (0 , len,PROT_WRITE ,MAP_SHARED |MAP_ANON ,-1 ,0 ); + handles =mmap (0 , len,PROT_WRITE ,MAP_SHARED |MAP_ANON ,-1 ,0 );igt_assert (handles !=MAP_FAILED ); igt_fork(child, ncpus + 1) {
@@ -305,7 +305,7 @@ static void close_race(int i915, int timeout) &mmap_arg) != -1) {void *ptr; - ptr =mmap64 (0 ,4096 , + ptr =mmap (0 ,4096 ,PROT_WRITE ,MAP_SHARED , i915, mmap_arg.offset);if (ptr !=MAP_FAILED ) {
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 10/29 drm-uapi: patch sync_file.h to depend on drm.h
In reply to D Scott Phillipslinux/sync_file.h isn't strictly part of the drm uapi and so doesn't include drm.h. drm.h contains some compatibility #defines for non-Linux platforms for things like __u32 which synf_file needs.
--- include/drm-uapi/sync_file.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
include/drm-uapi/sync_file.h +1 -2
@@ -12,8 +12,7 @@#ifndef _LINUX_SYNC_H#define _LINUX_SYNC_H -#include <linux/ioctl.h> -#include <linux/types.h> +#include "drm.h" /** * struct sync_merge_data - data passed to merge ioctl
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 10/29] drm-uapi: patch sync_file.h to depend on drm.h
Quoted 4 lines · D Scott Phillips
linux/sync_file.hisn't strictly part of the drm uapi and so doesn't includedrm.h.drm.hcontains some compatibility #defines for non-Linux platforms for things like__u32whichsynf_fileneeds.
Unfortunately, stuff in drm-uapi are supposed to be verbatim copies from the kernel.
BR,
Jani.
Quoted 20 lines
Signed-off-by D Scott Phillips <[email protected]>--- include/drm-uapi/sync_file.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)include/drm-uapi/sync_file.h +1
-2@@ -12,8 +12,7 @@#ifndef _LINUX_SYNC_H#define _LINUX_SYNC_H -#include <linux/ioctl.h> -#include <linux/types.h> +#include "drm.h" /** * struct sync_merge_data - data passed to merge ioctl
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 11/29 i915/pm_backlight: use POSIX basename
In reply to D Scott PhillipsWe can get POSIX basename by including libgen.h. It behaves slightly differently from GNU basename, like possibly modifying the passed in string. This is OK in this usage, and POSIX basename is available on other platforms.
--- tests/i915/i915_pm_backlight.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/i915_pm_backlight.c +1 -0
@@ -30,6 +30,7 @@#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> +#include <libgen.h> #include <stdio.h> #include <errno.h> #include <unistd.h>
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 11/29] i915/pm_backlight: use POSIX basename
Quoted 15 lines · D Scott Phillips
We can get POSIX basename by including
libgen.h. It behaves slightly differently from GNU basename, like possibly modifying the passed in string. This is OK in this usage, and POSIX basename is available on other platforms.Signed-off-by D Scott Phillips <[email protected]>--- tests/i915/i915_pm_backlight.c | 1 + 1 file changed, 1 insertion(+)tests/i915/i915_pm_backlight.c +0
-0
tests/i915/i915_pm_backlight.c line 33
Quoted 4 lines
tests/i915/i915_pm_backlight.c +1
-0@@ -30,6 +30,7 @@#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> +#include <libgen.h>
Needs to be wrapped in #ifdef HAVE_LIBGEN_H though.
Signature · 5 lines
Petri Latvala _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 12/29 Include Linux specific headers only on Linux
In reply to D Scott PhillipsInclude Linux specific headers like sys/sysmacros.h or linux/limits.h with a defined(__linux__) guard, for compatibility with other platforms.
--- lib/igt_debugfs.c | 2 ++ lib/igt_device.c | 2 ++ lib/igt_sysfs.c | 2 ++ runner/job_list.c | 2 ++ tools/aubdump.c | 2 ++ 5 files changed, 10 insertions(+)
lib/igt_debugfs.c +2 -0
@@ -25,7 +25,9 @@#include <inttypes.h> #include <sys/stat.h> #include <sys/mount.h> +#if defined(__linux__)#include <sys/sysmacros.h> +#endif #include <dirent.h> #include <errno.h> #include <stdio.h>
lib/igt_device.c +2 -0
@@ -25,7 +25,9 @@#include <fcntl.h> #include <sys/stat.h> +#if defined(__linux__)#include <sys/sysmacros.h> +#endif #include "igt.h" #include "igt_device.h" #include "igt_sysfs.h"
lib/igt_sysfs.c +2 -0
@@ -24,7 +24,9 @@#include <inttypes.h> #include <sys/stat.h> +#if defined(__linux__)#include <sys/sysmacros.h> +#endif #include <sys/mount.h> #include <errno.h> #include <stdarg.h>
runner/job_list.c +2 -0
@@ -1,7 +1,9 @@#include <ctype.h> #include <errno.h> #include <fcntl.h> +#if defined(__linux__)#include <linux/limits.h> +#endif #include <stdio.h> #include <stdlib.h> #include <string.h>
tools/aubdump.c +2 -0
@@ -30,7 +30,9 @@#include <stdarg.h> #include <fcntl.h> #include <sys/types.h> +#if defined(__linux__)#include <sys/sysmacros.h> +#endif #include <sys/stat.h> #include <sys/ioctl.h> #include <unistd.h>
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 13/29 lib/igt_core: skip oom_adjustments on non-Linux platforms
In reply to D Scott Phillipsoom_adjustments are available only on Linux. Omit the body of oom_adjust_for_doom on other platforms and just accept whatever default out-of-memory handling we get.
--- lib/igt_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/igt_core.c +2 -1
@@ -672,6 +672,7 @@ static void print_usage(const char *help_str, bool output_on_stderr)static void oom_adjust_for_doom (void ) { +#if defined(__linux__)int fd;const char always_kill[] ="1000" ;
@@ -679,7 +680,7 @@ static void oom_adjust_for_doom(void)igt_assert (fd !=-1 );igt_assert (write (fd, always_kill,sizeof (always_kill)) ==sizeof (always_kill));close (fd); - +#endif }/**
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 14/29 i915/gem: Omit Linux-specific madvise, mmap, and sched flags on non-Linux
In reply to D Scott PhillipsThese various flags are Linux specific and don't have cross platform equivalents. Accept the different behavior differences on other platforms for now.
--- tests/i915/gem_concurrent_all.c | 7 +++++-- tests/i915/gem_exec_latency.c | 5 ++++- tests/i915/gem_shrink.c | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-)
tests/i915/gem_concurrent_all.c +5 -2
@@ -1876,8 +1876,11 @@ igt_main pin_sz *=1024 *1024 ; if (posix_memalign(&pinned, 4096, pin_sz) || -mlock (pinned, pin_sz) || -madvise (pinned, pin_sz,MADV_DONTFORK )) { + mlock(pinned, pin_sz) +#if defined(__linux__) + ||madvise (pinned, pin_sz,MADV_DONTFORK ) +#endif + ) {free (pinned); pinned =NULL ; }
tests/i915/gem_exec_latency.c +4 -1
@@ -509,7 +509,10 @@ rthog_latency_on_ring(int fd, unsigned int engine, const char *name, unsigned in { .sched_priority = 99 }; ret =sched_setscheduler (0 , -SCHED_FIFO |SCHED_RESET_ON_FORK , +#if defined(__linux__) +SCHED_RESET_ON_FORK | +#endif +SCHED_FIFO , &rt);if (ret) {igt_warn ("Failed to set scheduling policy!\n" );
tests/i915/gem_shrink.c +4 -1
@@ -272,7 +272,10 @@ static void leak(int fd, uint64_t alloc)char *ptr; ptr =mmap (NULL , alloc,PROT_READ |PROT_WRITE , -MAP_ANON |MAP_PRIVATE |MAP_POPULATE , +#if defined(__linux__) +MAP_POPULATE | +#endif +MAP_ANON |MAP_PRIVATE , -1, 0);if (ptr != (char *)-1 )return ;
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 15/29 lib/igt_aux: add null implementation
In reply to D Scott Phillipsigt_aux depends on Linux specific functionality like udev, sysfs, and others. Add a do-nothing implementation of the same API for inclusion on other platforms.
--- lib/igt_aux_null.c | 139 +++++++++++++++++++++++++++++++++++++++++++++ lib/meson.build | 11 +++- 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 lib/igt_aux_null.c
lib/igt_aux_null.c new file +139 -0
@@ -0,0 +1,139 @@ +/* +* Copyright © 2019 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. +* +*/ + +#include "igt_aux.h" + +void igt_fork_signal_helper (void ) { +} + +void igt_stop_signal_helper (void ) { +} + +void igt_suspend_signal_helper (void ) { +} + +void igt_resume_signal_helper (void ) { +} + +void igt_fork_shrink_helper (int fd) { +} + +void igt_stop_shrink_helper (void ) { +} + +void igt_fork_hang_detector (int fd) { +} + +void igt_stop_hang_detector (void ) { +} + +bool __igt_sigiter_continue (struct __igt_sigiter *iter,bool interrupt) { +return false; +} + +void igt_exchange_int (void *array,unsigned i,unsigned j) { +igt_swap (((int *)array)[i], ((int *)array)[j]); +} + +void igt_exchange_int64 (void *array,unsigned i,unsigned j) { +igt_swap (((int64_t *)array)[i], ((int64_t *)array)[j]); +} + +void igt_permute_array (void *array,unsigned size, +void (*exchange_func)(void *array, +unsigned i, +unsigned j)) { +} + +void igt_progress (const char *header,uint64_t i,uint64_t total) { +} + +void igt_print_activity (void ) { +} + +bool igt_check_boolean_env_var (const char *env_var,bool default_value) { +return false; +} + +bool igt_aub_dump_enabled (void ) { +return false; +} + +void igt_system_suspend_autoresume (enum igt_suspend_state state, +enum igt_suspend_test test) { +} + +void igt_set_autoresume_delay (int delay_secs) { +} + +int igt_get_autoresume_delay (enum igt_suspend_state state) { +return 1 ; +} + +void igt_drop_root (void ) { +} + +void igt_debug_wait_for_keypress (const char *var) { +} + +void igt_debug_manual_check (const char *var,const char *expected) { +} + +void igt_lock_mem (size_t size) { +} + +void igt_unlock_mem (void ) { +} + +void igt_start_siglatency (int sig) { +} + +double igt_stop_siglatency (struct igt_mean *result) { +return 1.0 ; +} + +bool igt_allow_unlimited_files (void ) { +return true; +} + +void igt_set_module_param (const char *name,const char *val) { +} + +void igt_set_module_param_int (const char *name,int val) { +} + +int igt_is_process_running (const char *comm) { +return 0 ; +} + +int igt_terminate_process (int sig,const char *comm) { +return 0 ; +} + +void igt_lsof (const char *dpath) { +} + +uint64_t vfs_file_max (void ) { +return 1 ; +}
lib/meson.build +10 -1
@@ -11,7 +11,6 @@ lib_sources = [ 'igt_debugfs.c', 'igt_device.c', 'igt_device_scan.c', - 'igt_aux.c', 'igt_gt.c', 'igt_halffloat.c', 'igt_matrix.c',
@@ -67,6 +66,16 @@ lib_sources = [ 'veboxcopy_gen12.c', ] +if host_machine.system() == 'linux' + lib_sources += [ + 'igt_aux.c', + ] +else + lib_sources += [ + 'igt_aux_null.c', + ] +endif + lib_deps = [ cairo, glib,
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 16/29 lib/igt_kmod: add null implementation
In reply to D Scott Phillipsigt_kmod depends on libkmod, which is only available on Linux. Add a do-nothing implementation of the same API for inclusion on other platforms.
--- lib/igt_kmod.h | 2 ++ lib/igt_kmod_null.c | 84 +++++++++++++++++++++++++++++++++++++++++++++ lib/meson.build | 3 +- 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 lib/igt_kmod_null.c
lib/igt_kmod.h +2 -0
@@ -24,7 +24,9 @@#ifndef IGT_KMOD_H #define IGT_KMOD_H +#if defined(__linux__)#include <libkmod.h> +#endif #include "igt_list.h"
lib/igt_kmod_null.c new file +84 -0
84 lines not on this page · raw message
lib/meson.build +2 -1
@@ -54,7 +54,6 @@ lib_sources = [ 'igt_pm.c', 'igt_dummyload.c', 'uwildmat/uwildmat.c', - 'igt_kmod.c', 'igt_panfrost.c', 'igt_v3d.c', 'igt_vc4.c',
@@ -69,10 +68,12 @@ lib_sources = [ if host_machine.system() == 'linux' lib_sources += [ 'igt_aux.c', + 'igt_kmod.c', ] else lib_sources += [ 'igt_aux_null.c', + 'igt_kmod_null.c', ] endif
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 17/29 lib/igt_perf: add null implementation
In reply to D Scott Phillipsperf is only availble on Linux. Add a do-nothing implementation of the same API for inclusion on other platforms.
--- lib/igt_perf.h | 23 +++++++++++++++++++++++ lib/igt_perf_null.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ lib/meson.build | 12 ++++++++++-- 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 lib/igt_perf_null.c
lib/igt_perf.h +23 -0
@@ -27,10 +27,13 @@#include <stdint.h> +#if defined(__linux__)#include <linux/perf_event.h> +#endif #include "igt_gt.h" +#if defined(__linux__) static inline int perf_event_open(struct perf_event_attr *attr, pid_t pid,
@@ -50,6 +53,26 @@ perf_event_open(struct perf_event_attr *attr, attr->size =sizeof (*attr); return syscall(__NR_perf_event_open, attr, pid, cpu, group_fd, flags); } +#else +#include <errno.h> + +struct perf_event_attr { +uint64_t config; +uint64_t type; +uint64_t sample_period; +}; + +static inline int +perf_event_open (struct perf_event_attr *attr, +pid_t pid, +int cpu, +int group_fd, +unsigned long flags) +{ + errno =ENXIO ; +return -1 ; +} +#endif uint64_t i915_type_id (void );int perf_i915_open (uint64_t config);
lib/igt_perf_null.c new file +45 -0
45 lines not on this page · raw message
lib/meson.build +10 -2
@@ -14,7 +14,6 @@ lib_sources = [ 'igt_gt.c', 'igt_halffloat.c', 'igt_matrix.c', - 'igt_perf.c', 'igt_primes.c', 'igt_rand.c', 'igt_rapl.c',
@@ -69,11 +68,13 @@ if host_machine.system() == 'linux' lib_sources += [ 'igt_aux.c', 'igt_kmod.c', + 'igt_perf.c', ] else lib_sources += [ 'igt_aux_null.c', 'igt_kmod_null.c', + 'igt_perf_null.c', ] endif
@@ -170,8 +171,15 @@ lin_igt_chipset_build = static_library('igt_chipset', lib_igt_chipset = declare_dependency(link_with : lin_igt_chipset_build, include_directories : inc) + +if host_machine.system() == 'linux' + igt_perf_sources = ['igt_perf.c'] +else + igt_perf_sources = ['igt_perf_null.c'] +endif + lib_igt_perf_build = static_library('igt_perf', - ['igt_perf.c'], + igt_perf_sources, include_directories : inc) lib_igt_perf = declare_dependency(link_with : lib_igt_perf_build,
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 18/29 runner: Add support for non-Linux operating systems
In reply to D Scott PhillipsThe runner depends on Linux specific functionality like signalfd and the watchdog interface. Provide stub functionality for other platforms so that the runner can continue with reduced functionality.
--- runner/executor.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-)
runner/executor.c +27 -1
@@ -1,7 +1,9 @@#include <errno.h> #include <fcntl.h> #include <glib.h> +#if defined(__linux__)#include <linux/watchdog.h> +#endif #if HAVE_OPING #include <oping.h> #endif
@@ -13,7 +15,9 @@#include <sys/ioctl.h> #include <sys/select.h> #include <sys/poll.h> +#if defined(__linux__)#include <sys/signalfd.h> +#endif #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h>
@@ -27,6 +31,12 @@#include "executor.h" #include "output_strings.h" +#if !defined(__linux__) +#define CLOCK_BOOTTIME CLOCK_REALTIME +#define WDIOC_SETTIMEOUT 0 +#define WDIOC_KEEPALIVE 0 +#endif + static struct { int *fds; size_t num_dogs;
@@ -674,7 +684,14 @@ static int monitor_output(pid_t child,char *outbuf =NULL ;size_t outbufsize =0 ;char current_subtest[256 ] = {}; +#if defined(__linux__)struct signalfd_siginfo siginfo; +#else +struct signalfd_siginfo { +pid_t ssi_pid; +int ssi_signo; + } siginfo; +#endif ssize_t s;int n, status;int nfds = outfd;
@@ -1455,7 +1472,14 @@ static void oom_immortal(void)static bool should_die_because_signal (int sigfd) { +#if defined(__linux__)struct signalfd_siginfo siginfo; +#else +struct signalfd_siginfo { +pid_t ssi_pid; +int ssi_signo; + } siginfo; +#endif int ret;struct pollfd sigpoll = { .fd = sigfd, .events =POLLIN |POLLRDBAND };
@@ -1494,7 +1518,7 @@ bool execute(struct execute_state *state,struct utsname unamebuf;int resdirfd, testdirfd, unamefd, timefd;sigset_t sigmask; -int sigfd; +int sigfd =-1 ;double time_spent =0.0 ;bool status = true;
@@ -1543,7 +1567,9 @@ bool execute(struct execute_state *state,sigaddset (&sigmask,SIGTERM );sigaddset (&sigmask,SIGQUIT );sigaddset (&sigmask,SIGHUP ); +#if defined(__linux__) sigfd =signalfd (-1 , &sigmask,O_CLOEXEC ); +#endif sigprocmask (SIG_BLOCK , &sigmask,NULL );if (sigfd <0 ) {
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 19/29 Use ETIMEDOUT in place of ETIME on FreeBSD
In reply to D Scott PhillipsFreeBSD does not provide ETIME, and the drm interface is uniformly patched on that platform to use ETIMEDOUT in its place.
--- lib/igt.h | 4 ++++ lib/sw_sync.c | 1 + tests/i915/gem_ctx_persistence.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-)
lib/igt.h +4 -0
@@ -56,4 +56,8 @@#include "i915/gem_mman.h" #include "i915/gem_engine_topology.h" +#if defined(__FreeBSD__) +#define ETIME ETIMEDOUT +#endif +#endif /* IGT_H */
lib/sw_sync.c +1 -0
@@ -35,6 +35,7 @@#include "sync_file.h" +#include "igt.h" #include "igt_debugfs.h" #include "igt_kmod.h" #include "sw_sync.h"
tests/i915/gem_ctx_persistence.c +1 -1
@@ -28,7 +28,7 @@#include <sys/types.h> #include <unistd.h> -#include "drmtest.h" /* gem_quiescent_gpu()! */ +#include "igt.h" #include "i915/gem_context.h" #include "i915/gem_engine_topology.h" #include "i915/gem_ring.h"
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 20/29 ilog2: Use libc provided fls() on FreeBSD
In reply to D Scott PhillipsFreeBSD's libc provides an fls() function with the same name and behavior, so simply omit our version on FreeBSD.
--- benchmarks/ilog2.h | 2 ++ 1 file changed, 2 insertions(+)
benchmarks/ilog2.h +2 -0
@@ -3,12 +3,14 @@#include <stdint.h> +#if !defined(__FreeBSD__)static inline int fls (int x) {int r =-1 ; asm("bsrl %1,%0" :"=r" (r) :"rm" (x),"0" (-1 ));return r +1 ; } +#endif static inline int fls64 (__u64 x) {
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 21/29 lib: undefine FreeBSD libc's ALIGN macro
In reply to D Scott PhillipsOn FreeBSD, if you include many of the non-POSIX headers, you get inflicted with a definition of an ALIGN() macro that has something to do with network protocols. Here we include a header that provides it and then undefine it so that we can provide our own definition.
--- lib/drmtest.h | 4 ++++ 1 file changed, 4 insertions(+)
lib/drmtest.h +4 -0
@@ -33,6 +33,10 @@#include <stdint.h> #include <sys/mman.h> #include <errno.h> +#if defined(__FreeBSD__) +# include <sys/param.h> +# undef ALIGN +#endif #include <xf86drm.h>
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 22/29 lib: Add FreeBSD-specific pthread logic
In reply to D Scott PhillipsAdd a definition for FreeBSD's platform specific method of fetching a thread-id and delivering a signal to the current thread.
--- lib/igt_aux.h | 7 +++++++ lib/igt_core.c | 2 ++ tests/i915/gem_close_race.c | 2 ++ 3 files changed, 11 insertions(+)
lib/igt_aux.h +7 -0
@@ -45,8 +45,15 @@# ifndef HAVE_GETTID # define gettid () (pid_t)(syscall(__NR_gettid))# endif +#else +# ifndef HAVE_GETTID +# include <pthread_np.h> +# define gettid () (pid_t)(pthread_getthreadid_np()) +# endif #endif +#if defined(__linux__)#define sigev_notify_thread_id _sigev_un._tid +#endif /* auxialiary igt helpers from igt_aux.c */ /* generally useful helpers */
lib/igt_core.c +2 -0
@@ -2398,6 +2398,8 @@ static void fatal_sig_handler(int sig)pid_t tid =gettid ();syscall (SYS_tgkill, pid, tid, sig); +#elif defined(__FreeBSD__) +pthread_kill (pthread_self (), sig);#else pthread_t tid =pthread_self ();union sigval value = { .sival_ptr =NULL };
tests/i915/gem_close_race.c +2 -0
@@ -51,7 +51,9 @@static uint32_t devid;static bool has_64bit_relocations; +#if defined(__linux__)#define sigev_notify_thread_id _sigev_un._tid +#endif static void selfcopy (int fd,uint32_t handle,int loops) {
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 23/29 lib/igt_kms: Add FreeBSD support
In reply to D Scott PhillipsInclude the FreeBSD header that provides equivalent definitions to linux/kd.h, and omit igt_hotplug_watch which depends upon udev.
--- lib/igt_kms.c | 9 +++++++++ 1 file changed, 9 insertions(+)
lib/igt_kms.c +9 -0
@@ -41,6 +41,9 @@#elif HAVE_SYS_KD_H #include <sys/kd.h> #endif +#if defined(__FreeBSD__) +#include <sys/consio.h> +#endif #include <libudev.h> #include <poll.h>
@@ -4117,6 +4120,7 @@ void igt_reset_connectors(void)igt_sysfs_set (forced_connectors[i].dir,"status" ,"detect" ); } +#if defined(__linux__)/** * igt_watch_hotplug: *
@@ -4155,6 +4159,11 @@ struct udev_monitor *igt_watch_hotplug(void) return mon; } +#else +struct udev_monitor *igt_watch_hotplug (void ) { +return NULL ; +} +#endif static bool event_detected (struct udev_monitor *mon,int timeout_secs,const char *property)
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 24/29 lib/ioctl_wrappers: Support FreeBSD in igt_require_gem
In reply to D Scott PhillipsOn FreeBSD, fdescfs is mounted at /dev/fd/ and provides equivalent functionality to Linux's /proc/self/fd.
--- lib/ioctl_wrappers.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
lib/ioctl_wrappers.c +5 -1
@@ -1222,7 +1222,7 @@ static void reset_device(int fd)void igt_require_gem (int fd) { -char path[256 ]; +char path[256 ] = {0 };int err;igt_require_intel (fd);
@@ -1232,7 +1232,11 @@ void igt_require_gem(int fd)* of a wedged device, not for actually waiting on outstanding * requests! So create a new drm_file for the device that is clean. */ +#if defined(__linux__)snprintf (path,sizeof (path),"/proc/self/fd/%d" , fd); +#elif defined(__FreeBSD__) +snprintf (path,sizeof (path),"/dev/fd/%d" , fd); +#endif fd =open (path,O_RDWR );igt_assert_lte (0 , fd);
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 25/29 lib/intel_os: Implement get_avail_ram and get_total_swap for FreeBSD
In reply to D Scott PhillipsFreeBSD provides these values through sysctl.
--- lib/intel_os.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
lib/intel_os.c +16 -0
@@ -44,6 +44,8 @@#include <sys/sysinfo.h> #elif defined(HAVE_SWAPCTL )/* Solaris */ #include <sys/swap.h> +#elif defined(__FreeBSD__) +#include <sys/sysctl.h> #endif #include <sys/resource.h>
@@ -148,6 +150,14 @@ intel_get_avail_ram_mb(void) npages =sysconf (_SC_AVPHYS_PAGES); retval = (uint64_t ) pagesize * npages; +#elif defined(__FreeBSD__) +int hw_physmem[] = {CTL_HW ,HW_PHYSMEM }; +size_t size =sizeof (retval); +int ret; + ret =sysctl (hw_physmem,ARRAY_SIZE (hw_physmem), &retval, &size,NULL , +0 ); +if (ret !=0 || size !=sizeof (retval)) + retval =0 ;#else #error "Unknown how to get available RAM for this OS"#endif
@@ -210,6 +220,12 @@ intel_get_total_swap_mb(void)free (buf); retval = (uint64_t ) pagesize * totalpages; +#elif defined(__FreeBSD__) +size_t size =sizeof (retval); +int ret; + ret =sysctlbyname ("vm.swap_total" , &retval, &size,NULL ,0 ); +if (ret !=0 || size !=sizeof (retval)) + retval =0 ;#else #warning "Unknown how to get swap size for this OS"return 0 ;
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 26/29 lib/igt_device: Implement get_card_index for FreeBSD
In reply to D Scott PhillipsOn FreeBSD, the device nodes for drm devices do not have an st_rdev value that corresponds to the drm card index. Instead we can use libutil to look up our open file descriptors through the sysctl interface.
--- lib/igt_device.c | 20 ++++++++++++++++++++ lib/meson.build | 1 + meson.build | 6 ++++++ 3 files changed, 27 insertions(+)
lib/igt_device.c +20 -0
@@ -27,6 +27,10 @@#include <sys/stat.h> #if defined(__linux__)#include <sys/sysmacros.h> +#elif defined(__FreeBSD__) +#include <sys/user.h> +#include <libgen.h> +#include <libutil.h> #endif #include "igt.h" #include "igt_device.h"
@@ -111,11 +115,27 @@ void igt_device_drop_master(int fd)*/ int igt_device_get_card_index (int fd) { +#if defined(__linux__)struct stat st;igt_fail_on (fstat (fd, &st) || !S_ISCHR (st.st_mode));return minor (st.st_rdev); +#elif defined(__FreeBSD__) +struct kinfo_file *files, *f; +int nfiles, idx =0 ; + + files =kinfo_getfile (getpid (), &nfiles); +for (f = files; f < files + nfiles; f++) { +if (f->kf_fd == fd) { + idx =atoi (basename (f->kf_path)); +break ; + } + } +free (files); + +return idx; +#endif }#define IGT_DEV_PATH_LEN 80
lib/meson.build +1 -0
@@ -86,6 +86,7 @@ lib_deps = [ libkmod, libprocps, libudev, + libutil, math, pciaccess, pixman,
meson.build +6 -0
@@ -93,6 +93,12 @@ config = configuration_data() null_dep = dependency('', required : false) +if host_machine.system() == 'freebsd' + libutil = cc.find_library('libutil') +else + libutil = null_dep +endif + libdrm_info = [] libdrm_intel = null_dep libdrm_nouveau = null_dep
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 27/29 lib/igt_debugfs: Implement mount() for FreeBSD
In reply to D Scott Phillipsdebugfs is typically mounted at a different path on FreeBSD, and the mount function prototype is slightly different.
--- lib/igt_debugfs.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
lib/igt_debugfs.c +12 -0
@@ -116,6 +116,7 @@ static bool is_mountpoint(const char *path)static const char *__igt_debugfs_mount (void ) { +#if defined(__linux__)if (is_mountpoint ("/sys/kernel/debug" ))return "/sys/kernel/debug" ;
@@ -126,6 +127,17 @@ static const char *__igt_debugfs_mount(void)return NULL ;return "/sys/kernel/debug" ; +#elif defined(__FreeBSD__) +if (is_mountpoint ("/compat/linux/debug" )) +return "/compat/linux/debug" ; + +if (mount ("lindebugfs" ,"/compat/linux/debug" ,0 ,NULL )) +return NULL ; + +return "/compat/linux/debug" ; +#else +#error Do not know how to mount debugfs +#endif }/**
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 28/29 build: Add support for building on non-Linux
In reply to D Scott PhillipsThis makes libkmod and libprocps dependencies option on non-Linux platforms and skips building tests which depend on Linux-specific functionality.
--- benchmarks/meson.build | 7 ++++++- meson.build | 4 ++-- tests/meson.build | 30 ++++++++++++++++++++---------- tools/meson.build | 12 +++++++----- 4 files changed, 35 insertions(+), 18 deletions(-)
benchmarks/meson.build +6 -1
@@ -11,12 +11,17 @@ benchmark_progs = [ 'gem_mmap', 'gem_prw', 'gem_set_domain', - 'gem_syslatency', 'kms_vblank', 'prime_lookup', 'vgem_mmap', ] +if host_machine.system() == 'linux' + benchmark_progs += [ + 'gem_syslatency', + ] +endif + if libdrm_intel.found() benchmark_progs += [ 'intel_upload_blit_large',
meson.build +2 -2
@@ -122,8 +122,8 @@ endif build_info += 'With libdrm: ' + ','.join(libdrm_info) pciaccess = dependency('pciaccess', version : '>=0.10') -libkmod = dependency('libkmod') -libprocps = dependency('libprocps', required : true) +libkmod = dependency('libkmod', required : host_machine.system() == 'linux') +libprocps = dependency('libprocps', required : host_machine.system() == 'linux') libunwind = dependency('libunwind', required : get_option('libunwind')) build_info += 'With libunwind: @0@'.format(libunwind.found())
tests/meson.build +20 -10
@@ -9,7 +9,6 @@ test_progs = [ 'drm_import_export', 'drm_mm', 'drm_read', - 'fbdev', 'kms_3d', 'kms_addfb_basic', 'kms_atomic',
@@ -21,11 +20,9 @@ test_progs = [ 'kms_ccs', 'kms_color', 'kms_concurrent', - 'kms_content_protection', 'kms_crtc_background_color', 'kms_cursor_crc', 'kms_cursor_edge_walk', - 'kms_cursor_legacy', 'kms_dp_aux_dev', 'kms_dp_dsc', 'kms_dp_tiled_display',
@@ -56,7 +53,6 @@ test_progs = [ 'kms_prop_blob', 'kms_properties', 'kms_psr', - 'kms_psr2_su', 'kms_pwrite_crc', 'kms_rmfb', 'kms_rotation_crc',
@@ -84,7 +80,6 @@ test_progs = [ 'syncobj_basic', 'syncobj_wait', 'template', - 'tools_test', 'v3d_get_bo_offset', 'v3d_get_param', 'v3d_mmap',
@@ -100,6 +95,16 @@ test_progs = [ 'vgem_slow', ] +if host_machine.system() == 'linux' + test_progs += [ + 'fbdev', + 'kms_content_protection', + 'kms_cursor_legacy', + 'kms_psr2_su', + 'tools_test', + ] +endif + i915_progs = [ 'gen3_mixed_blits', 'gen3_render_linear_blits',
@@ -151,7 +156,6 @@ i915_progs = [ 'gem_exec_parse_blt', 'gem_exec_reloc', 'gem_exec_reuse', - 'gem_exec_schedule', 'gem_exec_store', 'gem_exec_suspend', 'gem_exec_whisper',
@@ -172,7 +176,6 @@ i915_progs = [ 'gem_media_fill', 'gem_media_vme', 'gem_mmap', - 'gem_mmap_gtt', 'gem_mmap_offset_exhaustion', 'gem_mmap_wc', 'gem_partial_pwrite_pread',
@@ -221,7 +224,6 @@ i915_progs = [ 'gem_tiling_max_stride', 'gem_unfence_active_buffers', 'gem_unref_active_buffers', - 'gem_userptr_blits', 'gem_vm_create', 'gem_wait', 'gem_workarounds',
@@ -229,11 +231,9 @@ i915_progs = [ 'i915_fb_tiling', 'i915_getparams_basic', 'i915_hangman', - 'i915_module_load', 'i915_pm_backlight', 'i915_pm_lpsp', 'i915_pm_rc6_residency', - 'i915_pm_rpm', 'i915_pm_dc', 'i915_pm_rps', 'i915_pm_sseu',
@@ -242,6 +242,16 @@ i915_progs = [ 'i915_suspend', ] +if host_machine.system() == 'linux' + i915_progs += [ + 'gem_exec_schedule', + 'gem_mmap_gtt', + 'gem_userptr_blits', + 'i915_module_load', + 'i915_pm_rpm', + ] +endif + test_deps = [ igt_deps ] if libdrm_nouveau.found()
tools/meson.build +7 -5
@@ -90,11 +90,13 @@ install_subdir('registers', install_dir : datadir, 'Makefile', 'Makefile.in', 'Makefile.am', ]) -shared_library('intel_aubdump', 'aubdump.c', - dependencies : [ lib_igt_chipset, dlsym ], - name_prefix : '', - install : true, - soversion : '0') +if host_machine.system() == 'linux' + shared_library('intel_aubdump', 'aubdump.c', + dependencies : [ lib_igt_chipset, dlsym ], + name_prefix : '', + install : true, + soversion : '0') +endif executable('intel_gpu_top', 'intel_gpu_top.c', install : true,
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 29/29 lib/igt_device_scan: add null implementation
In reply to D Scott Phillips--- lib/igt_device_scan_null.c | 67 ++++++++++++++++++++++++++++++++++++++ lib/meson.build | 3 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 lib/igt_device_scan_null.c
lib/igt_device_scan_null.c new file +67 -0
@@ -0,0 +1,67 @@ +/* +* Copyright © 2019 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. +* +*/ + +#include <fcntl.h> +#include "igt_device_scan.h" + +void igt_devices_scan (bool force) { +} + +void igt_devices_print (enum igt_devices_print_type printtype) { +} + +void igt_devices_print_vendors (void ) { +} + +void igt_device_print_filter_types (void ) { +} + +bool igt_device_is_filter_set (void ) { +return false; +} + +void igt_device_filter_set (const char *filter) { +} + +void igt_device_filter_free (void ) { +} + +const char *igt_device_filter_get (void ) { +return NULL ; +} + +bool igt_device_card_match (const char *filter,struct igt_device_card *card) { + card->subsystem[0 ] ='\0' ; +strcpy (card->card,"/dev/dri/card0" ); +strcpy (card->render,"/dev/dri/renderD128" ); +return true; +} + +int igt_open_card (struct igt_device_card *card) { +return open (card->card,O_RDWR ); +} + +int igt_open_render (struct igt_device_card *card) { +return open (card->render,O_RDWR ); +}
lib/meson.build +2 -1
@@ -10,7 +10,6 @@ lib_sources = [ 'igt_color_encoding.c', 'igt_debugfs.c', 'igt_device.c', - 'igt_device_scan.c', 'igt_gt.c', 'igt_halffloat.c', 'igt_matrix.c',
@@ -67,12 +66,14 @@ lib_sources = [ if host_machine.system() == 'linux' lib_sources += [ 'igt_aux.c', + 'igt_device_scan.c', 'igt_kmod.c', 'igt_perf.c', ] else lib_sources += [ 'igt_aux_null.c', + 'igt_device_scan_null.c', 'igt_kmod_null.c', 'igt_perf_null.c', ]
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ GitLab.Pipeline: warning for Add FreeBSD Support
In reply to D Scott Phillips== Series Details ==
== Series Details ==
Series: Add FreeBSD Support
URL : https://patchwork.freedesktop.org/series/70729/
State : warning
== Summary ==
Did not get list of undocumented tests for this run, something is wrong!
Other than that, pipeline status: FAILED.
see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/87430 for the overview.
test:ninja-test has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/1113838):
5/292 lib: igt_describe FAIL 0.07 s (killed by signal 6 SIGABRT)
--- command ---
/builds/gfx-ci/igt-ci-tags/build/lib/tests/igt_describe
--- stderr ---
igt_describe: ../lib/tests/igt_describe.c:248: main: Assertion `0 == strcmp(DESCRIBE_ALL_OUTPUT, out)' failed.
-------
Full log written to /builds/gfx-ci/igt-ci-tags/build/meson-logs/testlog.txt
FAILED: meson-test
/usr/bin/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed. section_end:1576027580:build_script [0Ksection_start:1576027580:after_script [0Ksection_end:1576027582:after_script [0Ksection_start:1576027582:upload_artifacts_on_failure [0Ksection_end:1576027583:upload_artifacts_on_failure [0K[31;1mERROR: Job failed: exit code 1
[0;m
test:ninja-test-clang has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/1113839):
5/292 lib: igt_describe FAIL 0.12 s (killed by signal 6 SIGABRT)
--- command ---
/builds/gfx-ci/igt-ci-tags/build/lib/tests/igt_describe
--- stderr ---
igt_describe: ../lib/tests/igt_describe.c:248: int main(int, char **): Assertion `0 == strcmp(DESCRIBE_ALL_OUTPUT, out)' failed.
-------
Full log written to /builds/gfx-ci/igt-ci-tags/build/meson-logs/testlog.txt
FAILED: meson-test
/usr/bin/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed. section_end:1576027708:build_script [0Ksection_start:1576027708:after_script [0Ksection_end:1576027712:after_script [0Ksection_start:1576027712:upload_artifacts_on_failure [0Ksection_end:1576027717:upload_artifacts_on_failure [0K[31;1mERROR: Job failed: exit code 1
[0;m
test:ninja-test-minimal has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/1113840):
5/20 lib: igt_describe FAIL 0.05 s (killed by signal 6 SIGABRT)
--- command ---
/builds/gfx-ci/igt-ci-tags/build/lib/tests/igt_describe
--- stderr ---
igt_describe: ../lib/tests/igt_describe.c:248: main: Assertion `0 == strcmp(DESCRIBE_ALL_OUTPUT, out)' failed.
-------
Full log written to /builds/gfx-ci/igt-ci-tags/build/meson-logs/testlog.txt
FAILED: meson-test
/usr/bin/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed. section_end:1576027591:build_script [0Ksection_start:1576027591:after_script [0Ksection_end:1576027593:after_script [0Ksection_start:1576027593:upload_artifacts_on_failure [0Ksection_end:1576027594:upload_artifacts_on_failure [0K[31;1mERROR: Job failed: exit code 1
[0;m
test:ninja-test-arm64 has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/1113841):
(runner_test:2781) igt_core-INFO: #3 ../runner/runner_tests.c:207 main() (runner_test:2781) igt_core-INFO: #4 [__libc_start_main+0xe4] (runner_test:2781) igt_core-INFO: #5 [_start+0x34]
**** END ****
-------
Full log written to /builds/gfx-ci/igt-ci-tags/build/meson-logs/testlog.txt
FAILED: meson-test
/usr/bin/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed. section_end:1576027619:build_script [0Ksection_start:1576027619:after_script [0Ksection_end:1576027622:after_script [0Ksection_start:1576027622:upload_artifacts_on_failure [0K[32;1mUploading artifacts...[0;m
build: found 1367 matching files [0;m
Uploading artifacts to coordinator... ok [0;m id[0;m=1113841 responseStatus[0;m=201 Created token[0;m=yisbfGa-
section_end:1576027638:upload_artifacts_on_failure [0K[31;1mERROR: Job failed: exit code 1
[0;m
test:ninja-test-armhf has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/1113842):
(runner_test:6370) igt_core-INFO: #3 ../runner/runner_tests.c:207 main() (runner_test:6370) igt_core-INFO: #4 [__libc_start_main+0x98] (runner_test:6370) igt_core-INFO: #5 [_start+0x34]
**** END ****
-------
Full log written to /builds/gfx-ci/igt-ci-tags/build/meson-logs/testlog.txt
FAILED: meson-test
/usr/bin/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed. section_end:1576027636:build_script [0Ksection_start:1576027636:after_script [0Ksection_end:1576027638:after_script [0Ksection_start:1576027638:upload_artifacts_on_failure [0K[32;1mUploading artifacts...[0;m
build: found 1368 matching files [0;m
Uploading artifacts to coordinator... ok [0;m id[0;m=1113842 responseStatus[0;m=201 Created token[0;m=8JmvzRer
section_end:1576027648:upload_artifacts_on_failure [0K[31;1mERROR: Job failed: exit code 1
[0;m
test:ninja-test-mips has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/1113843):
skip-two
exit:77 ('
(runner_test:3066) igt_core-INFO: Stack trace:
**** END ****
-------
Full log written to /builds/gfx-ci/igt-ci-tags/build/meson-logs/testlog.txt
FAILED: meson-test
/usr/bin/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed. section_end:1576027650:build_script [0Ksection_start:1576027650:after_script [0Ksection_end:1576027652:after_script [0Ksection_start:1576027652:upload_artifacts_on_failure [0K[32;1mUploading artifacts...[0;m
build: found 1367 matching files [0;m
Uploading artifacts to coordinator... ok [0;m id[0;m=1113843 responseStatus[0;m=201 Created token[0;m=Wzx6Tkmi
section_end:1576027661:upload_artifacts_on_failure [0K[31;1mERROR: Job failed: exit code 1
[0;m
test:test-list-diff has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/1113844):
Downloading artifacts from coordinator... ok [0;m id[0;m=1113837 responseStatus[0;m=200 OK token[0;m=fm6a3z1R
[32;1mDownloading artifacts for build:tests-debian-meson (1113832)...[0;m
Downloading artifacts from coordinator... ok [0;m id[0;m=1113832 responseStatus[0;m=200 OK token[0;m=dtUDS1AD
section_end:1576027637:download_artifacts
[0Ksection_start:1576027637:build_script
[0K[0KAuthenticating with credentials from job payload (GitLab Registry)
[0;m[32;1m$ diff <(sed "s/ /\n/g" meson-test-list.txt| grep -v 'vc4\|v3d\|panfrost' | sort) <(sed "s/ /\n/g" autotools-test-list.txt | sort)[0;m 1d0
<
10c9
< amdgpu/amd_prime-e
---
Quoted 1 line
amdgpu/amd_prime
section_end:1576027639:build_script [0Ksection_start:1576027639:after_script [0Ksection_end:1576027640:after_script [0Ksection_start:1576027640:upload_artifacts_on_failure [0Ksection_end:1576027642:upload_artifacts_on_failure [0K[31;1mERROR: Job failed: exit code 1
[0;m
== Logs ==
For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/87430
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 14 lines · D Scott Phillips
FreeBSD maintains a port of drm and a few drivers: amdgpu, i915, radeon, vboxvideo, vmwgfx:
https://github.com/FreeBSDDesktop/kms-drm/
Recently I backported some drm & i915 security patches into our tree and was lacking a way to verify the backports. Here is my attempt at adding FreeBSD support to igt.
I've tried to order the series so that what I believe will be less controversial comes nearer the start. I've also tried to err on the side of too many small patches, so I'm happy to squash things where that seems more appropriate to people.
Quoted 4 lines
The "null" implementations toward the end are probably more like RFC ideas. I'm willing to take other approaches there if anyone has a better idea for how to handle large sections of code that are more linux specific. Cheers,
I'll mostly defer to Petri and Arek, the IGT maintainers, on the details.
I think the bigger questions are, 1) How do we ensure this does not bitrot in a matter of weeks? Which translates to, 2) Who is going to automate and maintain continuous build testing? And, 3) Who's going to take ownership of the port in general?
Personally, I don't think this is going to work long term just by merging the port upstream. I think without the continuous support from people who care about FreeBSD, this is going to be a net negative.
BR,
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 11 lines · Jani Nikula
I'll mostly defer to Petri and Arek, the IGT maintainers, on the details.
I think the bigger questions are, 1) How do we ensure this does not bitrot in a matter of weeks? Which translates to, 2) Who is going to automate and maintain continuous build testing? And, 3) Who's going to take ownership of the port in general?
Personally, I don't think this is going to work long term just by merging the port upstream. I think without the continuous support from people who care about FreeBSD, this is going to be a net negative.
Right, I think that's a fair point. What level of continuous support do you think would get us out of the negative here? A continuous build could be fairly easy to get configured, but might be a side workflow apart from how normal CI results are presented. I think that could be a reasonable indication that things aren't rotting. More sophisticated CI is within the realm of possibility but could be quite a bit harder to get off the ground with.
Ultimately, I think as long as the kernel driver port exists this is something that we will want.
As to who owns the port, FreeBSD has a "Graphics Team" that collectively owns the kernel driver port, so I think the most robust answer going forward is to have them own this port. I can take this up with them and see if they'll affirm that they will take some ownership here.
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 14 lines · D Scott Phillips
Quoted 11 lines · Jani Nikula
I'll mostly defer to Petri and Arek, the IGT maintainers, on the details.
I think the bigger questions are, 1) How do we ensure this does not bitrot in a matter of weeks? Which translates to, 2) Who is going to automate and maintain continuous build testing? And, 3) Who's going to take ownership of the port in general?
Personally, I don't think this is going to work long term just by merging the port upstream. I think without the continuous support from people who care about FreeBSD, this is going to be a net negative.
Quoted 7 lines
Right, I think that's a fair point. What level of continuous support do you think would get us out of the negative here? A continuous build could be fairly easy to get configured, but might be a side workflow apart from how normal CI results are presented. I think that could be a reasonable indication that things aren't rotting. More sophisticated CI is within the realm of possibility but could be quite a bit harder to get off the ground with.
I'd say the bar to reach is
* build-testing for each commit
* someone responsible for fixing issues in the above in a timely manner
Build-testing we can reach quite easily in gitlab, for some values of easily, but the second point is harder.
Quoted 2 lines
Ultimately, I think as long as the kernel driver port exists this is something that we will want.
Yep. Ultimately, running the tests on HW on FreeBSD is a change that I would very much welcome.
Quoted 4 lines
As to who owns the port, FreeBSD has a "Graphics Team" that collectively owns the kernel driver port, so I think the most robust answer going forward is to have them own this port. I can take this up with them and see if they'll affirm that they will take some ownership here.
Thanks for doing this!
As for the series as such:
There's some trivial cleanups in there that I suspect will help even Linux users on non-glibc systems that we can merge as is. I'm going to go through reviewing the series later this week for those parts.
The null-implementation patches are for sure getting a NAK in that form. They need a function-by-function analysis of whether the correct "do nothing" approach is actually doing nothing or straight up igt_skip("Not supported on this platform"); in some form. For example, tests that use igt_fork_signal_helper will test nothing if they don't manage to fork a periodical interrupter process.
Signature · 5 lines
Petri Latvala _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 23 lines · Petri Latvala
Quoted 14 lines · D Scott Phillips
Quoted 11 lines · Jani Nikula
I'll mostly defer to Petri and Arek, the IGT maintainers, on the details.
I think the bigger questions are, 1) How do we ensure this does not bitrot in a matter of weeks? Which translates to, 2) Who is going to automate and maintain continuous build testing? And, 3) Who's going to take ownership of the port in general?
Personally, I don't think this is going to work long term just by merging the port upstream. I think without the continuous support from people who care about FreeBSD, this is going to be a net negative.
Quoted 7 lines
Right, I think that's a fair point. What level of continuous support do you think would get us out of the negative here? A continuous build could be fairly easy to get configured, but might be a side workflow apart from how normal CI results are presented. I think that could be a reasonable indication that things aren't rotting. More sophisticated CI is within the realm of possibility but could be quite a bit harder to get off the ground with.
Quoted 7 lines
I'd say the bar to reach is
* build-testing for each commit
* someone responsible for fixing issues in the above in a timely mannerBuild-testing we can reach quite easily in gitlab, for some values of easily, but the second point is harder.
Do we have any FreeBSD runners[0] available on freedesktop's GitLab already? Or do you have something else (virt) in mind?
[0]: https://docs.gitlab.com/runner/install/freebsd.html
Quoted 12 lines
Quoted 3 lines
Ultimately, I think as long as the kernel driver port exists this is something that we will want.
Yep. Ultimately, running the tests on HW on FreeBSD is a change that I would very much welcome.
Quoted 4 lines
As to who owns the port, FreeBSD has a "Graphics Team" that collectively owns the kernel driver port, so I think the most robust answer going forward is to have them own this port. I can take this up with them and see if they'll affirm that they will take some ownership here.
Quoted 7 lines
Thanks for doing this!
As for the series as such:
There's some trivial cleanups in there that I suspect will help even Linux users on non-glibc systems that we can merge as is. I'm going to go through reviewing the series later this week for those parts.
Google is maintaining IGT for Android port and they decided it's easier to do that out of tree. FreeBSD is closer to what most IGT devs are using, so it shouldn't be too much pain for both FreeBSD and Linux folks.
Anyway, since Android is also a non-glibc system I think it's worth looking at what they have been cooking on their side:
https://android.googlesource.com/platform/external/igt-gpu-tools/+log
Signature · 2 lines
Cheers, Arek
Quoted 10 lines
The null-implementation patches are for sure getting a NAK in that form. They need a function-by-function analysis of whether the correct "do nothing" approach is actually doing nothing or straight up
igt_skip("Not supported on this platform"); in some form. For example, tests that useigt_fork_signal_helperwill test nothing if they don't manage to fork a periodical interrupter process.Signature · 1 line
Petri Latvala
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev