summaryrefslogtreecommitdiff
path: root/tests/drm_import_export.c
AgeCommit message (Collapse)Author
2019-05-07lib/aux: Typecast gettid() as pid_tLyude Paul
Partly, for correctness. But mostly because not typecasting properly causes the gettid() macro provided by newer glibc to be typed as pid_t (aka int), while ours is typed as long. Causing annoying warnings: [158/846] Compiling C object 'tests/59830eb@@drm_import_export@exe/drm_import_export.c.o'. In file included from ../../mnt/vol/lib/drmtest.h:39, from ../../mnt/vol/lib/igt.h:27, from ../../mnt/vol/tests/drm_import_export.c:27: ../../mnt/vol/tests/drm_import_export.c: In function ‘test_thread’: ../../mnt/vol/tests/drm_import_export.c:123:12: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘__pid_t’ {aka ‘int’} [-Wformat=] 123 | igt_debug("start %ld\n", gettid()); | ^~~~~~~~~~~~~ ~~~~~~~~ | | | __pid_t {aka int} ../../mnt/vol/lib/igt_core.h:875:64: note: in definition of macro ‘igt_debug’ 875 | #define igt_debug(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_DEBUG, f) | ^ ../../mnt/vol/tests/drm_import_export.c:123:21: note: format string is defined here 123 | igt_debug("start %ld\n", gettid()); | ~~^ | | | long int | %d So, typecast gettid() as pid_t and update all of our callers accordingly Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-05-07Use gettid() wrapper everywhereLyude Paul
Currently we have multiple different parts of IGT that define their own wrapper around the gettid() syscall (or just call it directly with no wrapper). Additionally, add the appropriate #includes for igt_aux.h to make sure syscall() is available. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-01-16drm/drm_import_export: Replace imprecise loop-bound with timeoutChris Wilson
Use a specific timeout to exercise the race conditions, rather than a number of tries -- this prevents it burning up too many minutes under CI for little gain, we can just run it again to improve race detection. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108667 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2017-09-08build: remove _GNU_SOURCE from source filesDaniel Vetter
We are, the build system takes care of that. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-06-07tests/drm_import_export: Include {i915_,}drm.h properlyArkadiusz Hiler
Using `libdrm/` impairs compatibility with android build system and pkg-config manages -I for us on regular distros. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2015-11-25tests/drm_import_export: Always loop with mutex heldMika Kuoppala
We assume that lock is held on start of the loop scope. Some paths continuing inside loop didn't adhere to this assumption, causing segfault on unlocking an already unlocked mutex. Fix this by re-aquiring lock always. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93013 Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2015-11-03tests: Run igt.cocciDaniel Stone
Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: add a single include headerThomas Wood
Add a header that includes all the headers for the library. This allows reorganisation of the library without affecting programs using it and also simplifies the headers that need to be included to use the library. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-24tests/drm_import_export: Add tests for prime/flink sharing racesMichał Winiarski
It is possible to race between unreference of the underlying BO and importing it from prime_fd/name. Verify that the behaviour of libdrm is consistent for prime/flink. v2: more comments in source file, dropped extra whitespace Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-01-06Use pthread calls instead of raw syscalls on non-Linux systemsAlan Coopersmith
Raw system calls aren't portable to other kernels. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-19tests/drm_import_export: Add subtest for primeDaniel Vetter
Cc: Rafal Sapala <rafal.a.sapala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-18tests: Add drm_import_exportDaniel Vetter
Multithreaded test to validate the (lack of) locking in the flink/open code in libdrm-intel. Based on a testcase from Rafel Sapala. Cc: Rafal Sapala <rafal.a.sapala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>