8 Commits

Author SHA1 Message Date
Mika Kuoppala
32329b2e7d tests/drm_import_export: Always loop with mutex held
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-25 15:52:18 +02:00
Daniel Stone
de7ccdd083 tests: Run igt.cocci
Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-11-03 19:46:11 +00:00
Micah Fedke
c81d293aed convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocci
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-09-11 14:39:43 +01:00
Thomas Wood
804e11f40d lib: add a single include header
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-08-21 09:37:10 +01:00
Michał Winiarski
d49a868378 tests/drm_import_export: Add tests for prime/flink sharing races
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-07-24 15:55:18 +01:00
Alan Coopersmith
99e6defbe7 Use pthread calls instead of raw syscalls on non-Linux systems
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>
2015-01-06 09:29:45 +01:00
Daniel Vetter
c3eca6f7d3 tests/drm_import_export: Add subtest for prime
Cc: Rafal Sapala <rafal.a.sapala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-19 09:32:14 +02:00
Daniel Vetter
a018d60f63 tests: Add drm_import_export
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>
2014-09-18 17:36:58 +02:00